From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,f183fc45b90fbe33,start X-Google-Attributes: gid10d4db,public From: proff@suburbia.net (Julian Assange) Subject: ISP accounting/timing software Date: 1996/02/12 Message-ID: X-Deja-AN: 139647728 x-original-date: 11 Feb 1996 13:59:58 GMT followup-to: comp.os.linux.networking content-type: text/plain; charset=ISO-8859-1 organization: AUSNet Services pty. ltd. mime-version: 1.0 newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- Daniel O'Callaghan (danny@hilink.com.au) wrote: : John Saunders wrote: : > : > Just some quick info about how ISP groups handle accounting for on-line : > time. I can see that with a fixed monthly price and x hours per day you : > could simnply charge monthly and run a daemon to log people out after x : > hours per day. With an hourly charged rate, are there SW packages out : > there in PD land, or are they custom writtem programs? : > I wrote one some time ago, it does most of what you want and then some, although it is undergoing a major re-write now to interface directly with my SQL backend. "Hidleho" does far more than just time tty's. It also does cute various process/tty/security stuff too. It is 100% C and mainly replaces the users login shell. It is FREE for NON-PROFIT, NON-GOVERMENT use. The enhanced SQL version should be ready within a month or so, however the current version should fit most people's needs unless you are part of the Bezerkely Postgres project ;) It currently does NOT calculate online charges, but it writes easily parseable accounting files for each user. As an example: sh# ls -l /usr/hidleho/gun/ total 8 - -rw------- 1 root sponsor 7 Dec 24 04:54 credit - -rw-r--r-- 1 hidleho adm 105 Oct 12 07:36 environ - -rw-r--r-- 1 hidleho unpaid 50 Feb 11 23:11 lastlogin - -rw-r--r-- 1 hidleho unpaid 50 Feb 11 20:13 lastlogout - -rw-r--r-- 1 hidleho unpaid 3 Feb 11 23:11 numlogins - -rw------- 1 hidleho adm 723 Oct 12 07:36 records - -rw-r--r-- 1 hidleho unpaid 15 Feb 11 23:11 timeleft - -rw-r--r-- 1 hidleho unpaid 17 Feb 11 20:13 totaltime bash# bash# cat /usr/hidleho/gun/numlogins 92 bash# cat /usr/hidleho/gun/totaltime 96029 1d2h40m29s bash# A user will see something like the following on login (if enabled): Enter terminal type [vt100 rows 24 cols 80 erase ^H]: * HidleHo (v0.98) (c) 1993, 1994, 1995 Julian Assange (Jan 1 1996) * Username: fun Hostname: suburbia.net Time this call: 45m Remote: suburbia Time granted: 1h30m/0s Time Left: 45m44s Tty weighting: 1.00 Time per call: 45m Input Idle: 10m Output Idle: 10m In/Out Warn: 3m Total Warn: 10m Exclude time: 4m Logins: 92 Total use: 1d2h40m29s Average call: 17m23s User ID: 3133 Group ID: 150 Tty-line: ttyp3 Tty-speed: 38400 Terminal: vt100 Shell: /bin/tcsh Flags = Information, Warnings, Full-Kill, AskTerm, BorrowTime, TimeAllTtys, ExclusiveIdle, TimerActive. Groups = sponsor, don45. ==> The configuration is relatively simple, here is a part of a real-life config file: bash# cat /etc/hidleho.cnf #/etc/hidleho.cnf is the configuration file for hildeho. # # the uid variable defines what user hidleho should run as for its # maintenance functions. you must ensure that all of # hidleho's config files and directories are owned by uid Uid hidleho # # TtyUid varible defines what user owns the vacant ttys. TtyUid root # # UserBase variable defines the directory to hold the per-user config # directories and sub-files. UserBase /usr/hidleho # # GroupBase variable defines the directory to hold the group-wide config # directories and sub-files. GroupBase /usr/hidleho # DeniedMsg File printed to tty when a user is denied access ('-' flag) DeniedMsg /etc/hidleho.denied # BorrowGrace Grace for logoff when lines are full. BorrowGrace 2 # # the def_term variable defines what the enviromental variable TERM should # be set to if hildeho is unable to obtain the terminal type # from the remote connection, /etc/gettydefs or ~/.termtype. Term vt100 # #the ttys variable defines the ttys to monitor if the users "B" flag # is set. Also effects the "C" flag. ttys ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5 ttyS6 ttyS7 ttyS8 ttyS9 # #the weights variable defines the multiplicative weight applied to # the effective calculated call time for the ttys specified # by ttys: weights 1 1 1 1 1 1 1 1 1 1 #the warn_t variable defines the t- times at which the user will be warned # of approching total timeout (up to 10 parameters) warn_t 10 1 #the warn_i variable defines the t- times at which the user will be warned # of approching idle timeout (up to 10 parameters) warn_i 3 2 1 # # Description of general parameters: # # Name = user name, or the pseudo-name "default:", or a # /etc/group name terminated with a trailing "+". # Total = total number of minutes the user is allowed on-line. # InIdle = how long for idle timeout, if no user input # OutIdle = how long for idle timeout, if no system output # TimeLim = the amount of time granted per time segmant # TimePer = the size (in time) of a time period/segmant # Exclude = minutes to exclude the user for on logout (B & C) # Flags = lower case alphabetical = FALSE, upper case = TRUE # I = send user Information at login time # i = do not " # W = send disconnection warnings to terminal # w = do not " # K = kill all users tasks system wide # k = kill all users tasks tty wide # A = ask user for terminal type # a = do not " # B = allow user to exist on borrowed time # b = do not " # C = total timeout only on a Configured ttys: # c = total timeout on all ttys # E = exclusive idle on. if (idle_in || idle_out) idle() # e = " off. if (idle_in && idle_out) idle() # T = timer on. # t = timer off, just exec shell after auth/term/info. # N = permit negative time left # n = do not permit negative time left (timeleft = 0 if negative) # U = unlimited negative time # u = negative time limited to -TimeLim # D = debug info to syslog # d = debug mode off # - = prevent user/group from loging in. # + = allow user/group to login. # # Shell = filename to execute # n.b an "*" specified in any but the Name parameter field acts as a place # holder. #Name Total InIdle OutIdle TimeLim TimePer Exclude Flags Shell # default: 40 10 10 2h 1d 0 nuTIWKABcE+ /usr/local/lbin/guest_login unpaid+ 40 10 10 4h 28d 10 KbEc /bin/tcsh donate+ 45 10 10 2h 1d 5 B /bin/tcsh sponsor+ 45 10 10 2h 1d 4 B /bin/tcsh oldsponsor+ 90 20 15 4h 1d 4 * /bin/tcsh don45+ 45 * * 90m 1d * * * don90+ 90 * * 180m 1d * * * don150+ 150 * * 5h 1d * * * don180+ 180 * * 6h 1d * * * don250+ 250 * * 8h 1d * * * donunl+ 1d * * 1d 1d 0 * * special+ 52w 20 20 0 0 0 eTiWka+ /bin/tcsh staff+ 52w 2h 2h 0 0 0 eTiWka+ /bin/tcsh volstaff+ 4h * * 4h 1d 0 E /bin/tcsh rlogin+ 52w 2h 2h 0 0 0 ik /bin/tcsh noprofit+ 4h * * 4h 1d 0 e /bin/tcsh proff * * * * * * AI /bin/bash puke * 1h 1h * * * I /bin/tcsh register 35 6 6 0 0 0 Ekabci /usr/local/lbin/guest_login mail 35 6 6 0 0 0 Ekabci /usr/local/lbin/guest_mail altos 60 6 6 0 0 0 Ekabci /usr/local/bin/altos fics 60 6 6 0 0 0 Ekabci /usr/local/bin/fics credit 1d 6 6 0 0 0 Ekabci /usr/local/lbin/credit_login www 52w * * 0 0 0 kia /bin/tcsh ==> Here are some examples of the hidleho accounting files: bash# cd /usr/hidleho/default: // default is for all users bash# ls -l total 6 - -rw-r--r-- 1 hidleho unpaid 53 Feb 11 23:30 lastlogin - -rw-r--r-- 1 hidleho unpaid 53 Feb 11 23:31 lastlogout - -rw-r--r-- 1 root sponsor 44 Jan 31 20:35 limits - -rwxr-xr-x 1 root sponsor 10 Feb 9 16:04 login_user - -rw-r--r-- 1 hidleho sponsor 5 Feb 11 23:30 numlogins - -rw-r--r-- 1 hidleho sponsor 45 Sep 6 15:22 permitdeny bash# cat limits rss 14000000 data 14000000 nproc 10 cpu 120 bash# cat permitdeny - -140.159.129.* - -140.159.130.* - -140.159.177.* bash# cd /usr/hidleho/sponsor+ // + means a group, these // are created automatically // for all groups and sub-groups bash# ls -l total 4 - -rw-r--r-- 1 hidleho sponsor 53 Feb 11 23:29 lastlogin - -rw-r--r-- 1 hidleho sponsor 54 Feb 11 23:24 lastlogout - -rw-r--r-- 1 hidleho sponsor 5 Feb 11 23:29 numlogins - -rw-r--r-- 1 hidleho sponsor 27 Feb 11 23:24 totaltime bash# cat numlogins 9741 bash# cat lastlogin orange /dev/ttyS4 824041771 Sun Feb 11 23:29:31 1996 bash# cd .. bash# cd unpaid+ bash# ls -l total 5 - -rw-r--r-- 1 hidleho unpaid 53 Feb 11 23:30 lastlogin - -rw-r--r-- 1 hidleho unpaid 53 Feb 11 23:31 lastlogout - -rw-r--r-- 1 hidleho sponsor 74 Sep 13 23:13 login - -rw-r--r-- 1 hidleho unpaid 5 Feb 11 23:30 numlogins - -rw-r--r-- 1 hidleho unpaid 25 Feb 11 23:31 totaltime bash# cat numlogins 5087 bash# cat login PATH=/usr/local/ubin:$PATH export PATH bash# cat lastlogin mkpham /dev/ttyS6 824041831 Sun Feb 11 23:30:31 1996 ==> Commercial/Government site's obtain a limited-user license for the hidleho software from suburbia.net. The "public release" version and source code is available (at the time of writing) from: ftp://suburbia.net/pub/proff/original/* Presently hiddle only supports linux. Ports to other enviroments can be arranged if needed. - --Proff - -- +----------------------------------+-----------------------------------------+ |Julian Assange | "if you think the United States has | |FAX: +61-3-9819-9066 | stood still, who built the largest | |EMAIL: proff@suburbia.net | shopping centre in the world?" - Nixon | +----------------------------------+-----------------------------------------+ - -- +----------------------------------+-----------------------------------------+ |Julian Assange | "if you think the United States has | |FAX: +61-3-9819-9066 | stood still, who built the largest | |EMAIL: proff@suburbia.net | shopping centre in the world?" - Nixon | +----------------------------------+-----------------------------------------+ -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMR7bfoQRll5MupLRAQEZpQQAv1e3eMArmoVF+P4Wv0gJEQhrcJBUc1cC Ej0ue7JvExYch/NNBMSJcbE+E3qIgb+tGqRaksOFyhnOTfWpy7jU9mJY1htdaws5 UzJAsrUXEd5iihHY14VtcJBsvrrQgWXR928avuNDXCG4Iy4nh9n1xbqEZDK0u/oi 5VvfWWJqS/I= =hTy4 -----END PGP SIGNATURE----- -- This article has been digitally signed by the moderator, using PGP. Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature. Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember a short description of the software and the LOCATION.