mrtg.cfg:
Target[CPU]: `/[Path_To]/vmstat-cpu.pl`
MaxBytes[CPU]: 100
Title[CPU]: CPU Loading
PageTop[CPU]: CPU Loading
Options[CPU]: gauge,growright
YLegend[CPU]: CPU Loading (%)
ShortLegend[CPU]: %
LegendO[CPU]: System
LegendI[CPU]: User
vmstat-cpu.pl:
#!/usr/bin/perl
@out = `vmstat -w 1 -c 2`;
$values = $out[$#out];
@field_value = split(' ',$values);
print "$field_value[$#field_value-2]\n";
print "$field_value[$#field_value-1]\n";
print "0\n0\n";
沒有留言:
張貼留言