Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Disabled host and service notification parser - updated for latest nagios including auto enable of hosts/services
1.2 final
2013-04-10
- Nagios 1.x
- Nagios 2.x
- Nagios 3.x
43795
File | Description |
---|---|
nagios-host-service-notification.tar.gz | tar file containing sendmail |
nagios-host-service-dtime-notification-parses.sh | actual script within tar file |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
http://exchange.nagios.org/directory/Addons/Notifications/*-Notification-Managers/Disabled-host-and-service-notification-parser/details
Script looks at nagios status.dat - status.log -
Parses out:
hosts that are disabled for active or notification checks
Services that are disabled for active or notification checks
Servicedowntime - that have been set - gives start/end time duration and any comments
hostdowntime -any hosts with scheduled down time.
Email is sent with links to your nagios server to re-enable any of the above if any host or service found to be disabled.
I have been using this on our nagios servers and it works really well.
Also last thing, take a look at nagalert which has been uploaded to this site. you can schedule downtime very easily.
Instructions:
1. This uses perl sendmail.pl - attached in tar.gz or downloadable from my github url - it requires you to install :
on debian/ubuntu systems:
sudo apt-get install libmime-lite-perl
on redhat/centos:
sudo yum install perl-MIME-Lite.noarch
The Lite.pm is within the tar.gz MIME folder - no need to download if you wish to use the local version
Using this method, the script generates HTML email which includes the links to enable notifications/active checks through the email by clicking provided links.
2. The script needs some configuration you will need to provide the correct nagios hostname address and user password values for the links to work.
3. I have now combined all the awk statements into one larger awk and thus speeded up the work of the script by getting it run through the status.dat/ status.log once rather than multiple times
4. Once you have it working you can enable a cron entry like this:
30 08,16 * * * root /usr/local/bin/nagios-host-service-dtime-notification-parses.sh >/dev/null 2>&1
Which will email twice a day at 8:30 and 16:30 with the results
Reviews (1)
bymikej1234, July 11, 2013
I think this is a good script and I've already found it very useful. Took only a few minutes to configure.
However, because the user and password are in plain text and then used in the URLs provided in the email, I believe there is a security issue. It works as expected but I didn't want to see my user and password like this:
http://nagiosadmin:MySecretPassword@172.16.0.1/nagios/cgi-bin/cmd.cgi?cmd_typ=22&cmd_mod=2&host=mywebsite.com&service=URL&btnSubmit=Commit
I tweaked it to suit my needs.
Thanks for your help!
Mike
However, because the user and password are in plain text and then used in the URLs provided in the email, I believe there is a security issue. It works as expected but I didn't want to see my user and password like this:
http://nagiosadmin:MySecretPassword@172.16.0.1/nagios/cgi-bin/cmd.cgi?cmd_typ=22&cmd_mod=2&host=mywebsite.com&service=URL&btnSubmit=Commit
I tweaked it to suit my needs.
Thanks for your help!
Mike