Pyrrdp logo us-en ru-ru

PyRRDP v 0.0.2 beta 3 documentaion

PyRRDP is python tool that allows to visualize basic network parameters such as: RTT average and loss percentage.

Main features:

Requirements

In order to run PyRRDP you must ensure you have following software packages installed:

Installation

After you downloaded the latest PyRRDP tarball using the "download" link in menu, it's time to install it.
To install PyRRDP onto your computer simply run:
> python setup.py install
Setup script setup.py is located in root folder of PyRRDP archive.

Default PyRRDP file hierarchy after installation:

/usr/local/bin/pyrrdp-run.py   Main script
/usr/local/etc/pyrrdp.conf   Configuration file
/usr/local/share/pyrrdp/templates   Templates directory
/usr/local/www/pyrrdp   Output directory that contains all generated html and graph files.
/var/db/pyrrd   Generated RRD databases for hosts

After installation you may want to edit configuration file according to your need. Most of the variables in config are self-explanatory.

Output

BASE_URL config variable determines prefix, that is added while generating URLs for graphs. In case you have any www server running on same host, where PyRRDP is intented to be run, just set BASE_URL value to http://<your>.<host>/pyrrdp/. However if no http server's available it's ok to specify local path:
file:///usr/local/www/pyrddp.

Starting from version 0.0.2 beta 3 PyRRDP comes with simple http server written in python, that can be used to provide access to generated graphs via http protocol. It's easy to run, it requires almost no configuration. But DO NOT use it for any heavy-load public service. It's better to set up apache or any static-content dedicated server like nginx or lighttpd.

Usage

When you are happy with your settings it's time to do some real job. First of all you need to create RRD databases for all hosts you defined:
> /usr/local/bin/pyrddp-run.py create

Note, that if database already exists for particular host it won't be removed, thus in case you need to re-create database you should manually remove host database. And if you are going to add some more hosts later on, you just have to run pyrrdp-run.py with create argument again.

Next step is to generate html files from installed templates:
> /usr/local/bin/pyrddp-run.py html

Well, now we have rrd database created for every host we defined and html files generated from templates. But we do not have any data to graph.

To collect data from hosts run:
> /usr/local/bin/pyrddp-run.py update
This will run ping for all hosts and update rrd databases. PyRRDP uses separate thread to ping each host, it means, that you virtually may define arbitrary amount of hosts without affecting the total run-time.

And finally if we want to see results of our extremly hard work we must tell PyRRDP to generate graph images:
> /usr/local/bin/pyrddp-run.py graph

Now you can run pyrrdp-http server:
> /usr/local/bin/pyrrdp-httpd-run.py
Then type in your browser: http://localhost:9090/
If everything went fine you should see PyRRDP index page.

That's all. Of course running pyrrdp-run.py update once doesn't make any sense, it must be called every minute. So we'll give that job to cron. Add following entries to your crontab:
* * * * * /usr/local/bin/pyrrdp-run.py update
*/30 * * * * /usr/local/bin/pyrrdp-run.py graph > /dev/null 2>&1

This will update our databases every minute and every 30 minutes it will redraw our graphs. You can change the value of 30 minutes of course, though it is not recommended to change update call interval.

Templates

Templates are used to customize the HTML representation of generated graphs. There are six basic template types:

INDEX   Template for index page
GROUP   Template for group page
DETAIL   Template for detail page
PLAIN   Not a template. Just copy additional html file to OUTPUT_DIR without parsing.
IMAGE   Copy image file to OUTPUT_DIR
MEDIA   Copy additional media file to OUTPUT_DIR

Index page provides access to all defined groups.
index patterns: @DS:(arg @@LI@@)@
Here DS is a pattern name, and the value in parenthesis is an argument. An argument here is any valid HTML code containing additional second-level pattern @@LI@@, which will be substitued with actual value of each list element.
For instance, pattern:
<ul>
@DS:(<li>@@LI@@</li>)@
</ul>

If we've defined two groups: group1 and group2, then we would get following result:
<ul>
<li><a href='$BASE_URL/group1.html' target='$HREF_TARGET'>group1</>
<li><a href='$BASE_URL/group2.html' target='$HREF_TARGET'>group2</>
</ul>

Group page contains two graphs for named group:
3 hours average graph for RTT avg and LOSS percentage. Both graph images are links to detail.html page, which contains graph for daily, weekly, monthly and yearly average.
group pattern:

@PAGE_REFRESH@   Used to specify auto-reload page interval. This variable gets the value of the same one from configuration file.
@GROUP_NAME@   Will be replaced with current group name.
@RTT_3H_GRAPH@   Will be replaced with 3 hours average RTT graph for group.
@LOSS_3H_GRAPH@   Will be replaced with to 3 hours average LOSS graph for group.

As you can see none of group patterns have any arguments.

Detail view page contains graphs for 3 hours, daily, weekly, monthly and yearly average.
detail pattern:

@PAGE_REFRESH@   Used to specify auto-reload page interval. This variable gets the value the same one from configuration file.
@GROUP_NAME@   Will be replaced with current group name.
@RTT_3H_GRAPH@   Will be replaced with 3 hours average RTT graph for group.
@LOSS_3H_GRAPH@   Will be replaced with 3 hours average LOSS graph for group.
@RTT_D_GRAPH@   Will be replaced with daily average RTT graph for group.
@LOSS_D_GRAPH@   Will be replaced with daily average LOSS graph for group.
@RTT_W_GRAPH@   Will be replaced with weekly average RTT graph for group.
@LOSS_W_GRAPH@   Will be replaced with weekly average LOSS graph for group.
@RTT_M_GRAPH@   Will be replaced with monthly average RTT graph for group.
@LOSS_M_GRAPH@   Will be replaced with monthly average LOSS graph for group.
@RTT_Y_GRAPH@   Will be replaced with yearly average RTT graph for group.
@LOSS_Y_GRAPH@   Will be replaced with yearly average LOSS graph for group.

All of the defined patterns are valid only whithin corresponding template type, that is pattern @RTT_D_GRAPH@, is only available for use in DETAIL template type and so forth.


Max E. Kuznecov ~syhpoon <mek@mek.uz.ua> 2006-2007