Plugins issuee with check_http in 2.3.2

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
void64
Posts: 4
Joined: Sat Jul 14, 2018 10:26 pm

Plugins issuee with check_http in 2.3.2

Post by void64 »

Recently updated plugins from 2.3.1 to 2.3.2 and after doing so started getting his against check_http. Previously on 2.3.1 things were fine.

The checks involved are using content matching using the plug "-r" (regex) switch where we are looking for a pattern. Since installing 2.3.2 this randomly succeeds or fails.

When running the plugin manually in verbose we're seeing the content truncated and therefore the pattern never matches, causing the critical. It seems to be on average 1 in 10 checks fails.

How we are checking:

check_http -H <host> -p80 -u/status.php -rFOO -v

In this case we are just checking the status of a NextCloud server.


When working:
GET /status.php HTTP/1.1
User-Agent: check_http/v (nagios-plugins 2.3.2)
Connection: close
Host: nextcloud.alb3
Accept: */*


http://nextcloud.alb3:80/status.php is 1574 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: nginx/1.16.1
Date: Wed, 26 Feb 2020 17:04:25 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: close
Set-Cookie: oc9rfbc1ug0x=knh188afjib37sua1s6h3tcpmb; path=/; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=fML4iR6vMrWxJT5OEpufdwcOBHuZoW16Y86rHvSbaii477xYTNE%2BgxZe9BaN%2FZcGpzZvJSehZgJ8He852Df2CS1rOnNUeBAtHXIl5giODPaX8buL06iQVnYFZjzFYzBw; path=/; secure; HttpOnly
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-aG5LUWpWNzNCa1RLUjVYWU12b3JVWmxITTlybTlJYjZNR3VrekY3OE5aVT06dmdqandpdllNVEx5ZDhHUFZyUUFZUG9nUWVPL2x2L01kRGlkcENheFFlVT0='; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri 'self';
Set-Cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
Set-Cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-Frame-Options: SAMEORIGIN
Referrer-Policy: no-referrer
**** CONTENT ****
{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"17.0.2.1","versionstring":"17.0.2","edition":"","productname":"FOO","extendedSupport":false}
HTTP OK: HTTP/1.1 200 OK - 1574 bytes in 0.025 second response time |time=0.025475s;;;0.000000 size=1574B;;;0



When it does not:
GET /status.php HTTP/1.1
User-Agent: check_http/v (nagios-plugins 2.3.2)
Connection: close
Host: nextcloud.alb3
Accept: */*


http://nextcloud.alb3:80/status.php is 1428 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: nginx/1.16.1
Date: Wed, 26 Feb 2020 17:06:42 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: close
Set-Cookie: oc9rfbc1ug0x=eu3gek08ep1ajupbb7cau4l37n; path=/; secure; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=PwehmRLK7USQz9TBbqIaAkBtU19L2XlolGa4vdBDzdyYqqdM4eo7%2FnnhMW5GH14VzLQB%2FLGqjxFO7H25gc5VWqigL7R%2BQfwpMLxJx%2BPFBnI0FuDEVtFbXoLhAxhWMu5U; path=/; secure; HttpOnly
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-bGM3Y0xBZzdLanRMRnJ5K0txT2d2WWxtWmNxWmk5YWgxSXA5ZXpZZ08vND06b2FhelhrbCtUbjh4VVkrR1RzM1Q3TzVRSTRpdHpaWE5tK3MwT1dkUFZMZz0='; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *; object-src 'none'; base-uri 'self';
Set-Cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
Set-Cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-Frame-Options: SAMEORIGIN
Referrer-Policy: no-referrer
**** CONTENT ****
{"installed":true,"maintenance
HTTP CRITICAL: HTTP/1.1 200 OK - pattern not found - 1428 bytes in 0.018 second response time |time=0.018095s;;;0.000000 size=1428B;;;0



If checking this with cURL it never fails and on previous versioon 2.3.1 did not have this issue.


Maybe something to do with this commit:

https://github.com/nagios-plugins/nagio ... 06625f6282
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Plugins issuee with check_http in 2.3.2

Post by benjaminsmith »

Hello void64,

We've just confirmed this bug in 2.3.2 today ( see: 2.3.2 breaks -s, -r, and -R for check_http). A patch has been completed and this will be fixed in the next release.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked