Nagios 3.2.3

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
csesso
Posts: 3
Joined: Tue Jul 19, 2011 1:19 pm

Nagios 3.2.3

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios 3.2.3

Post 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$
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
csesso
Posts: 3
Joined: Tue Jul 19, 2011 1:19 pm

Re: Nagios 3.2.3

Post 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]
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Nagios 3.2.3

Post 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
Nicholas Scott
Former Nagios employee
csesso
Posts: 3
Joined: Tue Jul 19, 2011 1:19 pm

Re: Nagios 3.2.3

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