Page 1 of 2

Nagios webinject fails on Content-Encoding: gzip

Posted: Mon Feb 26, 2018 7:32 am
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.

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Mon Feb 26, 2018 2:50 pm
by scottwilkerson
I tries testing your example but failed because true-geo.com doesn't resolve because the domain isn't registered

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Tue Feb 27, 2018 4:48 am
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.

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Tue Feb 27, 2018 9:00 am
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.

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 7:18 am
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.

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 8:41 am
by geopc
We tried compiling but getting lot of perl error. So can anyone please provide webinject.pl file.

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 10:54 am
by scottwilkerson
This post explains how you can install 1.88

https://support.nagios.com/forum/viewto ... 26#p244134

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 2:06 pm
by geopc
Tried but it still not working.. :( Its still cant gunzip the result. Any other thing we need to check?

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 2:20 pm
by scottwilkerson
What is the result?

Re: Nagios webinject fails on Content-Encoding: gzip

Posted: Wed Feb 28, 2018 2:31 pm
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.