WebInject and .aspx pages?
WebInject and .aspx pages?
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?
Re: WebInject and .aspx pages?
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?
Also, what error message are you seeing currently?
Former Nagios Employee
Re: WebInject and .aspx pages?
Returned by Nagios:
Test case configuration:
Source info is attached.
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;;0Test 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>You do not have the required permissions to view the files attached to this post.
Re: WebInject and .aspx pages?
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
Re: WebInject and .aspx pages?
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?
Re: WebInject and .aspx pages?
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
Re: WebInject and .aspx pages?
Without credentials:
With 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 #0With 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 #0Re: WebInject and .aspx pages?
The line we're interested in here is going to be -
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.
Code: Select all
< WWW-Authenticate: NTLM
Give this a try. I reccomend testing it over the CLI before Nagios XI.
Former Nagios Employee
Re: WebInject and .aspx pages?
I'll give it a try. Thanks!
Re: WebInject and .aspx pages?
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.