check_http With Personalized URLs

We internally host personalized URLs for marketing campaigns, but I cannot get check_http to work correctly with the pURLs. From the command line:

./check_http -I 172.20.4.9/Sunbelt/Default.aspx?URL=test.test3569

Name or service unknown.

Any thoughts as to why this might happen? Could there be an issue given it is an internal address?

Try:
./check_http -H 172.20.4.9 -u “/Sunbelt/Default.aspx?URL=test.test3569”

it should work better (I hope :))

But of course, the url path would do it. I appreciate it. Any thoughts on how I can incorporate urlize into this? Things worked fine from the command line,

./urlize 172.20.4.9/Sunbelt/default.aspx? … t.test3569 check_http -H 172.20.4.9 -u “/Sunbelt/default.aspx?URL=test.test3569”

but when I define a new services as

define service{
use generic-service
host_name QMC02
service_description Sunbelt pURL
check_command urlize 172.20.4.9/Sunbelt/default.aspx? … t.test3569 check_http -u “Sunbelt/default.aspx?URL=test.test3569”

will not allow me to restart the Nagios service. I have also tried putting the entire check_http command in quotes with no success.

Yeah special characters in the check_command line gets icchy! You should make your own script with the urlize command in it, then change your check_command to point to your new script, ‘urlize_check.sh’.

eg:
$ cat > /path/to/plugins/urlize_check.sh
#!/bin/bash

RESULT=/path/to/urlize [172.20.4.9/Sunbelt/default.aspx? ... t.test3569](http://172.20.4.9/Sunbelt/default.aspx?URL=test.test3569) check_http -H 172.20.4.9 -u "/Sunbelt/default.aspx?URL=test.test3569"

if “$RESULT” == “10” ]]
then
echo "OK - Go go power rangers"
else
echo "CRITICAL - OMG ROFFLECOPTERS ATTACK!"
exit 2
fi

Anyways i’ve obviously never used urlize but you get the point :slight_smile: