Page 1 of 1

check_tcp with tags in the string

Posted: Wed Apr 09, 2014 4:52 am
by inas.labib
Hi,

I am trying to configure the below service but it is not working!!


/usr/local/nagios/libexec/check_tcp -H 10.10.10.10 -p 12345 -t 5 -s '<ABCD Version="1" Revision="13" Message="Request" MessageTypeId="1" MessageId="s1"><MessageTypeId>1</MessageTypeId><TRANS_CNT>PER</TRANS_CNT><TRANS_TIME>2014-04-07 00:00:00</TRANS_TIME><TRANS_CUR>978</TRANS_CUR><TRANS_CUR_ORG>604</TRANS_CUR_ORG><TRANS_AMOUNT_ORG>200</TRANS_AMOUNT_ORG><EMV>NO</EMV><Ecomm>ECOM</Ecomm><Amount>200</Amount></ABCD>' -e 'Response'

it worked fine from the command line but when I tried to run it from nagios test check command with the following parameters:

Command view
$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$

where:
$HOSTADDRESS$ = 10.10.10.10
$ARG1$ = 12345
$ARG2$ = -t 5 -s '<ABCD Version="1" Revision="13" Message="Request" MessageTypeId="1" MessageId="s1"><MessageTypeId>1</MessageTypeId><TRANS_CNT>PER</TRANS_CNT><TRANS_TIME>2014-04-07 00:00:00</TRANS_TIME><TRANS_CUR>978</TRANS_CUR><TRANS_CUR_ORG>604</TRANS_CUR_ORG><TRANS_AMOUNT_ORG>200</TRANS_AMOUNT_ORG><EMV>NO</EMV><Ecomm>ECOM</Ecomm><Amount>200</Amount></ABCD>' -e 'Response'

I got:

COMMAND: /usr/local/nagios/libexec/check_tcp -H 10.10.10.10 -p 12345 -t 5 -s '\\1\\PER\\2014-04-07 00:00:00\\978\\604\\200\\NO\\ECOM\\200\\' -e 'Response'
OUTPUT: CRITICAL - Socket timeout after 5 seconds

I tried all escape characters and did not work, it is not sending the correct string.
please advise.

Re: check_tcp with tags in the string

Posted: Wed Apr 09, 2014 12:44 pm
by abrist
Does the check work when run normally by nagios? The test check command is limited and may not test your check correctly.

Re: check_tcp with tags in the string

Posted: Thu Apr 10, 2014 6:47 am
by inas.labib
Hi,

Thanks for your reply.
And yes it is working normally with nagios.
Issue solved.

Inas