Ok. That did the trick. The only thing is if the service is down Nagios recognizes it as "Unknown/Amber" and not "Critical/Red". But yea I think that's good enough for now!hsmith wrote:Quick example script. It's pretty hack-y, but hey, it does the thing.
Code: Select all
#!/bin/bash S1="active" Info=$(systemctl status $1 | awk 'NR==3' | awk '{print $2}') if [ $Info == $S1 ] then echo "yay" $1 "is running!" exit 0 else echo "boooo" $1 "is not running!" exit 3 fi
Nagios does not update status in the UI
Re: Nagios does not update status in the UI
Re: Nagios does not update status in the UI
Have it exit with 2 instead of 3. Oops.
0 = Good
1 = Warning
2 = Critical
3 = Unknown
0 = Good
1 = Warning
2 = Critical
3 = Unknown
Former Nagios Employee.
me.
me.
Re: Nagios does not update status in the UI
Yep. Awesome man thanks again! We can close this out.
Re: Nagios does not update status in the UI
Glad to see this worked out! I will now close this thread, but feel free to open another in the future if you need more assistance.
Former Nagios Employee