Page 1 of 1

Read number of mails unread

Posted: Fri Sep 25, 2020 2:41 am
by FCC_Nagios_Support
Hello,

Can you explain me how this plugin works. How to open an SSL connection and IMAP session.

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

Thanks and Regards

Re: Read number of mails unread

Posted: Fri Sep 25, 2020 3:02 pm
by ssax
This is a 3rd party plugin. It looks like you need to edit the plugin directly in a lot of places throughout to set the mailserver/port/protocol values you want, it doesn't look like it supports you passing them in as arguments. It's a mix of arguments and editing the plugin directly, you would need multiple copies of the modified plugin to check both.

I would recommend you also take a look at some of the existing plugins on the XI system:

Code: Select all

/usr/local/nagios/libexec/check_smtp -h
/usr/local/nagios/libexec/check_smtp_send -h
/usr/local/nagios/libexec/check_imap -h
/usr/local/nagios/libexec/check_imap_receive -h
/usr/local/nagios/libexec/check_email_delivery -h
What specifically are you trying to do?

Re: Read number of mails unread

Posted: Sun Sep 27, 2020 1:20 am
by FCC_Nagios_Support
Many Thanks

I am trying to read a remote mailbox

KR

Re: Read number of mails unread

Posted: Mon Sep 28, 2020 6:05 pm
by ssax
I tried the one you found and could not get it to work, this one I was able to get working:

https://exchange.nagios.org/directory/P ... ox/details

Code: Select all

perl check_imap_mailbox --host=imap.gmail.com [email protected] --pass='XXXX' --folder=INBOX