mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
one less fork if no cpu usage could be read on junos (i.e. olive)
git-svn-id: http://www.observium.org/svn/observer/trunk@770 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -25,7 +25,9 @@ $cpu_cmd = $config['snmpget'] . " -m JUNIPER-MIB -O qv -" . $device['snmpver']
|
||||
$cpu_cmd .= " .1.3.6.1.4.1.2636.3.1.13.1.8.9.1.0.0";
|
||||
$cpu_usage = trim(shell_exec($cpu_cmd));
|
||||
|
||||
if (!is_file($cpurrd)) {
|
||||
if (is_numeric($cpu_usage))
|
||||
{
|
||||
if (!is_file($cpurrd)) {
|
||||
shell_exec($config['rrdtool'] . " create $cpurrd \
|
||||
--step 300 \
|
||||
DS:cpu:GAUGE:600:0:100 \
|
||||
@@ -37,9 +39,11 @@ if (!is_file($cpurrd)) {
|
||||
RRA:MAX:0.5:6:800 \
|
||||
RRA:MAX:0.5:24:800 \
|
||||
RRA:MAX:0.5:288:800");
|
||||
}
|
||||
}
|
||||
|
||||
shell_exec($config['rrdtool'] . " update $cpurrd N:$cpu_usage");
|
||||
if ($cpu_usage) { echo "CPU: $cpu_usage%\n"; }
|
||||
shell_exec($config['rrdtool'] . " update $cpurrd N:$cpu_usage");
|
||||
}
|
||||
|
||||
include("hr-mib.inc.php");
|
||||
|
||||
|
Reference in New Issue
Block a user