check_tcp with tags in the string

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

check_tcp with tags in the string

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_tcp with tags in the string

Post by abrist »

Does the check work when run normally by nagios? The test check command is limited and may not test your check correctly.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: check_tcp with tags in the string

Post by inas.labib »

Hi,

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

Inas
Locked