[K12OSN] collect stats

Huck dhuckaby at paasda.org
Fri Sep 8 21:39:06 UTC 2006


well I modified their 'unix_users.pl' script...

#!/usr/bin/perl

my $grep_string = $ARGV[0];

chomp $grep_string;

if ($grep_string eq '') {
         $output = `who | grep -c :`;
}else{
         $output = `who | grep : | grep -c $grep_string`;
}

chomp($output);
print $output;

and made it into this:

#!/usr/bin/perl

my $grep_string = $ARGV[0];

chomp $grep_string;

if ($grep_string eq '') {
         $output = `last | grep -c :`;
}else{
         $output = `last | grep still | grep -c $grep_string`;
}

chomp($output);
print $output;

---- I'll let ya know if it works in about 5 minutes =)
I'm thinking though...that 'last | grep -c :'; is going to report the 
linecount of the entire 'last' file..not just those 'still logged 
in'...which is what the $output should be if the first one fails.(at 
least that's how I'm reading the function)

haven't been able to get network traffic to graph yet either...but think 
that is snmp related...cuz I dunno anything about SNMP...

--Huck

Petre Scheie wrote:
> fl_teachertool?
> 
> How does fl_teachertool figure out who is logged in?  (Robert?)
> 
> Petre
> 
> Huck wrote:
>> One odd thing while check'n the Logged in Users on the LTSP 
>> Server...is that it doesn't report users logged in via the Thin 
>> Clients...
>> likely it uses the 'users' command to glean the information ... and 
>> Thin Client logins are not reflected there...
>>
>> any tips to get it to reflect the users of thin clients?
>>
>> --Huck
>>
>> _______________________________________________
>> K12OSN mailing list
>> K12OSN at redhat.com
>> https://www.redhat.com/mailman/listinfo/k12osn
>> For more info see <http://www.k12os.org>
>>
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 
> 




More information about the K12OSN mailing list