Skip to content

Instantly share code, notes, and snippets.

@kvaps
Last active February 22, 2024 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kvaps/8b7b934094e39621d2dc7af98eaf245d to your computer and use it in GitHub Desktop.
Save kvaps/8b7b934094e39621d2dc7af98eaf245d to your computer and use it in GitHub Desktop.
#!/bin/bash
# onevm monitoring for zabbix script
case $1 in
a* ) echo $(onevm list -l STAT | tail -n +2 | wc -l) ;;
r* ) echo $(onevm list -l STAT | tail -n +2 | grep 'runn\|boot' | wc -l) ;;
su* ) echo $(onevm list -l STAT | tail -n +2 | grep 'susp\|save' | wc -l) ;;
st* ) echo $(onevm list -l STAT | tail -n +2 | grep -v 'runn\|susp\|save\|boot\|err\|fail' | wc -l) ;;
e* ) echo $(onevm list -l STAT | tail -n +2 | grep 'err\|fail' | wc -l) ;;
* ) echo Need argument!; exit 1 ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment