Can you monitor an email with a specific subject?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

Can you monitor an email with a specific subject?

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

Thanks for the assist, @mcapra!

@h4doukeeN, let us know if you have further (related) questions.
Former Nagios employee
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

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

Post by h4doukeeN »

I get the following message when I run the plugin

Image
kyang

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

Post 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
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

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

Post 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
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

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

Post 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
kyang

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

Post 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.
h4doukeeN
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

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

Post 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?
kyang

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

Post 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?
Locked