Check Exchange OWA login

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
delboy1966
Posts: 96
Joined: Thu Oct 22, 2015 5:26 am

Check Exchange OWA login

Post by delboy1966 »

Does anyone know the best way of getting Nagios to login to Exchange via the web GUI and return the resulting web page?
I have to alert depending on the content on the resulting page after a successful login.

Thanks
Tony
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check Exchange OWA login

Post by mcapra »

Here's a post from @ssax on the customer section of the forums:
ssax wrote: For checking NTLM websites you can use the attached plugin and use these commands to test it:

To just check NTLM authentication for an HTTP site:

Code: Select all

./check_ntlm_website.sh -u 'domain\username' -p 'password' -U 'http://X.X.X.X/path/to/your/page.whatever'

Code: Select all

[root@xidc73 libexec]# ./check_ntlm_website.sh -u 'contoso\ssax' -p 'xxXxxXxxXX' -U 'http://my.site.com/testing/page.aspx'
OK - Authenticated Successfully.
To just check NTLM authentication for an HTTPS site:

Code: Select all

./check_ntlm_website.sh -u 'domain\username' -p 'password' -U 'https://X.X.X.X/path/to/your/page.whatever'

Code: Select all

[root@xidc73 libexec]# ./check_ntlm_website.sh -u 'contoso\ssax' -p 'xxXxxXxxXX' -U 'https://my.site.com/testing/page.aspx'
OK - Authenticated Successfully.
To check NTLM authentication AND search the page for specific text you can use the -s option:

Code: Select all

./check_ntlm_website.sh -u 'domain\username' -p 'password' -U 'http://X.X.X.X/path/to/your/page.whatever' -s 'searchword'

Code: Select all

[root@xidc73 libexec]# ./check_ntlm_website.sh -u 'contoso\ssax' -p 'xxXxxXxxXX' -U 'https://my.site.com/testing/page.aspx' -s 'border'
OK - Authenticated Successfully - Search string 'border' found.
Thank you
I'll attach the plugin he wrote below. Otherwise, you could do this with Selenium.
Attachments
check_ntlm_website.zip
(2.14 KiB) Downloaded 233 times
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Check Exchange OWA login

Post by kyang »

Thanks for the help @mcapra!

delboy1966, let us know if this helps!
delboy1966
Posts: 96
Joined: Thu Oct 22, 2015 5:26 am

Re: Check Exchange OWA login

Post by delboy1966 »

Hi

Thanks for the reply and the plugin.
However it doesn't seem to work as it should.

Its telling me its authenticated, however if I use the -v flag its actually returning the login page with the message;

Please enable cookies for this Web site. Cookies are currently disabled by your browser. Outlook Web App requires that cookies be enabled.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Check Exchange OWA login

Post by mcapra »

Ah, that's my mistake.

This article might be more useful:
http://fiwebelize.com/monitoring-an-out ... th-nagios/

Though it is a bit old. I stand by the statement that Selenium should be able to handle this, but it is admittedly a bit heavy in this particular case.

There's also a few plugins on the exchange you might consider:
https://exchange.nagios.org/index.php?o ... ange%20owa
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Check Exchange OWA login

Post by kyang »

Thanks for the help @mcapra!
Locked