i'm noob in bash.
I want to create check so if 1 path is dead i want to get warning message,more than 1 path down-critical, no dead path-all is OK
i would use this command and it's output:
powermt display dev=all
CHECK_DEGRADED=/usr/local/bin/sudo /sbin/powermt display | grep dead| wc -l
if [ $CHECK_DEGRADED -eq 1 ]; then
status=1
statustxt=WARNING
else if [ $CHECK_DEGRADED -gt 1 ]; then
status=2
statustxt=CRITICAL
else
status=0
statustxt=OK
fi
output should be something like: Path is in $statustxt state
First of all Welcome to Stack Overflow.
Something like that should be fine: