mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
fix CPU RRD graphs
This commit is contained in:
parent
8fc66a0084
commit
bc9b5f3380
@ -3300,20 +3300,11 @@ function enable_rrd_graphing() {
|
||||
}
|
||||
|
||||
/* the CPU stats gathering function. */
|
||||
$rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { ";
|
||||
$rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } ";
|
||||
$rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { ";
|
||||
$rrdupdatesh .= "processes = \$1; ";
|
||||
$rrdupdatesh .= "} ";
|
||||
$rrdupdatesh .= "else if ( \$1 == \"CPU\" ) { ";
|
||||
$rrdupdatesh .= "user = \$3; ";
|
||||
$rrdupdatesh .= "nice = \$5; ";
|
||||
$rrdupdatesh .= "sys = \$7; ";
|
||||
$rrdupdatesh .= "interrupt = \$9; ";
|
||||
$rrdupdatesh .= "} ";
|
||||
$rrdupdatesh .= "} END { ";
|
||||
$rrdupdatesh .= "printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes ";
|
||||
$rrdupdatesh .= "}'`\n\n";
|
||||
$rrdupdatesh .= "`$top -d 2 -s 1 0 | $awk '{gsub(/%/, \"\")} BEGIN { \\\n";
|
||||
$rrdupdatesh .= "printf \"$rrdtool update $rrddbpath$ifname$proc \" } \\\n";
|
||||
$rrdupdatesh .= "{ if ( \$2 == \"processes:\" ) { processes = \$1; } \\\n";
|
||||
$rrdupdatesh .= "else if ( \$1 == \"CPU:\" ) { user = \$2; nice = \$4; sys = \$6; interrupt = \$8; } \\\n";
|
||||
$rrdupdatesh .= "} END { printf \"N:\"user\":\"nice\":\"sys\":\"interrupt\":\"processes }'`\n\n";
|
||||
|
||||
/* End CPU statistics */
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user