mrtg/uptime.pl

changeset 135
cd68ee26852b
child 136
ca197d884ebd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mrtg/uptime.pl	Sat Apr 04 22:28:28 2009 +0200
     1.3 @@ -0,0 +1,14 @@
     1.4 +#!@l_prefix@/bin/perl
     1.5 +##
     1.6 +##  uptime.pl: provide formatted uptime(1) information
     1.7 +##
     1.8 +
     1.9 +$ZERO = 0;
    1.10 +$uptime = `uptime`;
    1.11 +
    1.12 +$uptime =~ /up (.*?) day/;
    1.13 +$up = int($1);
    1.14 +$hostname = `hostname`;
    1.15 +
    1.16 +print "$ZERO\n$up\n"
    1.17 +

mercurial