Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Exchange 2010
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!
Here are some scripts to monitor some of the health of Exchange 2010 using PowerShell. With the loss of WMI in Exchange 2007, there seems to not be any solid ways to monitor the health of Exchange. These scripts will check for the availability of public folder databases as well as mailbox databases. It will report back to Nagios the mounted states and alert when they are not mounted. They will also check for the health of replication and alert when the replicas are not in a good state.
Many thanks to everyone, Alain TOMASIAN provided some code to allow command line parameters. You can find his code as MBHealth.ps1.
I hope that these scripts help out other sys admins, and offer a good starting point for the monitoring of Exchange 2010.
Many thanks to everyone, Alain TOMASIAN provided some code to allow command line parameters. You can find his code as MBHealth.ps1.
I hope that these scripts help out other sys admins, and offer a good starting point for the monitoring of Exchange 2010.
Reviews (8)
byelliot.wilen, April 18, 2014
See comment by Greate.
To fix the problem, either change line 42 so that TypeResult becomes Type.Result, or use http://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Microsoft-Exchange/Check-Exchange-2010-DAG-Replication-Health/details instead.
To fix the problem, either change line 42 so that TypeResult becomes Type.Result, or use http://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Microsoft-Exchange/Check-Exchange-2010-DAG-Replication-Health/details instead.
bym_sundaramoorthi, August 21, 2013
Could some one help me to write service definition to use this plugins. I am trying to monitor the diskgroup mount state.
Great plugin, thanks for sharing.
Protip: To get the services status to work correctly you have to add "; exit($lastexitcode)" to the end of your cmd part of the handler in nsclient.ini.
EX:
check_mailbox_health = cmd /c echo C:ScriptsNagiosMailboxHealth.ps1; exit($lastexitcode) | PowerShell.exe -Command -
Otherwise the status code returned by the script dies with that Powershell session.
Thanks!
Protip: To get the services status to work correctly you have to add "; exit($lastexitcode)" to the end of your cmd part of the handler in nsclient.ini.
EX:
check_mailbox_health = cmd /c echo C:ScriptsNagiosMailboxHealth.ps1; exit($lastexitcode) | PowerShell.exe -Command -
Otherwise the status code returned by the script dies with that Powershell session.
Thanks!
byescalate, May 17, 2012
Found some not known states for the exchange mailbox synchronization which are not mentioned in the script MBHealth.ps1.
1. FailedAndSuspended
2. DisconnectedAndHealthy
But the rest of the checks are very good! Like it!
1. FailedAndSuspended
2. DisconnectedAndHealthy
But the rest of the checks are very good! Like it!
bybaher09, November 22, 2011
This is one of great Plugins I have ever used, Thank You to Jeff Roberson. Also first time to use a PowerShell-based script with NRPE. I had to do some changes on NRPE to work. I'm using Groundwork Monitor CE (GWOS CE) that uses Nagios as it's Engine.
On NSClient++ I noticed it has [NRPE Client Handlers] and had to modify it to [NRPE Handlers].
Feedbacks from from qk4I and dmagniez were very useful .. Thank You!
Also I had to run the following Windows PowerShell command on the Exchange Server:
Set-ExecutionPolicy RemoteSigned
This made it possible for the PS scripts to work on NRPE from Exchange server to Nagios (GWOS CE).
On GWOS, I created a command:
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c $ARG1$
And two services .. one for Replication and one for MailboxDB
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_replication_health
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_mailboxdb_health
Thanks again ...
On NSClient++ I noticed it has [NRPE Client Handlers] and had to modify it to [NRPE Handlers].
Feedbacks from from qk4I and dmagniez were very useful .. Thank You!
Also I had to run the following Windows PowerShell command on the Exchange Server:
Set-ExecutionPolicy RemoteSigned
This made it possible for the PS scripts to work on NRPE from Exchange server to Nagios (GWOS CE).
On GWOS, I created a command:
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c $ARG1$
And two services .. one for Replication and one for MailboxDB
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_replication_health
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_mailboxdb_health
Thanks again ...
byGoldie, April 7, 2011
Dear Jeff,
thanks for your work, these are some great scripts.
And also thank you for being helpfull via mail.
grtz!
Sven
thanks for your work, these are some great scripts.
And also thank you for being helpfull via mail.
grtz!
Sven
I had to change some parameters in my commands :
[NRPE Handlers]
command[cmd]=$ARG1$
check_mailbox_health=cmd /c echo scriptsexchangeMailboxHealth.ps1 | PowerShell.exe -Command -
check_public_folders=cmd /c echo scriptsexchangePublicFoldersMounted.ps1 | PowerShell.exe -Command -
[NRPE]
command_timeout=180
because this script execute in more than 60 sec !
in centreon :
$USER1$/check_nrpe -H $HOSTADDRESS$ -u -c $ARG1$ -a $ARG2$ -t 180
with arg :
!check_mailbox_health!
[NRPE Handlers]
command[cmd]=$ARG1$
check_mailbox_health=cmd /c echo scriptsexchangeMailboxHealth.ps1 | PowerShell.exe -Command -
check_public_folders=cmd /c echo scriptsexchangePublicFoldersMounted.ps1 | PowerShell.exe -Command -
[NRPE]
command_timeout=180
because this script execute in more than 60 sec !
in centreon :
$USER1$/check_nrpe -H $HOSTADDRESS$ -u -c $ARG1$ -a $ARG2$ -t 180
with arg :
!check_mailbox_health!