Removing polling code for processors

This commit is contained in:
Ruairi Carroll
2015-12-13 17:05:07 +01:00
parent 85c9f77962
commit b592689d23
-22
View File
@@ -33,26 +33,4 @@ if (is_numeric($sessions)) {
$graphs['fortigate_sessions'] = true;
}
// Start somewhat automated discovery for processors in the chassis
$cpurrd = $config['rrd_dir'].'/'.$device['hostname'].'/fortigate_cpu.rrd';
$num_cpu = snmp_get($device, 'FORTINET-FORTIGATE-MIB::fgProcessorCount.0', '-Ovq');
#$cpu_usage = snmp_get($device, 'FORTINET-FORTIGATE-MIB::fgSysCpuUsage.0', '-Ovq');
print "NUM CPU: $num_cpu\n";
// Fortigate have a pretty logical CPU index going on. It's predictable.
for($i = 1; $i <= $num_cpu; $i++) {
$cpurrd = $config['rrd_dir'].'/'.$device['hostname'].'/fortigate_cpu_'.$i.'.rrd';
$cpu_usage = snmp_get($device, "FORTINET-FORTIGATE-MIB::fgProcessorUsage.$i", '-Ovq');
$usage = trim ( str_replace(" %", "", $cpu_usage ) ) ;
print "CPU: $num_cpu - USAGE: $usage\n";
if (!is_file($cpurrd)) {
print "$cpurrd not found\n";
rrdtool_create($cpurrd, ' --step 300 DS:LOAD:GAUGE:600:-1:100 '.$config['rrd_rra']);
}
$fields = array( 'LOAD' => $usage );
rrdtool_update($cpurrd, $fields);
}