All was made to avoid configuration work.
Create a directory where you want to stand rrdmon data (images, cgi scripts, rrd databases). Choose a place exported by a web server, for example /usr/local/apache/htdocs/rrdmon/, if you want rrdmon be visible by others (you do, no?). Go in that directory and type:
rrdmon
This will create 3 directories named cgi-bin/, images/, and rrdbases/. If any problem occurs, rrdmon will complain on STDOUT or STDERR, depending on the problem. When there is no problem, rrdmon mutes (UNIX or chinese philosophy, if what you want to say is not better than the silence, keep quiet).
If your MON server is not Localhost on port 2583 you can try:
rrdmon --monserver=<hostname> --monport=<port>
You can safely type (and read):
rrdmon --help
Go in the cgi-bin/ directory and type:
echo | ./Localhost+2583+7200.cgi
If there is no file, you are unlucky. Go to the next section. The png images (gif creations are uglyly patented, sorry) are created in the images/ directory. See them with a graphic tool (GIMP is good but so is Lynx).
That is all folks. Have fun.
Plus, the cgi user must have write permissions on the directory images/. The default cgi user is 'nobody'. So perhaps you will need a command like:
chown nobody.nobody images/
or a less secure one (not so bad if PUT HTTP request is not allowed in the images/ directory, which is the default):
chmod a+w images/
If the cgi user is not 'nobody', adjust the previous command with yours. If you do not understand what I am talking about, you should give up this reading, learn a bit about HTTP and CGI and come back. Let us go on, I speak too much.
Run a web browser (Lynx is so cute for this job) and try one of the cgi scripts, by just going on the url you chose to map rrdmon, for example http://localhost/rrdmon/cgi-bin/. If you can see some beautifull pictures then you are lucky.
Now, run rrdmon for eternity :
rrdmon --noend That is all folks. Have fun.
rrdmon --help
rm images/*
rm cgi-bin/*
killall rrdmon
--topdir <directory> Where is the top directory ?
This directory is the base with which all default paths will be prepend. Default is ``./''
rrdmon --topdir=/usr/local/apache/htdocs/rrdmon \ --imagedirforweb=/rrdmon/images
--cgidir <directory> Where will go the cgi scripts in the local filesystem ?
use the --cgidir option. By default, it is <--topdir>/cgi-bin I do not think it will be a good value for you. if <--cgidir> begins with a slash (``/'') then this path is absolute, else it is relative to <--topdir>. rrdmon have to havethe write permission on this directory. Example :
rrdmon --topdir=/usr/local/apache/htdocs/rrdmon \ --cgidir=/usr/local/apache/cgi-bin \ --imagedirforweb=/rrdmon/images
--rrdcgi <path> What is the rrdcgi complete name (including its name) ?
use the --rrdcgi option. RRDMON needs it to add the shebang line in the cgi scripts. The shebang line tells the UNIX system how to interpret the code (#!/usr/local/bin/rrdcgi). Example :
rrdmon --rrdcgi=/usr/local/bin/rrdcgi
--topdirforcgi <directory> Where is the top directory for the cgi scripts ?
If the --topdir option is absolute, ie it begins with ``/'', you do not need this option.
rrdmon --topdir=./foo \ --topdirforcgi=../
--rrddir <directory> Where will go the rrd databases ?
rrdmon uses this directory to store the round robin databases. By default, it is <--topdir>/rrdbases use the --rrddir option to set this directory. relative path is appended to <--topdir>.
Example :
rrdmon --rrddir=/usr/local/apache/htdocs/rrdmon/rrdbases
--rrddirforcgi <directory> Where will go the rrd databases ?
No, this is not a copy and paste mistake. In fact a problem occurs in you use a relative path for the --rrddir option. The cgi scripts can not guess where the rrdbases files are. So there is this silly option.
Is is the path used by the cgi scripts. By default, it is <--topdirforcgi>/rrdbases If you give an absolute path then it is an absolute path, else it is relative to <--topdirforcgi>. Most of the times, the web server does a chroot in the directory where is the cgi script, before running it; so you can give a relative path from the cgi directory.
Example :
rrdmon --rrddirforcgi=../rrdbases
--imagedir <directory> Where will go the images ?
use the --imagedir option to set this directory. By default, it is it is <--topdir>/images You can give a relative path (appended to <--topdir> option) or an absolute one. The user id used by your web server to run the cgi scripts must have write permissions in this directory.
Example :
rrdmon --imagedir=/usr/local/apache/htdocs/rrdmon/images
--imagedircgi <directory> Where will go the images ?
You know the story now. use the --imagedirforcgi option to set this directory. By default, it is <--topdirforcgi>/images You can give a relative path (appended to <--topdirforcgi>) or an absolute one.
Example :
rrdmon --imagedircgi=../images
--imagedirweb <directory> Where will go the images ?
This is not a joke. The story gets complicated. The web user accesses the images by a different path, sometimes. use the --imagedirweb option to set this directory. By default, it is <--imagedircgi> option. Example :
rrdmon --imagedirweb=../images
RRDTOOL can be found at http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/
PERL can be found at http://www.perl.com
If you add an option, please update the usage()
function AND
the default behavior AND the debugOption output. Thanks.
By default four graphics are made, like in MRTG but you can override this behavior. 1 day is 86400 secondes. Graphics are :
2 hours are 2 * 60 min = 7200 s 2 days are 2 * 1 day = 172800 s 2 weeks are 14 * 1 day = 1209600 s 2 months are 62 * 1 day = 5356800 s 1 year is 366 * 1 day = 31622400 s 20 years are 20 * 365 days = 630720000 s