Can you monitor an email with a specific subject?

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Can you monitor an email with a specific subject?

Postby h4doukeeN » Mon Mar 12, 2018 7:55 am

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

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

Postby mcapra » Mon Mar 12, 2018 8:33 am

This plugin claims to be able to do that:
https://exchange.nagios.org/directory/Plugins/Network-Protocols/IMAP4-and-POP3/check_pop3_subject-2Epl/details

I haven't tested it. You may need to install a few Perl modules as well.
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3460
Joined: Thu May 05, 2016 3:54 pm

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

Postby tmcdonald » Tue Mar 13, 2018 9:51 am

Thanks for the assist, @mcapra!

@h4doukeeN, let us know if you have further (related) questions.
Former Nagios employee
tmcdonald
 
Posts: 9118
Joined: Mon Sep 23, 2013 8:40 am

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

Postby h4doukeeN » Wed Mar 14, 2018 12:08 pm

I get the following message when I run the plugin

Image
h4doukeeN
 
Posts: 63
Joined: Wed Aug 09, 2017 9:32 am

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

Postby kyang » Wed Mar 14, 2018 12:40 pm

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
kyang
Support Tech
 
Posts: 1792
Joined: Tue Jul 25, 2017 3:35 pm

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

Postby h4doukeeN » Wed Mar 14, 2018 3:36 pm

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?

Postby h4doukeeN » Wed Mar 14, 2018 4:07 pm

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

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

Postby kyang » Thu Mar 15, 2018 12:40 pm

I couldn't actually get this to work either.

I was only able to use a "different plugin" that can only monitor unread messages.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
kyang
Support Tech
 
Posts: 1792
Joined: Tue Jul 25, 2017 3:35 pm

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

Postby h4doukeeN » Thu Mar 15, 2018 12:54 pm

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

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

Postby kyang » Thu Mar 15, 2018 12:59 pm

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
kyang
Support Tech
 
Posts: 1792
Joined: Tue Jul 25, 2017 3:35 pm


Return to Nagios Core

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 12 guests