There are a lot of free MRTG front-end tools available on the web, but most of them are for the traditional MRTG logs and not for the rrd (round-robin database) log format. Though not as straight forward as sql, some complex queries can nevertheless be issued on the rrd log files using rrdtool.
This tool is a php-based rrd log querying tool developed as a part of my M.Tech thesis.
Requirements
- A functional web server, preferably apache
- MRTG and RRDTOOL should be installed on the system.
- In the mrtg configuration file, add LogFormat: rrdtool
- Enable passwordless sudo access for apache user (DEBIAN:www-data or REDHAT:apache) if you wish to add interfaces to the mrtg config through the web interface. (Read this post for the right way to do this step)
Installation
- In the queryMrtg.php:
- Set $mrtgdir to the location where mrtg is configured to store its rrd logs, e.g. /var/www/mrtg
- Set $mrtgcfg to the absolute path of the mrtg configuration file, e.g. /etc/mrtg.cfg
- Set $rrdcommand to the rrdtool binary, e.g. /usr/bin/rrdtool
- Set $cfgmaker to the cfgmaker binary, e.g. /usr/bin/cfgmaker
- Set $imgdir to the directory where images will be stored. Create this as a sub-directory of the exported directory in apache (e.g. /var/www/html/images). Add the path relative to the exported directory i.e. if /var/www/html is exported in httpd.conf, then simply write 'images'.
- In the $interfaces array, add all the interfaces that you wish to monitor and query.
- Copy queryMrtg.php to the web-exported directory. e.g. /var/www/html/queryMrtg.php
Usage
- On your browser, type - http://localhost/queryMrtg.php
- First time usage - Just click 'Submit'. It would report that MRTG configuration has not been added for the specified interface, and will show a button to add it. Just click!
- Once you have added interfaces to MRTG configuration, just play around with queries.
mailto: venkatesh@iitg.ernet.in OR rvenkatesh25@users.sourceforge.net
Screen Shots
Download
No comments:
Post a Comment