Hi
i have Nagios® Core™ 3.4.4 on centos. I was trying to integrate the check_connection.pl with nagios but I am getting the Unknown status. but when I run via the command prompt I was getting the output given below.
/usr/local/nagios/libexec/check_connections.pl -w 20 -c 30 -u apache
OK - Established connections: 6
In Nagios I am getting the following error.
[1398163948] SERVICE NOTIFICATION: niraj;localhost;check_connection_apache;UNKNOWN;notify-service-by-email;Usage: -w warn -c crit [-u loginname
Command.cfg -----
define command {
command_name check_connection
command_line /usr/local/nagios/libexec/check_connections.pl --warning $ARG1 -critical $ARG2 --user $ARG3
}
localhost.cfg ------
define service{
use local-service,graphed-service ; Name of service template to use
host_name localhost
service_description check apache connection
check_command check_connection!20!30!apache
contact_groups admins,sms
}
check_connecation.pl having unknow status
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_connecation.pl having unknow status
Your command is a little bit messed up, you have "--warning" and then "-critical" with just one hyphen, yet you ran the command from the command line with "-w" and "-c". No Hyphens, not extended names. I suggest you change your command and service definition to match EXACTLY what you used on the command line, verify your configs, restart nagios, and schedule a new check on that service.
-
- Posts: 20
- Joined: Thu Dec 13, 2012 1:38 am
Re: check_connecation.pl having unknow status
Hi
See it just a typo mistake. actually I tried the both first I used the -w and -c in command.cfg and then I tried the --warning and --critical also.
but getting the same error.
See it just a typo mistake. actually I tried the both first I used the -w and -c in command.cfg and then I tried the --warning and --critical also.
but getting the same error.
-
- Posts: 20
- Joined: Thu Dec 13, 2012 1:38 am
Re: check_connecation.pl having unknow status
HI
Problem is solved.
actually $ARG1 and $ARG2 had issue.
Right syntax is $ARG1$ and $ARG2$ ----- I missed the end $ in command,cfg file.
so right entry is
Command.cfg -----
define command {
command_name check_connection
command_line /usr/local/nagios/libexec/check_connections.pl --warning $ARG1$ --critical $ARG2$ --user $ARG3$
}
Problem is solved.
actually $ARG1 and $ARG2 had issue.
Right syntax is $ARG1$ and $ARG2$ ----- I missed the end $ in command,cfg file.
so right entry is
Command.cfg -----
define command {
command_name check_connection
command_line /usr/local/nagios/libexec/check_connections.pl --warning $ARG1$ --critical $ARG2$ --user $ARG3$
}
Re: check_connecation.pl having unknow status
Would it be safe to close this thread then?
Former Nagios employee