Monitor Exchange Storage Groups in Nagios

I had a failure in one of my Exchange Storage Groups last night and the Storage Group had dismounted itself. However the Information Store service was still running and so were the other three Storage Groups on the server. So that got me to thinking, how do I monitor the individual Storage Groups for failures with Nagios?

The solution involves using the check_nt plugin for Nagios and the Nagios pNSClient for windows, the following may work for any one of the Nagios Windows clients but you will have to test it for yourself.

Firstly the check command (Please click the View Source button in the code windows below to see the whole line)

define command{
  command_name    check_exchange_storage_group
  command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p $USER19$ -w 1 -c 0 -v COUNTER -d SHOWALL -l "\MSExchangeIS Mailbox($ARG1$)Client Logons","$ARG1$ Logons: %.f"
}

$USER19$ on my installation is set to the port that Nagios Client for Windows uses. You will need to modify this to suit your needs.

Next define a Service Template

define service {
        name check_exchange_storage_group
        use base
        check_command check_exchange_storage_group
        register 0
}

Then define the service for each host you want to monitor

define service {
        use check_exchange_storage_group
        service_description Exch Storage Group - First Storage Group
        check_command check_exchange_storage_group!First Storage Group-Mailbox Store (ARCMAIL)
        host_name arcmail
}

The following line is the important part, this is what tells Nagios which storage group to monitor

check_command check_exchange_storage_group!First Storage Group-Mailbox Store (ARCMAIL)

To find out what you need to put after the ! (Exclamation Point) on the check command line check out your Exchange System Manager

Exchange System Manager

And under “Administrative Group -> <<Admin Group Name>> -> Servers -> <<Server Name>>” should be your storage groups (In most cases it should look very similar to above, it will be different if you have a large Exchange installation).

You need to put the names of the Storage Group and Mailbox store together separated by a dash, the Storage Group name required to function for the installation shown above is:

First Storage Group-Mailbox Store (ARCMAIL)

You need to put the whole name in there otherwise the check command will return critical as it cant find the storage group you are trying to monitor.

That should be all that is required to monitor your individual Exchange Storage Groups. A possible caveat is that when some backup software backs up Exchange it will dismount the storage group and hence cause an alarm, if this is the case you will need to put in some exemption times into your Nagios installation.

This entry was posted in Exchange, Nagios, Sys Admin and tagged , , , , , . Bookmark the permalink.

7 Responses to Monitor Exchange Storage Groups in Nagios

  1. lutieri says:

    It does work but not sucessfully. What happen at night, for instance, when no users are logged in?!

    any ideas? workarounds?

  2. Jon Smith says:

    @lutieri
    When a Storage Group is Mounted there is anyway at least one connection, so even if there are no users connected there is one active connection. However when your Exchange server performs maintenance tasks that may disconnect your Storage Group, my recommended workaround for this situation is to use Nagios with Time Periods to stop Nagios checking the Storage Groups during the Exchange Maintenance Window. Hope That Helps.

  3. Orv Curry says:

    When implementing this, I get an error in Nagios “Server Port must be an integer”. Any idea what that means? Thx

  4. Jon Smith says:

    @Orv Curry
    $USER19$ should be set to the port number of the pnsclient running on the windows box. Replace $USER19$ with 6011 and give that a go.

    Cheers,

    Jon

  5. irinak says:

    when implemented, have an UNKNOWN status for this service
    what did I miss? pl advise
    thank you

  6. irinak says:

    Hi again
    I have done some re-arangements of arguments of a command line according the “status information” returned by nagios:

    # ‘check_exchange_storage_group’ command definition
    define command{
    command_name check_exchange_storage_group
    command_line $USER1$/check_nt -H $HOSTADDRESS$ -v COUNTER -p 6011 -w 1 -c 0 -l “\MSExchangeIS Mailbox($ARG1$)Client Logons”, “$ARG1$ Logons: %.f” -d SHOWALL
    }

    Now I get CRITICAL status with status information: Connection refused.

    Can you help please?
    Irina

  7. alokat says:

    You have to use double \ after that \MSExchangeIS Mailbox($ARG1$)\Client Logons

    With one it works only if you use the console if you use nagios or icinga you should use double \

    example:
    check_nt_counter!1!0!”\MSExchangeIS Mailbox(First Storage Group-MBX01)\Client Logons”,”%.f Client Logons”

Leave a Reply

Your email address will not be published. Required fields are marked *