This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
rickb
Posts: 6 Joined: Sun Feb 22, 2015 11:55 am
Post
by rickb » Sat Sep 26, 2015 12:27 pm
I am trying to setup a check to see when a server has been up to long on both windows and linux. I have tried the check_uptime and check_uptime_snmp but looks like it is backwards from what I need. I have tried the negate with the check scripts but it does not seem to be flipping the status.
I made a new command using the negate and ran the following but still get the wrong status code. Am I missing something or does the negate not work on this? I have tried the included check_uptime with in XI and the one from the nagios exchange with the same results.
check_nt
Code: Select all
[root@localhost libexec]# ./negate ./check_nt -H 10.100.100.10 -s "Password1234" -p 12489 -v UPTIME -w 13500
System Uptime - 9 day(s) 1 hour(s) 26 minute(s) |uptime=13046
[root@localhost libexec]# echo $?
1
[root@localhost libexec]#
Help would be appreciated.
jdalrymple
Skynet Drone
Posts: 2620 Joined: Wed Feb 11, 2015 1:56 pm
Post
by jdalrymple » Mon Sep 28, 2015 8:54 am
negate generally tweaks -c, not -w. You can adjust that behavior as you see fit:
Code: Select all
[root@localhost libexec]# ./check_nt -H winbox -s "nsclient" -p 12489 -v UPTIME -w 13500
System Uptime - 5 day(s) 23 hour(s) 35 minute(s) |uptime=8615
[root@localhost libexec]# echo $?
1
[root@localhost libexec]# ./negate -w OK ./check_nt -H winbox -s "nsclient" -p 12489 -v UPTIME -w 13500
System Uptime - 5 day(s) 23 hour(s) 35 minute(s) |uptime=8615
[root@localhost libexec]# echo $?
0
rickb
Posts: 6 Joined: Sun Feb 22, 2015 11:55 am
Post
by rickb » Tue Sep 29, 2015 10:26 pm
Those examples don't seem to be working other then
Code: Select all
./negate ./check_nt -H winbox -s "nsclient" -p 12489 -v UPTIME -c 13500 but we don't want it to be critical just a warning. Any other suggestions?
tgriep
Madmin
Posts: 9190 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Wed Sep 30, 2015 6:14 am
Take a look at this link for setting up thresholds and see if it helps out with what you need.
Code: Select all
https://nagios-plugins.org/doc/guidelines.html#THRESHOLDFORMAT
Be sure to check out our
Knowledgebase for helpful articles and solutions!