|
Packit |
667938 |
MRTG Statistics Archiever
|
|
Packit |
667938 |
Version 0.2
|
|
Packit |
667938 |
Oleg Krotoff <krot@tnsplus.kz>
|
|
Packit |
667938 |
16/06/2000
|
|
Packit |
667938 |
---------
|
|
Packit |
667938 |
Intro and Disclaimer
|
|
Packit |
667938 |
|
|
Packit |
667938 |
This script was written as a result of attempts to provide
|
|
Packit |
667938 |
automatic archiving of graphs, generated by MRTG for all
|
|
Packit |
667938 |
targets.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
I failed to customize the scripts written by Emanuele Leonardi
|
|
Packit |
667938 |
<Emanuele.Leonardi@roma1.infn.it> and Rawlin Blake
|
|
Packit |
667938 |
<blake@nevada.edu> (their scripts supplied with MRTG in contrib)
|
|
Packit |
667938 |
so I wrote my own.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The script provided "as-is", just because it may be usefull
|
|
Packit |
667938 |
for someone with the same needs. It works for me, but
|
|
Packit |
667938 |
I can't be sure that it will work for you. It was tested only
|
|
Packit |
667938 |
with Linux 2.2.14 -- 2.2.16, Apache 1.3.6 -- 1.3.12
|
|
Packit |
667938 |
and Perl 5.6.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
---------
|
|
Packit |
667938 |
|
|
Packit |
667938 |
* mrtg-archiver
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Main part is the 'mrtg-archiver' script itself. It tries to parse
|
|
Packit |
667938 |
MRTG configuration file and extracts the list of targets. Then
|
|
Packit |
667938 |
the script copies graphs and necessary parts of html file to
|
|
Packit |
667938 |
the archive.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
* Command-line options:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
-conf=/path/to/config-file MRTG configuration file
|
|
Packit |
667938 |
-arch=/path/to/archive Path to folder, where the archive
|
|
Packit |
667938 |
will be stored. You should create
|
|
Packit |
667938 |
folders 'days', 'weeks', 'months'
|
|
Packit |
667938 |
'years' in it and also you can
|
|
Packit |
667938 |
place the supplied index.html
|
|
Packit |
667938 |
to the archive folder. All other
|
|
Packit |
667938 |
indexes are produced automaticaly.
|
|
Packit |
667938 |
-d Produce daily archive
|
|
Packit |
667938 |
-w Produce weekly archive
|
|
Packit |
667938 |
-m Produce monthly archive
|
|
Packit |
667938 |
-y Produce yearly archive
|
|
Packit |
667938 |
|
|
Packit |
667938 |
-back=n Tell the archiever, that date, to which the archiving
|
|
Packit |
667938 |
process is made was n seconds earlier. This allows
|
|
Packit |
667938 |
to make daily archives at, for example, 3:00am but
|
|
Packit |
667938 |
mark them by correct (yesterday) date.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The script relies heavily on the structure of html files produced by
|
|
Packit |
667938 |
MRTG, so if the structure change substantialy the script will possibly
|
|
Packit |
667938 |
crash.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
* What you can customize in script:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The variable $GroupRE contains regular expression to group targets.
|
|
Packit |
667938 |
Currently it groups targets by router IP in target itself, assuming
|
|
Packit |
667938 |
that target name starts from router IP. You can change it to anything
|
|
Packit |
667938 |
you want and also you can group targets by some parts in Title.
|
|
Packit |
667938 |
For this you should comment out line 178 and uncomment line 179.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The variable $img_suffix contains the suffix (currently 'png')
|
|
Packit |
667938 |
of graph files produced by MRTG. If your MRTG produces gifs, you
|
|
Packit |
667938 |
can change this variable's value to 'gif'.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
* Starting the archiver
|
|
Packit |
667938 |
|
|
Packit |
667938 |
mrtg-archive supposed to be started by cron. The example lines to
|
|
Packit |
667938 |
be put in crontab are supplied in file 'to-crontab'
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
* Navigating through archives
|
|
Packit |
667938 |
|
|
Packit |
667938 |
To provide the navigation through archives, the cgi-script 'mrtgnav'
|
|
Packit |
667938 |
should be placed into /cgi-bin/mrtg of your WWW server. It requires
|
|
Packit |
667938 |
URI.pm to be installed on your site. You may need to change the
|
|
Packit |
667938 |
value of $HtmlBase, it should contain the location of Web server
|
|
Packit |
667938 |
document root.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The idea of the navigation script was inspired by Cooler
|
|
Packit |
667938 |
(http://cooler.irk.ru).
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|