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.