Index of /projects/FreeBSD-5.x/mrtg

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -
[TXT]BER.pm23-May-2010 10:16 22K
[TXT]MRTG_lib.pm23-May-2010 10:16 57K
[TXT]SNMP_Session.pm23-May-2010 10:16 27K
[TXT]SNMP_util.pm23-May-2010 10:16 34K
[TXT]add-mrtg-user23-May-2010 10:16 2.4K
[DIR]admin/23-May-2010 10:16 -
[   ]copyindex223-May-2010 10:16 126
[   ]fwstat.pl23-May-2010 10:16 2.9K
[TXT]index.php23-May-2010 10:16 6.2K
[TXT]index2.php23-May-2010 10:16 7.1K
[TXT]ip-test.cfg23-May-2010 10:16 48K
[TXT]ip-test.cfg_l_6147523-May-2010 10:16 0
[TXT]ip-test.ok23-May-2010 10:16 0
[   ]ip.sh23-May-2010 10:16 687
[TXT]locales_mrtg.pm23-May-2010 10:16 214K
[TXT]mod_watch.pl23-May-2010 10:16 4.2K
[   ]mod_watch318.tgz23-May-2010 10:16 92K
[TXT]mrtg23-May-2010 10:16 67K
[   ]mrtg-2.9.22.tar.gz23-May-2010 10:16 1.0M
[   ]mrtg-apache.BACKUP23-May-2010 10:16 138
[   ]mrtg-apache.cfg23-May-2010 10:16 10K
[   ]mrtg-config-template23-May-2010 10:16 138
[TXT]mrtg-per-ip.cfg23-May-2010 10:16 122K
[TXT]mrtg-per-ip.cfg.orig23-May-2010 10:16 122K
[TXT]mrtg-per-ip.ok23-May-2010 10:16 0
[   ]mrtg-users.cfg-HEAD23-May-2010 10:16 105
[DIR]mrtg-users/23-May-2010 10:16 -
[TXT]mrtg-watchtable23-May-2010 10:16 1.5K
[   ]mrtg-watchtable-domains23-May-2010 10:16 631
[   ]netstat.cfg23-May-2010 10:16 744
[   ]rateup23-May-2010 10:16 214K
[DIR]system/23-May-2010 10:16 -
[   ]template-users23-May-2010 10:16 895
[DIR]user-mrtg-work-dir/23-May-2010 10:16 -
[TXT]users-mrtg-crontab23-May-2010 10:16 861
[DIR]webmrtg/23-May-2010 10:16 -
[DIR]z/23-May-2010 10:16 -


=====================
PER USER MRTG scripts
=====================



Zoidial, Inc. 
Eric Thern

October, 2002
many updates in between
updated October, 2003 for putting online




WHAT IS IT?
-----------

This is a set of scripts to allow per-UID monitoring on a FreeBSD server.

It is mainly used for keeping track of your user bandwidth on an IRCd or Shell server.




FILES INVOLVED:
---------------


mrtg	- 	mrtg script, this is version 2.9.22, yes, it's a bit old, you can use a newer if you must.
		all the .pm files are associated with this 2.9.22 version, they are here to make sure it doesn't break.

fwstat.pl	-	script that parses IPFW logs for you

rateup	-	binary rateup file from mrtg distribution


IMPORTANT (possibly need-to-be edited) FILES:
---------------------------------------------

add-mrtg-user -	MAIN script to use for adding users, you will find a little how-to in the front of this script.
		It does a few things that it doesn't need to do, future versions may take these things out.
		(ie. adding proto-user quotas and the firewall rules, as well as adding users to /etc/ftpchroot)
		you can comment these portions out, and their accompaning 'if' statements if you would like.

template-users - template file for users.  MAKE SURE this is set up to your user home dir, and looks good.

*.php	-	billing and index php files, these have "zoidial, inc" in them probably, you most likely want to change them
		to your own company names.

users-mrtg-crontab	-	the crontab script to run (from crontab) please check this to make sure it's edited
				correctly for your own setup.

all user config files will be kept in mrtg-users/ these will also be used in creation of the admin pages



SUBDIR admin/
-------------

admin/CREATE-ADMIN-PAGE	-	creates the admin pages for all users.  EDIT the variables in the beginning of this, please!

admin/UPDATE-LOGS-ONLY -	Updates the logs for the admin page, only of use after the pages are made
				You must edit this to reflect your admin directory, else this will try to copy logs to somewhere else!

admin/admin-template	-	the admin template that CREATE-ADMIN-PAGE uses to to create.. the... admin page.... 
				(couldn't have guessed that)

admin/pages/*		-	pages associated with creation of the admin pages, some of these may need editing as they may 
				only reflect "Zoidial, Inc" info, and not your info.

all admin templates will be stored in user-templates/ and admin/



USAGE:
------

read the info in add-mrtg-user script and CREATE-ADMIN-PAGE script and see what they do.  In theory after editing these things
you should be able to run `./add-mrtg-user someuser somebandwidth protousertype` and then that user will be set up!

Then all you need is the users-mrtg-crontab running from the crontab, something like this:

*/12 * * * * /usr/bin/nice -n 20 /root/mrtg/users-mrtg-crontab >/dev/null 2>&1