From owner-freebsd-questions Tue Feb 20 10:19:46 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id KAA25800 for questions-outgoing; Tue, 20 Feb 1996 10:19:46 -0800 (PST) Received: from cwbone.bsi.com.br ([200.250.250.14]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id KAA25789 for ; Tue, 20 Feb 1996 10:19:38 -0800 (PST) Received: from lenzi ([200.247.248.103]) by cwbone.bsi.com.br (8.6.12/8.6.9) with SMTP id PAA01743; Tue, 20 Feb 1996 15:19:20 GMT Date: Tue, 20 Feb 1996 15:20:14 -0300 (EST) From: "Lenzi, Sergio" X-Sender: lenzi@lenzi To: Ian Wynne cc: questions@freebsd.org Subject: Billing on ISP In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk On Tue, 20 Feb 1996, Ian Wynne wrote: > I'm setting up an Internet Provider Service using FreeBSD 2.1. > > I don't know how to get the user information for billing purposes, > ie login and logout times and duration spent on the system. > I had the same type of problem here at bsi.com.br. After billing the users using the "last" or "ac" command, I decided to use an DBMS for that. I use ingres (university ingres version 8.9). 1) The /etc/profile inserts data in the ingres database using: ingres db <<% range of m is account append account (login="xxx",timein=$time,machine=uname,tty=$tty) % 2) when the user logs-out, a program (ingresgetty) is executed. 3) this program does: range of m is account replace m (timeout=$time) where m.machine=$machine and m.tty=$tty and m.timeout=0 4) This closes the entry in the ingres relation. and then, the program execvp ("/usr/libexec/getty",argv); for billing extracts, I use the query language of the ingres to retrieve information and printing extracts. The data-base is also source for consulting by the users of the isp using Netscape and a cgi-bin program that asks for username and password and give uses the ammount of time consummed during the month. Take a look at http://www.bsi.com.br/acc.html 5) Due my ISP is in Brazil, the answer for the query is in Portuguese, but you can have an idea. Please use Netscape or Mosaic. Hope this will help. Sergio Lenzi.