$ARG2$ not being passed?

Support requests, bug reports, questions etc.
krm
starter
starter
Posts: 2
Joined: Thu Apr 05, 2012 04:05

$ARG2$ not being passed?

Post by krm » Thu Apr 05, 2012 04:12

I must be doing something obviously wrong, but I can't determine it. I feel the nconf GUI is pretty clear and even checked Nagios output configuration and not sure why this keeps failing.

I've created a check command that nconf created as:

define command {
command_name check_http_tt_basic_health_ok
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 10 -c 30 -a '$USER3:$USER4$' -u $ARG1$ -p $ARG2$ -s 'ok'
}


Here is the service definition:
define service {
service_description XYZ-Data-Service
check_command check_http_tt_basic_health_ok!http://myservice.domain.net/health!8130
host_name xyz-www-02
check_period 24x7
notification_period 24x7
contact_groups +admins,xyz-contact
notifications_enabled 0
event_handler_enabled 0
use generic-service,xyz-service,Default_collector_server
}

I've tried all sorts of combination of single/double quotes and no matter what, I get this error in Nagios:
check_http: Invalid port number - $
Usage:
check_http -H <vhost>
Performance Data: -I <IP-address> [-u <uri>] [-p <port>] [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-a auth] [-b proxy_auth] [-f <ok|warning|critcal|follow|sticky|stickyport>] [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>] [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>] [-A string] [-k string] [-S] [--sni] [-C <age>] [-T <content-type>] [-j method]
---- end paste ---

I seems that the $ARG$ is not being replaced by the correct port number, but I'm not sure why.

yeahmag
beginner
beginner
Posts: 9
Joined: Thu Oct 27, 2011 01:06

Re: $ARG2$ not being passed?

Post by yeahmag » Fri Apr 06, 2012 00:26

Are you passing the arguments seperated with a "!"?

...so:
!<arg1>!<arg2>

krm
starter
starter
Posts: 2
Joined: Thu Apr 05, 2012 04:05

Re: $ARG2$ not being passed?

Post by krm » Sat Apr 07, 2012 00:57

I believe so, if you look at the command_name above it includes the arguments seperated by !. I couldn't not determine that the problem is with nconf since it appears to me also that nconf is producing the right arg list. Is there a nagios config somewhere that may be disabling $ARGX$ somehow?

My nagios installation is basically vanilla, my other basic check commands are working as expected even those with ARG1.

yeahmag
beginner
beginner
Posts: 9
Joined: Thu Oct 27, 2011 01:06

Re: $ARG2$ not being passed?

Post by yeahmag » Wed Apr 11, 2012 00:10

Not sure. Try hard-coading everything and then slowly put the VARS back in.

Locked