Nagios webinject fails on Content-Encoding: gzip

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

We are using webinject test case for an url that runs on a apache server with gzip enabled. Verifiy positive fails due to gzip encode. Please let us know how we can do verifypositive on a compressed content.

Please see our test case:

Code: Select all

<testcases>
<timeout>60</timeout>
<reporttype>nagios</reporttype>
<case
  id="1"
  label="Loading home page"
    description1="Connecting to https://true-geo.com"
    method="get"
    url="https://true-geo.com"
        verifypositive1="Geo USA"
        httpresponse="200"
        errormessage="Unable to hit 'sign in' from https://true-geo.com"
	logresponse="yes"
	logrequest="yes"
/>
While doing a normal curl command content is an encoded one but when we use this command it got decoded "curl --compressed https://true-geo.com"

Code: Select all

HTTP/1.1 200 OK
  Date: Mon, 26 Feb 2018 10:54:28 GMT
  Server: Apache/2.2.15 (Red Hat)
  UFE-Page: Y
  Content-Encoding: gzip
  Content-Language: en-US
  Content-Length: 28355
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Keep-Alive: timeout=5, max=500
  Connection: Keep-Alive
Can anyone please help us on it.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios webinject fails on Content-Encoding: gzip

Post by scottwilkerson »

I tries testing your example but failed because true-geo.com doesn't resolve because the domain isn't registered
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Re: Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

Actually we are using internal dns to resolve it. Also its not opened to public.

So can you please let me know your thoughts on this scenario.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios webinject fails on Content-Encoding: gzip

Post by scottwilkerson »

geopc wrote:Actually we are using internal dns to resolve it. Also its not opened to public.

So can you please let me know your thoughts on this scenario.
Well, I'm not familiar with your server, however my thoughts are it should work fine.. We use gzip compression on all out our sites and it has always worked properly.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Re: Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

We are using webinject.pl with 1.41 and it seems gzip is not supported on it. So can anyone please update me the webinject.pl that supports gzip.

From this link https://github.com/sni/Webinject/blob/m ... ct/Changes I can see in version 1.74 its supporting gzip

Version 1.74 - Sat May 12 13:36:48 CEST 2012
- changed html output into tables (Karsten Sievert)
- support gzipped content (Simone Tiraboschi)

But from the release source file i can see webinject.pl but its entirely different. So can anyone please help me on this so that I can enable gzip support on webinject.
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Re: Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

We tried compiling but getting lot of perl error. So can anyone please provide webinject.pl file.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios webinject fails on Content-Encoding: gzip

Post by scottwilkerson »

This post explains how you can install 1.88

https://support.nagios.com/forum/viewto ... 26#p244134
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Re: Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

Tried but it still not working.. :( Its still cant gunzip the result. Any other thing we need to check?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios webinject fails on Content-Encoding: gzip

Post by scottwilkerson »

What is the result?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
geopc
Posts: 7
Joined: Tue May 30, 2017 5:22 am

Re: Nagios webinject fails on Content-Encoding: gzip

Post by geopc »

./webinject.pl /usr/local/nagios/etc/webinject/true_origin_login.xml

Starting WebInject Engine (v1.88)...
-------------------------------------------------------
Test: Loading home page - /usr/local/nagios/etc/webinject/true_origin_checkout.xml - 1
Desc: Connecting to geo.com
POST Request: https://true-www.geo.com/
Failed HTTP Response Code Verification (HTTP/1.1 405 Method Not Allowed)
Verify: 'sign in'
Failed Positive Verification
TEST CASE FAILED : Unable to hit 'sign in' from true-www.geo.com
Response Time = 0.097 sec
-------------------------------------------------------
Test: Login into geo - /usr/local/nagios/etc/webinject/true_origin_checkout.xml - 3
Desc: Logging into true-www.geo.com
POST Request: https://true-www.geo.com/
Failed HTTP Response Code Verification (HTTP/1.1 405 Method Not Allowed)
Verify: 'geo'
Passed Positive Verification
Verify: 'search'
Failed Positive Verification
Verify: 'BASKET'
Failed Positive Verification
TEST CASE FAILED : Login into geo (case #3): Unable to hit 'sign in' from true-www.geo.com - Unable to login true-www.geo.com
Response Time = 0.005 sec
-------------------------------------------------------


When we checked the http.log i can see the content is in encoded one means its checking on a gzipped content.
Locked