/check_uptime.pl show incorrect uptime.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: /check_uptime.pl show incorrect uptime.

Post by ssax »

In addition to tmcdonald's post

You have to use the -H option:

Code: Select all

./check_uptime.pl -f -w 10000 -H 10.X.X.X -C community
mkhan12282
Posts: 28
Joined: Sun May 31, 2015 3:02 pm

Re: /check_uptime.pl show incorrect uptime.

Post by mkhan12282 »

Hi Please find below.
FYI, i just used the nagios GUI username i.e. -l mylogin

[root@xx-xx-NAGIOS01 libexec]# ./check_uptime.pl -c password -l 1 172.16.x.x -l mylogin -v

Alarm at 20 + 5
Local Uptime Result is: 11:45:33 up 19:00, 1 user, load average: 0.03, 0.02, 0.00

System Type: 1 (local)
System Info: Linux xxxx-NAGIOS01.xx.co.uk 2.6.32-431.5.1.el6.x86_64
Uptime Text: up 19 hours 0 minutes
Uptime Minutes: 1140
OK: Linux xxxx-NAGIOS01.xx.co.uk 2.6.32-431.5.1.el6.x86_64 - up 19 hours 0 minutes

From the actual device:
xx-xx-VGW01#sh ver
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.2(4)M5, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Fri 13-Sep-13 14:59 by prod_rel_team

ROM: System Bootstrap, Version 15.0(1r)M16, RELEASE SOFTWARE (fc1)

xx-xx-VGW01 uptime is 52 weeks, 15 hours, 3 minutes

-- update --
Saw your colleague comment so i have added the output as requsted, which shows the correct uptime.


[root@xx-NAGIOS01 libexec]# ./check_uptime.pl -f -w 10000 -H 172.16.x.x -C password -v
Alarm at 20 + 5
SNMP v1 login
172.16.175.10 SysInfo Result from OID 1.3.6.1.2.1.1.1.0: Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.2(4)M5, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Fri 13-Sep-13 14:59 by prod_rel_team
Guessing Type: 5 = netswitch
Received noSuchName error for OID 1.3.6.1.6.3.10.2.1.3, will now try hostUpTime
Received noSuchName error for hostUpTime OID 1.3.6.1.2.1.25.1.1.0, will now try sysUpTime
172.16.x.x Uptime Result from OID 1.3.6.1.2.1.1.3.0: 364 days, 15:24:00.56
System Type: 4 (unix-sys)
System Info: Cisco IOS Software,
Uptime Text: up 364 days 15 hours 24 minutes
Uptime Minutes: 525084
OK: Cisco IOS Software, - up 364 days 15 hours 24 minutes | type=4 uptime_minutes=525084


Yeah, don't know why -u option is there, but i have removed it for the command line test.
Thanks.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: /check_uptime.pl show incorrect uptime.

Post by jdalrymple »

So you can add that '-H $HOSTADDRESS$' bit to your command definition and you should be good to go right?
mkhan12282
Posts: 28
Joined: Sun May 31, 2015 3:02 pm

Re: /check_uptime.pl show incorrect uptime.

Post by mkhan12282 »

Perfect, thanks.
it worked :)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: /check_uptime.pl show incorrect uptime.

Post by rkennedy »

Glad to see this worked. As this is resolved, do you mind if I close this thread out?
Former Nagios Employee
Locked