Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Connect to a remote mailbox using IMAPS protocol and count uread mails in selected folders. On threshold, raise alarm.
Current Version
1.0
Last Release Date
2014-07-29
Owner
Elio Canale-Parola
Website
http://fr.linkedin.com/in/eliocanaleparola/
Download URL
https://github.com/elio78/nagios/blob/master/check_unread_mails.pl
License
GPL
Compatible With
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 <user> : 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 <folder_list> : comma separated list of folders to analyze -w <warning_threshold> : in number of unread mails -c <critical_threshold> : 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 <user> -g <decrypted_password>
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 :
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!