How-To : View MRTG Graphs on a Monitoring Server with/and Apache

Description :

This small document should help you quickly get Apache to share/view MRTG graphs. It will also help you quickly start graphing a MRTG capable (SNMP enabled) device.

It is somewhat of a follow-up document to: Install FreeBSD 4.x with NetSaint Monitoring

References :

Apache : http://www.apache.org
MRTG : http://www.mrtg.org


Outline :


Procedure :
MRTG on a Monitoring Server

1. vi /usr/local/etc/apache/httpd.conf
2. Search for "public_html" and change to "www"
3. Search for "DirectoryIndex" and add "index.htm" to each of the appropriate lines.
4. After the "Alias /netsaint/" and other netsaint info, add:

<Directory /home/mrtg/www/>
AllowOverride AuthConfig
order allow,deny
allow from all
</Directory>


5. Restart apache:
/usr/local/etc/rc.d/apache.sh stop
/usr/local/etc/rc.d/apache.sh start
6. Add a user "mrtg"
7. Go to "/home/mrtg"
8. Make a directory "cfg"
9. Make a directory "www"
10. cp /usr/local/share/netsaint/.htaccess /home/mrtg/www/
11. Edit the following, and copy/paste it to the server:

cfgmaker --global "WorkDir: /home/mrtg/www/t1" \
--global "Options[_]: growright,bits" --ifref=ip public@1.2.3.4 > /home/mrtg/cfg/t1.cfg


12. Edit the following, and copy/paste it to the server:

indexmaker --output=/home/mrtg/www/t1/index.htm \
--title="Network - T1" --columns=2 --show=day /home/mrtg/cfg/t1.cfg


13. vi /home/mrtg/runmrtg.ksh
Add a line similar to:

/usr/local/bin/mrtg /home/mrtg/cfg/t1.cfg

14. chmod 775 /home/mrtg/runmrtg.ksh
15. vi /home/mrtg/mrtgcron
Add the following lines:

#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday command
*/5 * * * * /home/mrtg/runmrtg.ksh # Will run script every 5 minutes

16. At a prompt type: crontab mrtgcron
17. To add additional devices to the MRTG monitoring, follow steps 9 -11.

 


Last Modified :
5-13-2003 : Document Created

If you feel information is missing... please email me.
If you feel I have missed giving credit to a person or organization... please email me.
Copyright © 2003-2012 - Dave Breiland (superdave@dynamicis.com)