Page 1 of 1

Nagios 3.2.3

PostPosted: Fri Jul 22, 2011 1:27 pm
by csesso
Hi All:

My name is Cesar, I live in Argentina and don’t understand English, so I need your help with a problem with my nagios server.

I have a problem with a script written in Perl. If I run the script from the console with the command:
./check_snmp_mem.pl –H IP –C public –I –w 80% -c 90%

The script it’s work

My problem is when I try to run the script in the nagios Server
Attach my configuration:

Nagios Version: 3.2.3
Operating system: Suse 10

Command.cfg

Code: Select all
# 'check_snmp_mem' command definition TEST SNMP DCORE
define command{
  command_name check_snmp_mem_v1
  command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $USER7$ -I -w $ARG2$ -c $ARG3$ $ARG4$
}


switch.cfg

Code: Select all
# Monitoreo memoria via SNMP

define service {
        use                     generic-service
        host_name               DCore
        service_description     Cisco_mem
        check_command           check_snmp_mem_v1!public!80!90
}


The nagios Server has error

ERROR: Description table : No response from remote host ‘IP SWITCH'.

I apologize if the thread is in the wrong place.

Thanks to all

Re: Nagios 3.2.3

PostPosted: Fri Jul 22, 2011 1:42 pm
by lmiltchev
Try plugging in the full path to your plugin in the Command.cfg:

# 'check_snmp_mem' command definition TEST SNMP DCORE
define command{
command_name check_snmp_mem_v1
command_line /full/path/to/check_snmp_mem.pl $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $USER7$ -I -w $ARG2$ -c $ARG3$ $ARG4$
}

Re: Nagios 3.2.3

PostPosted: Fri Jul 22, 2011 2:06 pm
by csesso
lmiltchev wrote:Try plugging in the full path to your plugin in the Command.cfg:

# 'check_snmp_mem' command definition TEST SNMP DCORE
define command{
command_name check_snmp_mem_v1
command_line /full/path/to/check_snmp_mem.pl $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $USER7$ -I -w $ARG2$ -c $ARG3$ $ARG4$
}


Gives the same error

Code: Select all
# 'check_snmp_mem' command definition TEST SNMP DCORE
define command{
  command_name check_snmp_mem_v1
  command_line [b]/full/path/to/check_snmp_mem.pl[/b]   $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ -I -w $ARG2$ -c $ARG3$ $ARG4$
}

(quit -C $USER7$)

The nagios Server has error:

Put snmp login info!

Usage: /opt/nagios/libexec/check_snmp_mem.pl [-v] -H <host> -C <snmp_community> [-2] (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -w <warn level> -c <crit level> [-I|-N|-E] [-f] [-m -b] [-t <timeout>] [-V]

Re: Nagios 3.2.3

PostPosted: Fri Jul 22, 2011 3:52 pm
by nscott
Just to be clear, put in your username and string in place of the $ARG1$ variables, for instance:

/opt/nagios/libexec/check_snmp_mem.pl -H 192.168.5.3 -C public -2 -w 40 -c 50

Re: Nagios 3.2.3

PostPosted: Sat Jul 23, 2011 7:11 am
by csesso
nscott wrote:Just to be clear, put in your username and string in place of the $ARG1$ variables, for instance:

/opt/nagios/libexec/check_snmp_mem.pl -H 192.168.5.3 -C public -2 -w 40 -c 50


Yes, It's work.

commands.cfg
Code: Select all
define command{
  command_name check_snmp_mem_v1
  command_line /opt/nagios/libexec/check_snmp_mem.pl -H $HOSTADDRESS$ -C public -I -w 80% -c 90%
}

switch.cfg
Code: Select all
define service {
        use                     generic-service
        host_name               DCore
        service_description     Cisco_mem
        check_command           check_snmp_mem_v1
}

Question:
This the correct way to work with nagios server ?

Thanks again :)