[pptp-server] PPTP Logging Script

Robert Dege rcd at amherst.com
Mon Dec 3 08:30:00 CST 2001


Last night, I wrote a PPTP logon script to make it easier to track who
logs on & when.  I got sick of screwing around with the local2.* syslog
file. Basically, anyone who wants to use it may freely do so.  If anyone
knows how to make it more efficient, please let the list know.  Lord
knows, I'm no script wizard.

Here's an example of how it outputs:

##########################################
Start connection @ 08:10:51 AM on 12/03/01
Employee   : rcd
Outside IP : [128.205.90.139]
Inside  IP : [172.28.141.40]
Ended connection @ 08:17:25 AM on 12/03/01
##########################################

Installation instructions:

1) Take the attached file (userlog.sh), and put it into the /etc/ppp directory.
2) Modify /etc/ppp/ip-up, and add the following line:

	/etc/ppp/userlog.sh $1 $5

3) Modify /etc/ppp/ip-down, and the following lines:

	FILE="/tmp/`cat /var/run/$1.pid`"
	DAY=`date +%D`
	TIME=`date +%r`

	echo "Ended connection @ $TIME on $DAY" >> $FILE
	echo "##########################################" >> $FILE
	echo " " >> $FILE

	cat $FILE >> /var/log/pptp_connections.log
	rm $FILE


That's it!  There's just a few contingencies.  To extrapolate the
username, the script looks for the MSCHAP entry in the syslog.  This
usually gets generated by syslog with either local2.*, or daemon.*.  Make
sure that the script points to this log file.

Please let me know if anyone finds any bugs.  It's not robust, but then
again, that wasn't my mentality when I was writing it last night ;)

 -- 

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: userlog.sh
Type: application/x-sh
Size: 802 bytes
Desc: 
URL: <http://lists.schulte.org/mailman/private/pptp-server/attachments/20011203/30396cce/attachment.sh>


More information about the pptp-server mailing list