Skip to content

Instantly share code, notes, and snippets.

@ericpulvino
Created July 11, 2018 02:05
Show Gist options
  • Save ericpulvino/efbd1aed72f517e6bfd57dc6ad79db06 to your computer and use it in GitHub Desktop.
Save ericpulvino/efbd1aed72f517e6bfd57dc6ad79db06 to your computer and use it in GitHub Desktop.
checks the netq ts for OOM condition
#!/bin/bash
used_memory=$(redis-cli info memory | grep "used_memory:" | cut -d ":" -f2 | tr -d '\r' )
max_memory=$(redis-cli info memory | grep "maxmemory:" | cut -d ":" -f2 | tr -d '\r' )
if [[ "$used_memory" -gt "$max_memory" ]]
then
echo "ALERT -- NETQ TS is consuming too much memory!!!"
else
echo "INFO: Memory level on the NetQ TS server is within acceptable limits $used_memory/$max_memory bytes in use."
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment