[afnog] retrieve user account

Brian Candler B.Candler at pobox.com
Mon Dec 12 12:42:47 EAT 2005


On Mon, Dec 12, 2005 at 10:18:31AM +0100, JONAS MARTIN wrote:
> I just want to know if there is a package which can fit my need. So I can
> prevent from rewriting a script. Although I will be obliged to do it myself.

You can always do a search on freshmeat.net to see if anything has been
released, but I'm not aware of such a package, so I think you'll need to do
it yourself.

This is an ideal candidate for scripting: right now you're doing the process
by hand, right? So you know exactly what commands you need to type to
extract the data. You just need to write a script which does the same
commands.

You also need to parse the responses into a CSV though. From that point of
view, it may be easier for you to use the raw information rather than
commands like 'finger' which format data to make it easy for humans to read,
but difficult to extract data from automatically.

So instead of using 'finger', read /etc/passwd directly. Use 'last' to find
records of logins for a particular user. And so on.

Regards,

Brian.



More information about the afnog mailing list