Build precise queries to find exactly what you need
Press ESC to close
@s_teeter
Favorites1
Views0
Projects3
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.
Reviewed 15 years ago