2008-07-18 12:07:51 +00:00
|
|
|
<?php
|
|
|
|
|
2009-11-28 09:48:23 +00:00
|
|
|
echo("Doing Juniper JunOS ");
|
2010-07-02 19:58:13 +00:00
|
|
|
## FIX ME below
|
|
|
|
$jun_ver = trim(str_replace("\"", "", shell_exec($config['snmpget'] . " -M ".$config['mibdir'] . " -m HOST-RESOURCES-MIB -".$device['snmpver']." -Oqv -c ".$device['community']." ".$device['hostname'].":".$device['port']." .1.3.6.1.2.1.25.6.3.1.2.2")));
|
2009-11-28 09:48:23 +00:00
|
|
|
if(strpos($sysDescr, "olive")) {
|
|
|
|
$hardware = "Olive";
|
|
|
|
$serial = "";
|
|
|
|
} else {
|
2010-02-16 23:14:02 +00:00
|
|
|
$hardware = snmp_get($device, ".1.3.6.1.4.1.2636.3.1.2.0", "-OQv", "+JUNIPER-MIB", "+".$config['install_dir']."/mibs/junos");
|
|
|
|
$serial = snmp_get($device, ".1.3.6.1.4.1.2636.3.1.3.0", "-OQv", "+JUNIPER-MIB", "+".$config['install_dir']."/mibs/junos");
|
2009-11-28 09:48:23 +00:00
|
|
|
list(,$hardware,) = explode(" ", $hardware);
|
|
|
|
$hardware = "Juniper " . $hardware;
|
|
|
|
}
|
2008-07-18 12:07:51 +00:00
|
|
|
|
2009-09-03 15:04:04 +00:00
|
|
|
list($version) = explode("]", $jun_ver);
|
|
|
|
list(,$version) = explode("[", $version);
|
|
|
|
$features = "";
|
2008-07-18 12:07:51 +00:00
|
|
|
|
2009-03-16 15:19:44 +00:00
|
|
|
$cpurrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/junos-cpu.rrd";
|
2008-07-22 08:24:34 +00:00
|
|
|
|
2010-02-13 21:45:39 +00:00
|
|
|
#$cpu_cmd = $config['snmpget'] . " -m JUNIPER-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
|
|
|
#$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));
|
2008-07-22 08:24:34 +00:00
|
|
|
|
2010-02-05 23:20:15 +00:00
|
|
|
if (is_numeric($cpu_usage))
|
|
|
|
{
|
2010-02-05 23:53:20 +00:00
|
|
|
if (!is_file($cpurrd))
|
|
|
|
{
|
|
|
|
$rrdcreate = shell_exec($config['rrdtool'] ." create $cpurrd --step 300 DS:LOAD:GAUGE:600:-1:100 RRA:AVERAGE:0.5:1:1200 RRA:AVERAGE:0.5:1:2000 \
|
|
|
|
RRA:AVERAGE:0.5:6:2000 \
|
|
|
|
RRA:AVERAGE:0.5:24:2000 \
|
|
|
|
RRA:AVERAGE:0.5:288:2000 \
|
|
|
|
RRA:MAX:0.5:1:2000 \
|
|
|
|
RRA:MAX:0.5:6:2000 \
|
|
|
|
RRA:MAX:0.5:24:2000 \
|
|
|
|
RRA:MAX:0.5:288:2000 \
|
|
|
|
RRA:MIN:0.5:1:2000 \
|
|
|
|
RRA:MIN:0.5:6:2000 \
|
|
|
|
RRA:MIN:0.5:24:2000 \
|
|
|
|
RRA:MIN:0.5:288:2000");
|
2010-02-05 23:20:15 +00:00
|
|
|
}
|
2010-02-05 23:53:20 +00:00
|
|
|
echo "CPU: $cpu_usage%\n";
|
|
|
|
rrdtool_update($cpurrd, " N:$cpu_usage");
|
2010-02-05 23:20:15 +00:00
|
|
|
}
|
2008-07-18 12:07:51 +00:00
|
|
|
|
|
|
|
?>
|