Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Mailbox Health 2007.ps1

Rating
2 votes
Favoured:
0
Current Version
1.1
Last Release Date
2010-09-24
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Owner
License
GPL
Hits
104121
Files:
FileDescription
mbhealth2007.zipCheck Script
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
A Powershell Script based on the excellent Mailbox 2010 Health script that performs similar functionality for Exchange 2007 servers. Requires the NSClient or NSCP client on the Exchange server. See remarks in script for details.
Reviews (2)
bysafurniss, October 15, 2013
I have this working great on Windows 2003 with Exchange 2007, however I seem to have an issue running it on Windows 2008 with Exchange 2007.

If I run the command from the "nsclien++ /test" it works fine and the result comes back in a few seconds.

If I run it from the command line on the Nagios server, again it works fine, just takes a lot longer to return the output.

When I then run it as a Nagios check it fails with "(Service Check Timed Out)".

I have the timeout set to 300 seconds.

Not sure why it is failing on 2008.
bys_teeter, October 31, 2010
1 of 1 people found this review helpful
This contribution is a useful tool for monitoring a mission-critical IT service, namely MS Exchange. However, I had to fix a few things to get it working in my environment. These points may save you some time:

-- In the mbhealth2007.ps1 script, correct the typo in AddAdd-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin . Remove the extra "Add." Comment the first Write-Host command to avoid generating unwanted output.

-- Owing to the way PowerShell handles exit codes, the Nagios status code did not work as suggested. Instead, in NSC.ini for NSClient++, under [External Scripts], add the line check_mailbox_health=cmd /c echo C:"Program Files"NSClient++scriptsmbhealth2007.ps1 ; exit($lastexitcode) | powershell.exe -noprofile -command -

See http://powershell.com/cs/blogs/tips/archive/2009/05/18/returning-exit-code-from-script.aspx for more info on PowerShell exit codes. Actually the hardest part was finding out how to correctly quote "Program Files" in the NSC.ini file.

After making those changes, the Mailbox health 2007 script is working fine in my environment.