Page 1 of 2

How to Monitor Switch Uptime

Posted: Fri Oct 25, 2019 3:45 pm
by Alan
I am trying to figure out how to set the switch.cfg file for monitoring uptime. The OID that I have from the MIB Browser is hrSystemUptime .1.3.6.1.2.1.25.1.1.0

This is the website that I am tying to follow - https://assets.nagios.com/downloads/nag ... uters.html

These are all the ways I have tird to add the OID to the switch.cfg file:

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           Accessories
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o hrSystemUptime.1.3.6.1.2.1.25.1.1.0
}

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           linksys-srw224p
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o sysUpTime.1.3.6.1.2.1.25.1.1.0
}

Code: Select all

define service {
    use                 generic-service ; Inherit values from a template
    host_name           linksys-srw224p
    service_description Uptime
    check_command       check_snmp!-C CMPublic -o .1.3.6.1.2.1.25.1.1.0
}
This is all the output that I get and it always just says the status is critical:

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory

When I navigate to /usr/local/nagios/libexec there is a check_smtp
-rwxr-xr-x. 1 nagios nagios 272336 Aug 15 10:07 check_smtp

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 10:17 am
by scottwilkerson
Alan wrote:(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_snmp, ...) failed. errno is 2: No such file or directory
This is /usr/local/nagios/libexec/check_snmp
Alan wrote:When I navigate to /usr/local/nagios/libexec there is a check_smtp
-rwxr-xr-x. 1 nagios nagios 272336 Aug 15 10:07 check_smtp
This is /usr/local/nagios/libexec/check_smtp

check_snmp vs. check_smtp

what is the output of

Code: Select all

ls -l /usr/local/nagios/libexec/check_snmp

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 1:22 pm
by Alan
Sorry for the delay on this. The output of the command is:

Code: Select all

ls -l /usr/local/nagios/libexec/check_snmp
ls: cannot access /usr/local/nagios/libexec/check_snmp: No such file or directory
I did not even notice it was the check_smtp and not check_snmp. So ya the check_snmp in not there. Do you happen to know how I would get this added?

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 1:44 pm
by Alan
I do see the plugin in the nagios-plugins-2.2.1.tar.gz and I am using nagios-plugins-2.1.1. I am also running Nagios Core Version 4.1.1. So I think I am going to attempt to upgrade it to Nagios Core is 4.4.5. If I successfully do this will this also update the plugins?

I am going to be following the instructions here on how to upgrade - https://assets.nagios.com/downloads/nag ... ading.html

This post did say "Make sure you have a good backup of your existing Nagios Core installation and configuration files." Is there away to back all these up in the Nagios dashboard somewhere or do I just need to manually back up all the files located here:

/usr/local/nagios/etc/objects
/usr/local/nagios/etc

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 2:32 pm
by scottwilkerson
Alan wrote:I do see the plugin in the nagios-plugins-2.2.1.tar.gz and I am using nagios-plugins-2.1.1. I am also running Nagios Core Version 4.1.1. So I think I am going to attempt to upgrade it to Nagios Core is 4.4.5. If I successfully do this will this also update the plugins?

I am going to be following the instructions here on how to upgrade - https://assets.nagios.com/downloads/nag ... ading.html
This will not upgrade, the plugins, to upgrade the plugins you can follow this guide (installing and upgrading plugins are the same procedure)
https://support.nagios.com/kb/article.php?id=569
Alan wrote:This post did say "Make sure you have a good backup of your existing Nagios Core installation and configuration files." Is there away to back all these up in the Nagios dashboard somewhere or do I just need to manually back up all the files located here:

/usr/local/nagios/etc/objects
/usr/local/nagios/etc
Yes

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 3:55 pm
by Alan
Ok great thanks. Once I get it all updated are you able to tell me what syntax I need to use for the OID?

Re: How to Monitor Switch Uptime

Posted: Mon Oct 28, 2019 4:17 pm
by scottwilkerson
Alan wrote:Ok great thanks. Once I get it all updated are you able to tell me what syntax I need to use for the OID?
The OIDs you need to use to monitor systems always depend on the manufacturer of the hardware you are using.

You will need to consult their documentation for those.

Re: How to Monitor Switch Uptime

Posted: Tue Oct 29, 2019 5:34 pm
by Alan
So I updated Nagios to Nagios Core 4.4.5 but when I go to the /usr/local/nagios/libexec there is still no check_snmp.

Re: How to Monitor Switch Uptime

Posted: Wed Oct 30, 2019 8:17 am
by scottwilkerson
As I stated before:
scottwilkerson wrote:
This will not upgrade, the plugins, to upgrade the plugins you can follow this guide (installing and upgrading plugins are the same procedure)
https://support.nagios.com/kb/article.php?id=569

Re: How to Monitor Switch Uptime

Posted: Wed Oct 30, 2019 9:36 am
by Alan
Sorry about that. I am not sure how I missed that.