Nagios escaping ? in URL

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Nagios escaping ? in URL

Post by hbouma »

We are having an issue where Nagios XI is returning a different result than the command line. This appears to be related to https://support.nagios.com/forum/viewto ... stion+mark. We have a URL that contains a ? and when the check is run, Nagios escapes the ? in the URL causing it to fail.

The check works fine from CLI which does not add the \ before the ?.

We have the servers running Nagios 5.7.3 at this time on RHEL 7.8 VMs.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Nagios escaping ? in URL

Post by dchurch »

If you mean by this that you're running this in the "Run Check Command" modal dialog from within the Nagios XI web interface, then that's a known issue. There's a bug in the escaping of the command when you run it from that dialog box.

Best workaround I can give is to take what that the command line says in the dialog, and try running that directly on the command line.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Nagios escaping ? in URL

Post by hbouma »

Is there a timeframe for fixing the bug? We have several critical production URLs that need monitored that use a ? in the URL.

Running the command from the command line works fine. Letting Nagios XI run the command adds an escape \ in the URL and therefore the check fails.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Nagios escaping ? in URL

Post by dchurch »

It's already fixed as of Nagios XI 5.7.5.

Here's the change log
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Nagios escaping ? in URL

Post by hbouma »

We just tested this in our DEV server running Nagios XI 5.7.5 and the question mark is still being escaped.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Nagios escaping ? in URL

Post by dchurch »

Can you paste the configuration for the check command here (or if it contains sensitive information, PM it to me)?

Also, can you please paste the full output of running the check thru the CCM's Run Check Command dialog, as well as from the command line?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Nagios escaping ? in URL

Post by hbouma »

Check command is check_http

$ARG1$ is -s "SEARCH_TERM" -f ok -I IPADDRESS 24 -u "/_cat/master?v" -S --sni -p 443

Output is as follows:
2020-12-14 13_52_34-Window.png
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Nagios escaping ? in URL

Post by dchurch »

I was unable to reproduce this issue in Nagios XI 5.7.5.

Can you send me a system profile (from your dev server) so I can diagnose further?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
hbouma
Posts: 483
Joined: Tue Feb 27, 2018 9:31 am

Re: Nagios escaping ? in URL

Post by hbouma »

Profile sent in PM.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Nagios escaping ? in URL

Post by dchurch »

I was able to reproduce it. The trick to reproducing it is to have a "?" inside of double-quoted string inside the check command arguments. The shell interpreter incorrectly puts a backslash in front of it when creating the command line.

The way to work around this and fix your particular problem is to replace the double quotes with single quotes.

I.e. Instead of "/_cat/master?v", use '/_cat/master?v'.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked