Page 1 of 1

Can you monitor an email with a specific subject?

Posted: Mon Mar 12, 2018 7:55 am
by h4doukeeN
Hello,
I would like to know if there is any complement that allows me to monitor email without reading, with a specific issue and not all "unread".

for example if an email arrives with subject "Hello" nagios is able to see in the inbox the subject Hello and send me a critical alert until said email is read?

I hope you understand my question since I use google translator hahahaha regards

Re: Can you monitor an email with a specific subject?

Posted: Mon Mar 12, 2018 8:33 am
by mcapra
This plugin claims to be able to do that:
https://exchange.nagios.org/directory/P ... pl/details

I haven't tested it. You may need to install a few Perl modules as well.

Re: Can you monitor an email with a specific subject?

Posted: Tue Mar 13, 2018 9:51 am
by tmcdonald
Thanks for the assist, @mcapra!

@h4doukeeN, let us know if you have further (related) questions.

Re: Can you monitor an email with a specific subject?

Posted: Wed Mar 14, 2018 12:08 pm
by h4doukeeN
I get the following message when I run the plugin

Image

Re: Can you monitor an email with a specific subject?

Posted: Wed Mar 14, 2018 12:40 pm
by kyang
What OS are you using? CentOS? Ubuntu?

I downloaded these Perl modules to get it working.

CentOS

Code: Select all

yum -y install perl-MIME-tools
yum -y install perl-Unicode-Map8
Ubuntu/Debian

Code: Select all

sudo apt-get install libmime-tools-perl
sudo apt-get install libunicode-map8-perl

Re: Can you monitor an email with a specific subject?

Posted: Wed Mar 14, 2018 3:36 pm
by h4doukeeN
hello, thanks for answering use centos7 I already installed the packages and now executing the script asks me the following, but I am somewhat lost since which ip to direct as a host? I imagine that user and password refers to the username and password of the email. Any help I will be very grateful

Code: Select all

root@localhost plugins]# ./check_pop3_subject.pl
usage: ./check_pop3_subject.pl -u username -p password -H hostname -s search_str

Re: Can you monitor an email with a specific subject?

Posted: Wed Mar 14, 2018 4:07 pm
by h4doukeeN
Image

-u username -p password -H hostname -s search_str

-u user gmail? -p passwd gmail? -H Ip gmail? -s subject?

if so, I get the message
Unable to establish pop3 connection (tried 0 times)

I activated pop3 in gmail settings

Re: Can you monitor an email with a specific subject?

Posted: Thu Mar 15, 2018 12:40 pm
by kyang
I couldn't actually get this to work either.

I was only able to use a "different plugin" that can only monitor unread messages.

Re: Can you monitor an email with a specific subject?

Posted: Thu Mar 15, 2018 12:54 pm
by h4doukeeN
kyang wrote:I couldn't actually get this to work either.

I was only able to use a "different plugin" that can only monitor unread messages.

Can you help me with the name of the other complement?

Re: Can you monitor an email with a specific subject?

Posted: Thu Mar 15, 2018 12:59 pm
by kyang
Sure, all it displays is whether or not you have unread messages and uses imap.

If you do have unread messages it will go into critical right away. (This plugin does not allow you to pass warning or critical thresholds)

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

It's probably not helpful in your case, but there may be something else in the nagios exchange for you?