[LON-CAPA-admin] monitoring users with MRTG

lucasm at ohiou.edu lucasm at ohiou.edu
Tue Jan 27 14:24:47 EST 2004


Hi,

I mentioned the monitoring of student logins using mrtg at the meeting.

I've tar'd up some of these files and made a quick note describing these 
in minimal detail.

This is not anything that fancy, and I'm sure people could clean this up 
tremendously, but it's kind of nice to be able to get a quick graphical 
look at the usage history.

Let me know if this is useful.

Later,
Mark
---------------------------------------------------------------------------
Monitoring the Number of Users Using MRTG

Multi-Router Traffic Generator is a general purpose tool geared towards
monitoring network traffic through SMTP. It can also monitor anything
that it can read through an executable command.

Mrtg requires a utility to simply pass two numbers and a label (on three
separate lines). It will track this information every 5 minutes and
create daily, weekly and monthly plots. The data is compressed over
time to reduce the storage requirements. Data is kept for every 5
minutes up to a day. It is then averaged into large bins for the weekly
plot. It is once again averaged for the longer term plots.

I have a short perl script which examines the number of files in the
/home/httpd/lonIDs directory which have been accessed in the last X
seconds (X is the only argument for the script). It also returns the
total number of files (users). The difference typically represents those
who have not logged out.

I also use the file stat1.2.pl to obtain system parameters (load,
etc...). This is a fairly simple routine which typically taps into the
proc directory.

Installation:
 - mrtg comes in the standard RH releases (at least 7.3 and 9.0)

 - It can be started by placing the following line in the file /etc/crontab:

 0-59/5 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg

 - /etc/mrtg/mrtg.cfg must contain your configuration file. I've
   included mine as a sample.

 - I include an apache configuration file that can be included or
   inserted into httpd.conf.

 - place stat1.2.pl and lc_logins.pl into /usr/local/bin


Feel free to drop me a note if you have any questions: lucasm at ohio.edu

Mark Lucas
Ohio University



---------------------------------------------------------------------------
Mark Lucas					email: lucasm at ohiou.edu
252D Clippinger Lab  				phone: (740)597-2984
Department of Physics and Astronomy             fax:   (740)593-0433
Ohio University
Athens, OH 45701
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lc_logins.tar.gz
Type: application/x-gzip
Size: 5984 bytes
Desc: Small Scripts and conf files to monitor users with mrtg
URL: <http://mail.lon-capa.org/pipermail/lon-capa-admin/attachments/20040127/6f3763fa/attachment.gz>


More information about the LON-CAPA-admin mailing list