WebInject and .aspx pages?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

WebInject and .aspx pages?

Post by jsharris »

We are using WebInject to check web pages for content. Every check works fine except for two .aspx pages. We can view the page without issue and when I view the source in my browser I see the text we are checking against. However, when Nagios checks using check_webinject it returns a failure. Has anyone been able to successfully check for text on something like this?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: WebInject and .aspx pages?

Post by rkennedy »

Can you post your webinject data, and source for the page for us to take a look at?

Also, what error message are you seeing currently?
Former Nagios Employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: WebInject and .aspx pages?

Post by jsharris »

Returned by Nagios:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_webinject.sh config_ALVAReports.xml
OUTPUT: WebInject CRITICAL - Test case number 1 failed |time=0.145;30;;0

Test case configuration:

Code: Select all

<testcases>
<case
    id="1"
    description1="ALVA Reports check"
    method="get"
    url="http://<server>/Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear"
    verifypositive="report"
/>
</testcases>
Source info is attached.
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: WebInject and .aspx pages?

Post by tmcdonald »

Try saving the check and letting it run normally - The Test Check Command button is not always 100% accurate since it is run by the apache user instead of nagios.
Former Nagios employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: WebInject and .aspx pages?

Post by jsharris »

Same result. Still "WebInject CRITICAL - Test case number 1 failed". I just tried wget from the command line on the Nagios server and it looks like the server is refusing the connection as unauthorized. Are you aware of a means of providing alternate credentials for use in a WebInject test?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: WebInject and .aspx pages?

Post by rkennedy »

This varies based on the type of authentication. What is the output of curl -v "http://<server>/Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear" and curl -v "http://<server>/Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear" -u "u:p"?
Former Nagios Employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: WebInject and .aspx pages?

Post by jsharris »

Without credentials:

Code: Select all

[root@nagiosserver libexec]# curl -v "http://<server>/Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear"
* About to connect() to <server> port 80 (#0)
*   Trying a.b.c.d... connected
* Connected to <server> (a.b.c.d) port 80 (#0)
> GET /Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: <server>
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
< WWW-Authenticate: NTLM
< Date: Thu, 24 Mar 2016 17:43:27 GMT
<
* Connection #0 to host <server> left intact
* Closing connection #0

With credentials:

Code: Select all

[root@nagiosserver libexec]# curl -v "http://<server>/Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear" -u "domain\account:password"
* About to connect() to <server> port 80 (#0)
*   Trying a.b.c.d... connected
* Connected to <server> (a.b.c.d) port 80 (#0)
* Server auth using Basic with user 'domain\account'
> GET /Reports/Pages/Folder.aspx?ItemPath=%2fAlva+Reports&ViewMode=Listclear HTTP/1.1
> Authorization: Basic Y29ycFxhZG1pbmlzdHJhdG9yOnF2Y2hzbmEyZQ==
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: <server>
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
< WWW-Authenticate: NTLM
< Date: Thu, 24 Mar 2016 17:43:31 GMT
<
* Connection #0 to host <server> left intact
* Closing connection #0
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: WebInject and .aspx pages?

Post by rkennedy »

The line we're interested in here is going to be -

Code: Select all

< WWW-Authenticate: NTLM
It looks like you're running NTLM authentication, and you're in luck! We have a plugin on our exchange that should support it. https://exchange.nagios.org/directory/P ... LM/details

Give this a try. I reccomend testing it over the CLI before Nagios XI.
Former Nagios Employee
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: WebInject and .aspx pages?

Post by jsharris »

I'll give it a try. Thanks!
jsharris
Posts: 123
Joined: Wed Jul 03, 2013 7:00 am

Re: WebInject and .aspx pages?

Post by jsharris »

I am sure I am missing something simple but when I try from the command line I get "ERROR: Failed to open server-config.xml" (also tried with the full file path for server-config.xml). When trying from the Nagios GUI the output returned is blank.
Locked