#c:\perl # getdisk2.pl # # Author: Kerry Werry # # Input: filename of file generated by DOS DIR Command # eg. perl getdisk2.pl c:\perflogs\data.txt # Output: mrtg data format # $STUFF=@ARGV[0]; open STUFF or die "Cannot open $STUFF for read :$!"; @entries = ; #gets last line of file which is where free space info is $line = pop @entries; #these two lines islolate the value in MB for disk free $data = substr($line, 25); $data = substr($data, -1000, -1); #Removes commas and replace with nothing $data =~ tr/, bytesfree//d; $data = $data / 1024; $data = $data / 1024; #output to MRTG print "$data\n"; print "$data\n"; print "0\n"; print "0\n";