Page 1 of 1

UpTime check via SNMP

Posted: Thu Jun 13, 2019 12:41 pm
by mpedros
Hi:

I am checking the uptime of a desktop by SNMP and it works correctly.

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance
SNMP OK - 853898 | DISMAN-EVENT-MIB::sysUpTimeInstance=853898
[root@localhost libexec]#
How could I have generated a warning if the value is less than for example "8000 timeticks"? I guess with regular expressions but I do not know how to configure it.

I thank you in advance for the help.

Re: UpTime check via SNMP

Posted: Thu Jun 13, 2019 4:28 pm
by scottwilkerson

Code: Select all

./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @8000

Re: UpTime check via SNMP

Posted: Fri Jun 14, 2019 6:28 am
by mpedros
Hi Scott:

Thank you very much for your prompt response, it worked correctly! Do you have any suggestions where I can study these types of expressions for SNMP monitoring?

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @8000
SNMP OK - 4833603 | DISMAN-EVENT-MIB::sysUpTimeInstance=4833603;8000;;
[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -w @5000000
SNMP WARNING - *4835102* | DISMAN-EVENT-MIB::sysUpTimeInstance=4835102;5000000;;
[root@localhost libexec]# ./check_snmp -H 192.168.6.5 -C B4x0Syst3msv2 -o sysUpTimeInstance -c @5000000
SNMP CRITICAL - *4836174* | DISMAN-EVENT-MIB::sysUpTimeInstance=4836174;;5000000;
[root@localhost libexec]#
Thank you and have a nice day!

Re: UpTime check via SNMP

Posted: Fri Jun 14, 2019 8:33 am
by scottwilkerson
mpedros wrote: Thank you very much for your prompt response, it worked correctly! Do you have any suggestions where I can study these types of expressions for SNMP monitoring?
great!

Here is the resource
https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT

This is how official plugins are supposed to work but, many plugins are from the community that may not conform.

Re: UpTime check via SNMP

Posted: Sat Jun 15, 2019 9:54 am
by mpedros
Thank you very much Scott, have a nice day!

Re: UpTime check via SNMP

Posted: Mon Jun 17, 2019 6:45 am
by scottwilkerson
mpedros wrote:Thank you very much Scott, have a nice day!
You too!

Locking thread