Monitoring Exchange 2003 with nagios

September 22nd, 2009 Leave a comment Go to comments
Monitoring Exchange 2003 with nagios5.053

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_nt\plugins\v2\check_mboxtotal.vbs

command[get_top_mbox]=cscript.exe //nologo //T:90 c:\nrpe_nt\plugins\v2\check_mboxsize.wsf -h $ARG1$ -t $ARG2$ -w $ARG3$ -c $ARG4$

command[get_top_emailers]=cscript.exe //nologo //T:90 c:\nrpe_nt\plugins\v2\check_emailers.wsf “$ARG1$” “$ARG2$” “$ARG3$”

command[get_exchange_mbox_logons]=cscript.exe //nologo //T:60 c:\nrpe_nt\plugins\v2\check_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_nt\plugins\v2\check_filesize.vbs -p “$ARG1$” -f “$ARG2$” -w “$ARG3$” -c “$ARG4$”

command[check_backup]=cscript.exe //nologo //T:60 c:\nrpe_nt\plugins\v2\check_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]

VN:F [1.7.5_995]
Rating: 5.0/5 (3 votes cast)
  1. Deiver
    August 3rd, 2009 at 11:47 | #1

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

  2. August 3rd, 2009 at 12:27 | #2

    Devier,
    I wrote a plugin to check active directory status. it uses dcdiag command
    Check this post
    cheers,
    Felipe

  3. eric flinton
    August 24th, 2009 at 23:05 | #3

    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.

  4. Abdel
    September 2nd, 2009 at 22:24 | #4

    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.

  5. September 22nd, 2009 at 19:50 | #5

    Eric, look into the builtin plugin of NRPE-NT there is already one for check all kinds of perfmon counters and it should also output to perfdata
    Abdel, Monitoring open ports from outside you would have to place nagios outside, and i guess u could use check_tcp but to active scan ports check nmap plugin: http://www.monitoringexchange.org/cgi-bin/page.cgi?g=Detailed%2F2237.html;d=1

  1. No trackbacks yet.