Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_unread_mails

Current Version
1.0
Last Release Date
2014-07-29
Compatible With
  • Nagios 4.x
License
GPL
Hits
20893
Files:
FileDescription
check_unread_mails.plcheck_unread_mails.pl
Nagios CSP

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!
check_unread_mails
Connect to a remote mailbox using IMAPS protocol and count uread mails in selected folders.
On threshold, raise alarm.
Main functions :
1 - Open a SSL connection with the mail server
2 - Open an IMAPS connection to the mail server with uer,password
3 - Check connection establishment time and, if necessary, raise an appropriate alarm
4 - For each folder given as input parameter, count mails (unseen or present) and raise an appropriate alarm is necessary.

Each mesure and count is treated as a nagios performance value.

Input parameters
-u : this user must be present in the file /usr/local/nagios/libexec/mdp.txt. The associated password is stored encrypted in the same file
-l : comma separated list of folders to analyze
-w : in number of unread mails
-c : in number of unread mails
-D [P|U] P: count mails present in the folder
U: count unseen mails in the folder

A specific option allows the creation of the user,password file
./check_unread_mails.pl -u -g

ex:
[nagios@server libexec]$ ./check_unread_mails -u myUser -g myPassword
couple(myUser;U2FsdGVkX18wX1YGWM1Le6fYZz2owCbdMuB1yFdUUvY=): successfuly recorded
[nagios@server libexec]$

In tyhis case, the file /usr/local/nagios/libexec/mdp.txt is updated with one line corresponding to the user myUser.


Run example :
[nagios@server libexec]$ ./check_unread_mails -u myUser -l [FOLDER-01,FOLDER-02,FOLDER-03,INBOX] -D P
UNREAD_MAILS OK | mailboxAccess=1708ms;3000;5000 FOLDER-01=2;50;90 FOLDER-02=0;50;90 FOLDER-03=5;50;90 INBOX=0;50;90
[nagios@server libexec]$

This plugin requires some specific perl modules :