Last active
February 22, 2024 12:34
-
-
Save kvaps/8b7b934094e39621d2dc7af98eaf245d to your computer and use it in GitHub Desktop.
This file contains 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 | |
# 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