Page 1 of 1

Nagios Plugin check_snmp_load

Posted: Wed Dec 07, 2016 5:28 am
by lion14
Hey everyone!
I have installed Nagios 4.2.1 and I wan't to monitor servers via snmp. (CPU, MEMORY, etc).

Here is my commands.cfg:
define command{
command_name snmp_5minute_load
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T $ARG1$ -w $ARG2$ -c $ARG3$
}
And the config file:

define host{
use generic-switch ; Inherit default values from a template
host_name CISCO_TEST_3560 ; The name we're giving to this host
alias snmp test ; A longer name associated with the host
address x.x.x.x ; IP address of the host
}

define service {

host_name CISCO_TEST_3560
use generic-service
service_description CPU 5 Minute Average
check_command snmp_5minute_load!cisco!90,80,60!100,100,100!-C testproba1
}


Nagios drops me "Put snmp login info". First of all, whats the problem in my syntax? How do I put OID in the commands cfg or in the config file?! For example 1.3.6.1.4.1.9.9.109.1.1.1.1.5.1 (5 minute load CISCO).

Re: Nagios Plugin check_snmp_load

Posted: Wed Dec 07, 2016 10:28 am
by rhassing
Could you please give the script you are using (check_snmp_load.pl) or a link where the script can be found.
I don't know this script, so I could not tell you how to use it.

Re: Nagios Plugin check_snmp_load

Posted: Wed Dec 07, 2016 10:59 am
by dwhitfield
Also, could you post a screenshot of the error if it is in the GUI?

Additionally, could you give the full commandline version of the error (complete with the user you are running the command as)? Thanks!

Re: Nagios Plugin check_snmp_load

Posted: Thu Dec 08, 2016 5:52 am
by lion14
Hey guys! Thanks for the reply.
Just attached 2 files, the picture of the GUI error and the script file.

Re: Nagios Plugin check_snmp_load

Posted: Thu Dec 08, 2016 5:57 am
by lion14
I can run the script by hand in command line. Attached the picture. :)

Re: Nagios Plugin check_snmp_load

Posted: Thu Dec 08, 2016 10:26 am
by rhassing
Could you try to edit the command like this:

Code: Select all

    define command{
    command_name snmp_5minute_load
    command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
    }
I added $ARG4$ as you had 4 argument in your service definition and you need them all.
I removed the $USER7$, no idea what is set there. It could be in your resource.cfg, but I don't think you'd need it here.

Re: Nagios Plugin check_snmp_load

Posted: Thu Dec 08, 2016 11:28 am
by dwhitfield
@lion14, please let us know if @rhassing's suggestion works for you.

Thanks @rhassing!

Re: Nagios Plugin check_snmp_load

Posted: Wed Dec 14, 2016 5:05 am
by lion14
Hello again guys!

Still not working :(

Re: Nagios Plugin check_snmp_load

Posted: Wed Dec 14, 2016 5:09 am
by lion14
Hey, AGAIN! :D

I can't believe this! It's working, the problem was the resource.cfg, I just putted the $USER7$ value.

Thanks a lot of!

Regards