Page 1 of 1

check_connecation.pl having unknow status

Posted: Thu Apr 24, 2014 12:09 am
by niraj_vara
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
}

Re: check_connecation.pl having unknow status

Posted: Thu Apr 24, 2014 9:31 am
by slansing
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.

Re: check_connecation.pl having unknow status

Posted: Fri Apr 25, 2014 12:46 am
by niraj_vara
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.

Re: check_connecation.pl having unknow status

Posted: Fri Apr 25, 2014 2:09 am
by niraj_vara
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$
}

Re: check_connecation.pl having unknow status

Posted: Fri Apr 25, 2014 9:20 am
by tmcdonald
Would it be safe to close this thread then?