[rrd-users] (test tool)Real-Time Monitoring with PHP and RRDTool

Livio Zanol Puppim livio.zanol.puppim at gmail.com
Fri Dec 7 02:26:05 CET 2007


Hello Everyone,

In the company that I work, in a time on the past (can't remember,
damn beers) was a need for real-time monitor of some links. So I've
decided to make it using on the demand graph view and RRD creation and
update.

I've worked on a script made in PHP using it's SNMP functions and PHP
"System" function to create, update and graph RRD databases containing
interfaces statistics. I would like to share it with the users of this
list, so you can test and comment about the solution, telling bugs,
making suggestion and whatever...

Requeriments:
   PHP with SNMP support
   HTTP Server
   SNMP Access to devices
   RRDTool (I think that version 1.2.15+ will do it)

I've tested it on Debian Etch with Apache 2.2.3, net-snmp 5.2.3(needed
for PHP snmp support) and PHP 5.2.0-8+etch7.

To use it, the following must be done:
- Download the file, and save it in your monitoring server (an HTTP
access is needed).
- Create a folder to store the RRD databases and graphs. (must have HTTP access)
- Open it with the editor and edit the "Changeable Variables", at the
beggining of the file.
    - Set a default snmp community to query the hosts.
    - Specify the temporary directory that the RRD files and graphs
will be stored, and the relative path.
    - You must set the path for the rrdtool executable (if it's in
PATH, you can leave it as it is).

After this is all set, you can just access the PHP page with your
browser, and specify an host IP Address to monitor.

Observations:
    -> I've noted, that Windows machines only updates it's OIDs in a 5
seconds interval, so you can't monitor it in a interval less than
this, but you can monitor the switch port that the server is attached.
    -> It's VERY important that you set a default community, RESTRICT
the access to the page to only a few guys and access the page ONLY
with SSL encription. If you set a default community, the PHP page does
not need to pass the community via HTTP, so you will be at least a
little more safer.
    -> When the graphs are updating in a 1 second interval, the CPU
usage of the server can raise up to 10%.
    -> Do not consider this page as a monitoring tool. It's a problem
diagnose tool and a behavior analisys tool, to verify traffics spikes,
errors and so on...

# # KNOWNBUGS # #
     -> If you are using Firefox under windows, your memory usage you
raise fast, and the garbage collector is never called, so be warned. *
If anyone could help me with this, would be great! *
     -> The RRD files are beign re-created without need, but no impact
is caused at all (maybe a little, hehehe).

And, WARNING: This is a VERY experimental tool, that CONTAIN some bugs.

I'll fix the bugs, and do the following for a next "version":
    -> Add automatically Frame Relays BECN and FECN graphs for
frameRelay interfaces(I already have it on a past version).
    -> Add generic OIDs graphics support.

No more bla bla bla, you can download the PHP page here:
http://www.4shared.com/file/31391470/272c783/real-time-mon.html?dirPwdVerified=74480f49

If anyone could test, and reply expiriences, i'll be very glad.
Thanks :)

[]'s
Lívio Zanol Puppim



More information about the rrd-users mailing list