Page 5 of 5

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 7:30 am
by ednaldojta
Hello friends,
I thank all of you help!
But really it takes is starting a criterion, for example.

#############################
if [ "$ arg1" -gt 2]
Then
echo "Service is OK"
fi

#############################

And starting this status or otherwise, the status it it in Dashboard green turns to red or yellow, referring to the criteria that I set.

As follows the image below. I set a criterion, but the service is still green despite being Warning regarding the criteria that define the Scritp.

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 12:37 pm
by rkennedy
Ah, you'll want to add in exit codes for this. Using your example -

Code: Select all


#############################
if [ "$ arg1" -gt 2]
Then
echo "Service is OK"
exit 0
fi

#############################
exit 1 - represents warning
exit 2 - represents critical
exit 3 - represents unknown

Once you update the script, it should work accordingly.

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 12:48 pm
by ednaldojta
OK! Thank you friends for help! Already meets the desired result!

Thank you so!

To the next!
: D

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 1:08 pm
by rkennedy
Good to hear!

Am I good to mark this thread as resolved?

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 1:26 pm
by ednaldojta
Yes!
And one more time! thank you!

Re: Syntax Command Check_netstat_conn

Posted: Tue Mar 29, 2016 2:07 pm
by rkennedy
No problem! We're here to help.

If you need any assistance in the future, feel free to open up a new thread.