You are here

How Do I use a shell variable inside a check_nrpe arglist?

1 post / 0 new
dwalter
dwalter's picture
How Do I use a shell variable inside a check_nrpe arglist?

I have a web service that only listens on the eth0 ip address of my server NOT localhost.  I want nrpe to run a tcp check just to make sure it is listening on the right port.

This is what I'm using:

check_nrpe -H $HOSTADDRESS$ -c check_tcp -a '-H $HOSTNAME -p 8180 -w 2 -c 5'

I've tried single quotes, double quotes, no quotes, not specifying a host address in hoping it would default to eth0, but it went to lo instead, I put $HOSTNAME in back ticks (`), nothing seems to work.

Is this possible? is there a better way to do it via check_nrpe?

Thanks for any assistance,

DW