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.
check_tcp with tags in the string
Re: check_tcp with tags in the string
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.
"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
Hi,
Thanks for your reply.
And yes it is working normally with nagios.
Issue solved.
Inas
Thanks for your reply.
And yes it is working normally with nagios.
Issue solved.
Inas