Monitoring Microsoft Exchange 2003 Servers using Nagios
Thru the time I have developed a few usefull plugins to better monitor exchange servers.
I hope system administrator around the world can benefit from it. It has only being tested under exchange 2003. Any comments, improvements are welcome.

exchange_monitoring


Here are a list of these plugins:
* Exchange_BD – Gets the phsycal size of the Exchange database files, looks into the files .edb and .stm (must pass arguments where files are)
Posible improvements: Dynamic finds the location of the files, querying via LDAP. Display total size by adding all files.
* Exchange_Top_MBOX – Get the top X mailox sizes, allows threasholds if any mailbox is bigger then X megabytes go to warning or critical.
* Exchange_Top_Emails – Most complicated script, gets the total number of emails sent the day before, and prints out the top X “spammers”, allows threasholds.
* Exchange_Backups – Checks when was the last time exchange server was correctly backuped and logs where flushed, I find it a very usefull plugin. Allows threasholds, ex. if backup was not done in last 4 days call warning if no backup during last 10 days raize critical alarm.
* Exchange_Logins – How many users are currently login into the server. (not originaly mine) Uses WMI query, comes with standard NRPE_NT plugins v2.
* Exchange_MailBoxes – Gets the total number of mailboxes in the exchange server, works even with multiple Storage Groups.
exchange_mom4
Important Note: All these scripts requires Nagios + NRPE_NT (nagios agent) installed on servers. You will also need to define the plugins in nrpe.cfg here is how I have it:

dont_blame_nrpe=1
command[get_total_mbox]=cscript.exe //nologo //T:90 c:nrpe_ntpluginsv2check_mboxtotal.vbs
command[get_top_mbox]=cscript.exe //nologo //T:90 c:nrpe_ntpluginsv2check_mboxsize.wsf -h $ARG1$ -t $ARG2$ -w $ARG3$ -c $ARG4$
command[get_top_emailers]=cscript.exe //nologo //T:90 c:nrpe_ntpluginsv2check_emailers.wsf “$ARG1$” “$ARG2$” “$ARG3$”
command[get_exchange_mbox_logons]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2check_counter_rawcount.vbs -h “127.0.0.1” -class “Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox” -inst “Name=_Total” -prop “ActiveClientLogons” -w “$ARG1$” -c “$ARG2$”
command[check_filesize]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2check_filesize.vbs -p “$ARG1$” -f “$ARG2$” -w “$ARG3$” -c “$ARG4$”
command[check_backup]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2check_backup.vbs -w “$ARG1$” -c “$ARG2$”

There are many more interesting plugins when monitoring Microsoft Exchange servers:
Check Windows Update
Check Exchange Counters (performance)
Check Active Directory
Check POP3 Account
Check Black Lists
Check BlackBerry Server State
Check Exchange Webmail OWA (very nice)
Check Exchange – multiple options

Please help me maintain this site with a simple click:
[ad]

9 thoughts on “Exchange

  1. Nice work
    I think It would work very well
    Do you know how to do for monitoring Active directory with Nagios?

  2. do you have the vbs scripts outputting data for rrd? if so, how did you set up the output so that it was in the proper format?
    I used scriptomatic to create a plugin. the plugin works for a simple result but doesn’t send any data to service_perfdata.
    Will also look at the warning and critical functionality and see if I can make that more robust.

  3. Thank you Felipe for your Howto.
    i am new in nagios and i want to know how can i use it to monitor open ports and the attack from outside.

  4. is there any way to monitor Exchange 2010? i was using Script from Nagios Exchange for 2003 & 2007 but i am not able to find same kind of scripts for Exchange 2010.

    1. Nirav,
      There must be some scripts available, but sorry I have not being working with exchange 2010.
      Most likely its easier to write Powershell scripts for it.
      cheers,
      Felipe

  5. Hello Felipe,
    I’m working with nagios for a while with unix servers, but i don’t know so much about Exchange.
    The thing I need is to monitor who are the top mailbox usage.
    I saw that you have some scripts that do this, but the script is password protected.
    Could you guide me to do this?
    I don’t know so much about VB scripts, I’m a unix scripter… 😉
    Regards,
    Exequiel

  6. Hi Felipe,
    the pages for the first two plugins are password protected. I think thats unintentionally. Would be nice if you change it;)
    bye,
    Karsten

Leave a Reply

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