Wednesday, November 7, 2018

Nagios Reports Generation

Nagios Report Generation and Sending Email

This cronjobs allow to download reports as html and attaching to mail body

30 4 * * * curl --silent http://localhost/sslviewer/sslcert.php



0 6 * * * wget -v --user xxx --password 'xxx' --no-check-certificate -O /home/lknic/`date +\%Y\%m\%d`-report.html "http://monitor.nic.lk/nagios/cgi-bin/avail.cgi?show_log_entries=&host=all&timeperiod=yesterday&timeperiod=24x7"

1 6 * * * sed -e 's/CLASS='\''dataOdd'\''/style='\''background-color:#bda9f0;'\''/g' -e 's/CLASS='\''dataEven'\''/style='\''background-color:#d6cbf1;'\''/g' -e 's/CLASS='\''hostUP'\''/style='\''background-color:#88eba8;'\''/g' -e 's/CLASS='\''hostDOWN'\''/style='\''background-color:#ebc8ac;'\''/g' -e 's/CLASS='\''hostUNREACHABLE'\''/style='\''background-color:#e4a240;'\''/g' /home/lknic/`date +\%Y\%m\%d`-report.html > /home/lknic/`date +\%Y\%m\%d`-reporttemp.html



2 6 * * * mutt -e 'set content_type=text/html realname="LK Domain Registry Monitoring System"' -s 'Daily Servers Status Report' 'xxx@com.com' < /home/lxxx/`date +\%Y\%m\%d`-reporttemp.html

3 6 * * * rm /home/xxx/`date -d '-7 days' +%Y%m%d`-report.html
3 6 * * * rm /home/xxx/`date -d '-7 days' +%Y%m%d`-reporttemp.html

No comments:

Post a Comment