Updated rrdtool_update() to use new array format

This commit is contained in:
laf
2015-08-18 16:26:55 +00:00
parent 84a0b8f676
commit 987634e463
65 changed files with 591 additions and 271 deletions
+14 -2
View File
@@ -23,7 +23,13 @@ if (is_numeric($sessions)) {
}
print "Sessions: $sessions\n";
rrdtool_update($sessrrd, 'N:'.$sessions);
$fields = array(
'sessions' => $sessions,
);
rrdtool_update($sessrrd, $fields);
$graphs['fortigate_sessions'] = true;
}
@@ -36,6 +42,12 @@ if (is_numeric($cpu_usage)) {
}
echo "CPU: $cpu_usage%\n";
rrdtool_update($cpurrd, " N:$cpu_usage");
$fields = array(
'LOAD' => $cpu_usage,
);
rrdtool_update($cpurrd, $fields);
$graphs['fortigate_cpu'] = true;
}
+6 -1
View File
@@ -13,6 +13,11 @@ if (is_numeric($sessions)) {
rrdtool_create($sessrrd, ' --step 300 DS:sessions:GAUGE:600:0:3000000 '.$config['rrd_rra']);
}
rrdtool_update($sessrrd, "N:$sessions");
$fields = array(
'sessions' => $sessions,
);
rrdtool_update($sessrrd, $fields);
$graphs['panos_sessions'] = true;
}
+5 -1
View File
@@ -44,7 +44,11 @@ if (is_numeric($FdbAddressCount)) {
);
}
rrdtool_update($fdb_rrd_file, "N:$FdbAddressCount");
$fields = array(
'value' => $FdbAddressCount,
);
rrdtool_update($fdb_rrd_file, $fields);
$graphs['fdb_count'] = true;
+7 -1
View File
@@ -19,6 +19,12 @@ if (!is_file($sessrrd)) {
);
}
rrdtool_update("$sessrrd", "N:$sessalloc:$sessmax:$sessfailed");
$fields = array(
'allocate' => $sessalloc,
'max' => $sessmax,
'failed' => $sessfailed,
);
rrdtool_update("$sessrrd", $fields);
$graphs['screenos_sessions'] = true;
+10 -2
View File
@@ -36,5 +36,13 @@ if (!is_file($rrdfile)) {
);
}
$rrdupdate = "N:$rxbytes:$txbytes:$rxpkts:$rxbytes:$calls:$registrations";
rrdtool_update("$rrdfile", $rrdupdate);
$fields = array(
'INOCTETS' => $rxbytes,
'OUTOCTETS' => $txbytes,
'INPKTS' => $rxpkts,
'OUTPKTS' => $rxbytes,
'CALLS' => $calls,
'REGISTRATIONS' => $registrations,
);
rrdtool_update("$rrdfile", $fields);