Page 2 of 2

Re: Problems page and image links

Posted: Thu Sep 16, 2010 3:24 pm
by jag7720
Just to follow up because I hate it when people leave a thread hanging with no concrete solution, here is my simple script that works for me.

Code: Select all

#!/bin/sh
##Set up the variables
filename="nagios-problems.txt"  #contains the subject text
report="status"`eval date +%Y%m%d`".html"  #contains the html of the status page

## Get the "Problems" page from Nagios
wget -k -O /path/to/$report --user nagios --password nagios "http://nagios.server.com/nagios/cgi-bin/status.cgi?host=all&servicestatustypes=28"

##Email it out.
/bin/mail -s "Current Problems on `eval date +%Y%m%d`" -a /path/to/$report [email protected],[email protected],[email protected]  < /path/to/$filename
then set up a cronjob to run it when you need the report

Re: Problems page and image links

Posted: Fri Sep 17, 2010 9:48 am
by mguthrie
Thanks for posting this! I'm sure you won't be the last person who needs to do this.