biochris has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Monitor user activity
by Fletch (Bishop) on May 05, 2005 at 16:33 UTC
    use Mail::Send (); my @users = qw( bob carol ted alice ); while( 1 ) { for my $user ( @users ) { my $msg = Mail::Send->new( To => $user, Subject => "So, whatcha do +ing?" ); my $fh = $msg->open; print $fh "Please let me know.\n" $fh->close(); } sleep( 360 ); }

    And just wait for the responses to come flying in . . .

    Or read How (Not) To Ask A Question and post a more coherent question.

Re: Monitor user activity
by gellyfish (Monsignor) on May 05, 2005 at 16:09 UTC

    This depends on what you mean by "user activity", on Linux you can get user logins with for example, Sys::Utmp or via WMI on windows, process information you can get via Win32::Process::Info or Proc::ProcessTable on Unix for instance. It is unlikely however that you will find something that will provide this information for both, I would guess that your best bet would be to create a "service" on each different machine that uses the appropriate method for the OS and expose that over the network so that the information can be captured by a single program elsewhere.

    Of course both platforms support SNMP which can possibly be configured to provide the information that you need, and can be accessed over the network.

    /J\

Re: Monitor user activity
by moot (Chaplain) on May 05, 2005 at 16:04 UTC
    It would help greatly if you could define the terms 'monitor' and 'user activity', but you'll probably find the $^O variable helpful.
Re: Monitor user activity
by b10m (Vicar) on May 05, 2005 at 16:30 UTC

    As pointed out before, the term user activity is not very clear. On UNIX-like systems you could 'monitor' users who use a BASH shell e.g. by simply tailing the .bash_history

    $ tail -f ~user/.bash_history
    --
    b10m

    All code is usually tested, but rarely trusted.