check_http content check replacing semicolon

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jsolarin
Posts: 1
Joined: Wed Apr 22, 2015 10:11 pm

check_http content check replacing semicolon

Post by jsolarin »

When trying to check the literal string content in a check_http command, all semicolons change to encoded '%3B' which then fails the content check.

using check_xi_service_http

check_http -s 'this;is;a;check'
turns into
check_http -s 'this%3Bis%3Ba%3Bcheck'
and then fails.

We have worked around this with a regex check but this is cumbersome since there are many semicolons that need to be replaced in the matched string.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_http content check replacing semicolon

Post by mcapra »

XI is replacing ; using htmlspecialchars and Core is replacing ; using...something else I can't quite identify :p But the problem with that character is two-fold. You can edit the .cfg file by hand and insert the ; character which gets it into XI just fine, but when the command is passed to Core it gets parsed again into something else that breaks the script.

The only work-arounds I've found for this are to use a regex (like you currently are) or to use a wrapper script that handles the string we are searching for. There might be a way to escape this in Core, but I was unable to find it.
Former Nagios employee
https://www.mcapra.com/
Locked