Nagios Email Reporter - How do you schedule this to run?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jglass
Posts: 37
Joined: Thu Jan 26, 2012 2:28 pm

Nagios Email Reporter - How do you schedule this to run?

Post by jglass »

Hello,

I would like to automate some reports so that we can supply system metrics to those who don't have access to the Nagios portal (or to those who we don't want to grant access to). After searching some, it appears that you have to use the Nagios Email Reporter plugin to automate reports. (Please let me know if there are other ways.)

So, I dowloaded the plugin, modified the script with my email server properties, Nagios URL, and Nagios read only user. Also, had to intall a Perl module Date::Manip.

I have verified that the script will run by issuing this command:
perl -c nagios-reporter.v131.pl
And received positive output:
Syntax OK

Documentation for this plugin notes these reports and run times:
The reports are defined as:
Overnight; from 17h the previous WORKING day to 9am of the current day
Daily; from 7am of the previous WORKING day to 7am of the current day
Weekly; from 9am 7 days before to 9am of the current day.
Monthly; from 00:00h of the 1st of the month to 00:00h of the 1st day of the current month

My question is - Do I now need to schedule the script to run, and if so, how do I do this?

Thank you,
Jason
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Email Reporter - How do you schedule this to run?

Post by lmiltchev »

Jason,

The Nagios Email Reporter is a community-distributed plugin, which I am not familiar with but we do have a great product coming out in 2012 that will suit your needs.

Please, check it out here:

http://labs.nagios.com/2011/09/02/sched ... velopment/

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Email Reporter - How do you schedule this to run?

Post by scottwilkerson »

I'm not really familiar with this plugin but I would assume you would need to schedule it to run, using your crontab at the OS level.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jglass
Posts: 37
Joined: Thu Jan 26, 2012 2:28 pm

Re: Nagios Email Reporter - How do you schedule this to run?

Post by jglass »

lmiltchev - The feature you referenced will surely be a welcomed one! Can't wait for it to be included in a future release.

Scott - I'm not familiar with crontab, but I will do some research. Thanks for the tip. A google search rendered only one useful thread on the Nagios Email Reporter -- It tells how to setup it, but not how to run it.

Thanks,

Jason
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Email Reporter - How do you schedule this to run?

Post by scottwilkerson »

jglass wrote:Hello Scott:

I wanted to contribute to the community, but this ticket has been locked.

Please feel free to add this to the thread on my behalf:

I got the script to execute the syntax correctly – Now just working to find the right tags for smtp authentication.

Here is what I had to do to get the script to run and get it scheduled:

-Ensure that sendmail is installed and working on your nagios server (e.g. Nagios sends alert email notifications) - This was already working for me.
-Ensure that perl pre-requisite modules like net::snmp and lwp::useragent are installed – These were present on my server already.
-Install Date:Manip by running - yum install perl-Date-Manip.noarch

Download and install the reporter plugin. Modify SMTP attributes in the script.

Schedule the script to run:
crontab -e

Then on a new line type:
* * * * * /path/to/script/script.pl

Crontab is basically set up like - minutes hours days months years. The asterisk is the equivalent of blank:

For example:
5 * * * * means at the 5 minute mark of each hour
* 5 * * * means at 5 every day
But throw in the */ into it and it means "every" so * */5 * * * means every 5 hours vs. at hour 5

Thanks,
Jason
Thanks Jason!

For cron the asterisk is the equivalent of every.

I would also like to add that scheduled reporting (without this script) is a much requested feature that is coming soon in Nagios XI.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked