#!/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