Created
July 11, 2018 02:05
-
-
Save ericpulvino/efbd1aed72f517e6bfd57dc6ad79db06 to your computer and use it in GitHub Desktop.
checks the netq ts for OOM condition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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