Annotation of loncom/debugging_tools/get_active.pl, revision 1.1
1.1 ! albertel 1: open(HOST,"<$ARGV[0]");
! 2: my $i++;
! 3: my $msu_total=0;
! 4: my $total=0;
! 5: my %done;
! 6: while(my $line=<HOST>) {
! 7: if ($line=~/^\#/) { next; }
! 8: my ($domain,$host)=(split(':',$line))[1,3];
! 9: chomp($host);
! 10: if (!$host || exists($done{$host})) { next; }
! 11: $done{$host}=1;
! 12: print($host." -> ");
! 13: my $result=`curl --user lonadm:litelite --connect-timeout 5 -s http://$host/cgi-bin/userstatus.pl?simple`;
! 14: my ($count)= ($result=~/\&Active=(\d+)\&/);
! 15: print($count."\n");
! 16: $total+=$count;
! 17: if ($domain eq 'msu') { $msu_total+=$count; }
! 18: # if ($i++==14) { last; }
! 19: }
! 20:
! 21: print("\n Total\t= $total\n");
! 22: print("\n MSU Total\t= $msu_total\n");
! 23: open(LOG,">>$ARGV[1]");
! 24: print LOG (time." $total $msu_total\n");
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>