« hey you
split?
боже мой. в какво се забърках.
sub get_hdd_info {
$calc_hdd=`df -h`;
chomp($calc_hdd);
@df= split(” “, $calc_hdd);
print “Total space on $df[7] — $df[8] \n”;
print “Used space — $df[9] ($df[11])\n”;
print “Free space available — $df[10]\n”;@dfcheck= split(G, $df[10]); # Splitting the result, as it is returned as 20G, or 100G, or XXG.
chomp($dfcheck[0]);
if ( $dfcheck[0] lt “2″ ) { # 2G are critical, I think.
sendmail (’nickola@XXX’, ‘checker@XXX, ‘Resource Checker’,
‘The resource checker on’. ” $hostname “.
‘has registered issues with the amount of free HDD space and/or memory availability! Please investigate ASAP!’);
} else {
print “The free space is enough for living. I will shut the fuck up \n”;
}
}
ужас. програмисти. анатема.
Brand @ perl // May 29, 2007 / 4:28 am



