#!/usr/local/bin/bash # # creation utility for mrtg-watchtable stuff # # Zoidial Incorporated # Eric Thern eric@zoidial.com # # June 2003 - first version # August 2003 - updated the DNS config greps to be better # # # # # run mrtg from crontab like so: # */8 * * * * /usr/bin/nice -n 20 /root/mrtg/mrtg /root/mrtg-apache/mrtg-apache.cfg >/dev/null 2>&1 # # # # PLEASE: # - EDIT indexmaker title # - EDIT paths here and in the template # # # # get the domains from the DNS config # # old # grep zone /etc/namedb/named.conf | awk -F'"' '{print $2}' | egrep '(com|org|net|ws|cc|info)' | egrep -v '(^domain.com)' > mrtg-watchtable-domains # new grep zone /etc/namedb/named.conf | awk -F'"' '{print $2}' | egrep -v '(^domain.com|[Ii][Nn]-[Aa][Dd][Dd][Rr])' |grep ".[a-zA-Z]" > mrtg-watchtable-domains # # copy over template newly # cp mrtg-apache.cfg mrtg-apache.BACKUP rm -f mrtg-apache.cfg cp -f mrtg-config-template mrtg-apache.cfg rm -f *_l *.ok # # add on the domains to the template based on what we got from the dns config # for i in `cat mrtg-watchtable-domains`; do echo " Title[$i]: www.$i Data Traffic Target[$i]: \`/root/mrtg/mod_watch.pl http://www.$i/watch-info\` MaxBytes[$i]: 1250000 PageTop[$i]: