DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T m

⟦966bc25b0⟧ TextFile

    Length: 883 (0x373)
    Types: TextFile
    Names: »myrup«

Derivation

└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
    └─⟦b5330643c⟧ »./cops/perl-4.019/perl.tar.Z« 
        └─⟦2b9a58213⟧ 
            └─⟦this⟧ »perl-4.019/eg/myrup« 

TextFile

#!/usr/bin/perl

# $Header: myrup,v 4.0 91/03/20 01:11:16 lwall Locked $

# This was a customization of ruptime requested by someone here who wanted
# to be able to find the least loaded machine easily.  It uses the
# /etc/ghosts file that's defined for gsh and gcp to prune down the
# number of entries to those hosts we have administrative control over.

print "node    load (u)\n------- --------\n";

open(ghosts,'/etc/ghosts') || die "Can't open /etc/ghosts: $!";
line: while (<ghosts>) {
    next line if /^#/;
    next line if /^$/;
    next line if /=/;
    ($host) = split;
    $wanted{$host} = 1;
}

open(ruptime,'ruptime|') || die "Can't run ruptime: $!";
open(sort,'|sort +1n');

while (<ruptime>) {
    ($host,$upness,$foo,$users,$foo,$foo,$load) = split(/[\s,]+/);
    if ($wanted{$host} && $upness eq 'up') {
	printf sort "%s\t%s (%d)\n", $host, $load, $users;
    }
}