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.
csesso
Posts: 3 Joined: Tue Jul 19, 2011 1:19 pm
Post
by csesso » Fri Jul 22, 2011 1:27 pm
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
lmiltchev
Former Nagios Staff
Posts: 13587 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Fri Jul 22, 2011 1:42 pm
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
Post
by csesso » Fri Jul 22, 2011 2:06 pm
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]
nscott
Posts: 1040 Joined: Wed May 11, 2011 8:54 am
Post
by nscott » Fri Jul 22, 2011 3:52 pm
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
Post
by csesso » Sat Jul 23, 2011 7:11 am
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