Nagios Plugin check_snmp_load

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.
Locked
lion14
Posts: 8
Joined: Wed Dec 07, 2016 5:13 am

Nagios Plugin check_snmp_load

Post 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).
Last edited by lion14 on Wed Dec 14, 2016 5:11 am, edited 1 time in total.
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Nagios Plugin check_snmp_load

Post 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.
Rob Hassing
Image
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Plugin check_snmp_load

Post 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!
lion14
Posts: 8
Joined: Wed Dec 07, 2016 5:13 am

Re: Nagios Plugin check_snmp_load

Post by lion14 »

Hey guys! Thanks for the reply.
Just attached 2 files, the picture of the GUI error and the script file.
Attachments
check_snmp_load.pl
snmp load file
(22.31 KiB) Downloaded 408 times
nagios
nagios
lion14
Posts: 8
Joined: Wed Dec 07, 2016 5:13 am

Re: Nagios Plugin check_snmp_load

Post by lion14 »

I can run the script by hand in command line. Attached the picture. :)
Attachments
command line
command line
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Nagios Plugin check_snmp_load

Post 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.
Rob Hassing
Image
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Plugin check_snmp_load

Post by dwhitfield »

@lion14, please let us know if @rhassing's suggestion works for you.

Thanks @rhassing!
lion14
Posts: 8
Joined: Wed Dec 07, 2016 5:13 am

Re: Nagios Plugin check_snmp_load

Post by lion14 »

Hello again guys!

Still not working :(
lion14
Posts: 8
Joined: Wed Dec 07, 2016 5:13 am

Re: Nagios Plugin check_snmp_load

Post 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
Locked