Syntax Command Check_netstat_conn

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Syntax Command Check_netstat_conn

Post 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.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Syntax Command Check_netstat_conn

Post 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.
Former Nagios Employee
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Syntax Command Check_netstat_conn

Post by ednaldojta »

OK! Thank you friends for help! Already meets the desired result!

Thank you so!

To the next!
: D
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Syntax Command Check_netstat_conn

Post by rkennedy »

Good to hear!

Am I good to mark this thread as resolved?
Former Nagios Employee
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Syntax Command Check_netstat_conn

Post by ednaldojta »

Yes!
And one more time! thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Syntax Command Check_netstat_conn

Post 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.
Former Nagios Employee
Locked