mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
cleanups
git-svn-id: http://www.observium.org/svn/observer/trunk@320 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -3,24 +3,24 @@
|
|||||||
## List of real names for cisco entities
|
## List of real names for cisco entities
|
||||||
|
|
||||||
$entPhysicalVendorTypes = array (
|
$entPhysicalVendorTypes = array (
|
||||||
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
|
'cevC7xxxIo1feTxIsl' => 'C7200-IO-FE-MII',
|
||||||
'cevChassis7140Dualfe' => 'C7140-2FE',
|
'cevChassis7140Dualfe' => 'C7140-2FE',
|
||||||
'cevChassis7204' => "C7204",
|
'cevChassis7204' => "C7204",
|
||||||
'cevChassis7204Vxr' => 'C7204VXR',
|
'cevChassis7204Vxr' => 'C7204VXR',
|
||||||
'cevChassis7206' => 'C7206',
|
'cevChassis7206' => 'C7206',
|
||||||
'cevChassis7206Vxr' => 'C7206VXR',
|
'cevChassis7206Vxr' => 'C7206VXR',
|
||||||
'cevCpu7200Npe200' => 'NPE-200',
|
'cevCpu7200Npe200' => 'NPE-200',
|
||||||
'cevCpu7200Npe225' => 'NPE-225',
|
'cevCpu7200Npe225' => 'NPE-225',
|
||||||
'cevCpu7200Npe300' => 'NPE-300',
|
'cevCpu7200Npe300' => 'NPE-300',
|
||||||
'cevCpu7200Npe400' => 'NPE-400',
|
'cevCpu7200Npe400' => 'NPE-400',
|
||||||
'cevCpu7200Npeg1' => 'NPE-G1',
|
'cevCpu7200Npeg1' => 'NPE-G1',
|
||||||
'cevCpu7200Npeg2' => 'NPE-G2',
|
'cevCpu7200Npeg2' => 'NPE-G2',
|
||||||
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
|
'cevPa1feTxIsl' => 'PA-FE-TX-ISL',
|
||||||
'cevPa2feTxI82543' => 'PA-2FE-TX',
|
'cevPa2feTxI82543' => 'PA-2FE-TX',
|
||||||
'cevPa8e' => 'PA-8E',
|
'cevPa8e' => 'PA-8E',
|
||||||
'cevPaA8tX21' => 'PA-8T-X21',
|
'cevPaA8tX21' => 'PA-8T-X21',
|
||||||
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
|
'cevMGBIC1000BaseLX' => '1000BaseLX GBIC',
|
||||||
'cevPort10GigBaseLR' => '10GigBaseLR');
|
'cevPort10GigBaseLR' => '10GigBaseLR');
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ include_once("Net/IPv6.php");
|
|||||||
## Observer Includes
|
## Observer Includes
|
||||||
|
|
||||||
include_once($config['install_dir'] . "/includes/generic.php");
|
include_once($config['install_dir'] . "/includes/generic.php");
|
||||||
include_once($config['install_dir'] . "/includes/ios.php");
|
|
||||||
include_once($config['install_dir'] . "/includes/unix.php");
|
include_once($config['install_dir'] . "/includes/unix.php");
|
||||||
include_once($config['install_dir'] . "/includes/procurve.php");
|
include_once($config['install_dir'] . "/includes/procurve.php");
|
||||||
include_once($config['install_dir'] . "/includes/graphing.php");
|
include_once($config['install_dir'] . "/includes/graphing.php");
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
<?
|
|
||||||
|
|
||||||
function pollDeviceIOS() {
|
|
||||||
|
|
||||||
global $device;
|
|
||||||
global $community;
|
|
||||||
global $config;
|
|
||||||
$id = $device['device_id'];
|
|
||||||
|
|
||||||
$hostname = $device['hostname'];
|
|
||||||
$hardware = $device['hardware'];
|
|
||||||
$version = $device['version'];
|
|
||||||
$features = $device['features'];
|
|
||||||
$location = $device['location'];
|
|
||||||
$os = $device['location'];
|
|
||||||
|
|
||||||
$temprrd = "rrd/" . $hostname . "-temp.rrd";
|
|
||||||
$cpurrd = "rrd/" . $hostname . "-cpu.rrd";
|
|
||||||
$memrrd = "rrd/" . $hostname . "-mem.rrd";
|
|
||||||
|
|
||||||
list ($cpu5m, $cpu5s) = explode("\n", `snmpget -O qv -v2c -c $community $hostname 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0`);
|
|
||||||
|
|
||||||
$cpu5m = $cpu5m + 0;
|
|
||||||
$cpu5s = $cpu5s + 0;
|
|
||||||
list ($tempin1, $tempout1) = explode("\n", `snmpget -O qv -v2c -c $community $hostname .1.3.6.1.4.1.9.9.13.1.3.1.3.1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2`);
|
|
||||||
$tempin1 = $tempin1 +0;
|
|
||||||
$tempout1 = $tempout1 + 0;
|
|
||||||
$mem_get = ".1.3.6.1.4.1.9.9.48.1.1.1.6.2 .1.3.6.1.4.1.9.9.48.1.1.1.6.1 .1.3.6.1.4.1.9.9.48.1.1.1.6.3";
|
|
||||||
$mem_get .= ".1.3.6.1.4.1.9.9.48.1.1.1.5.2 .1.3.6.1.4.1.9.9.48.1.1.1.5.1 .1.3.6.1.4.1.9.9.48.1.1.1.5.3";
|
|
||||||
$mem_raw = `snmpget -O qv -v2c -c $community $hostname $mem_get`;
|
|
||||||
$mem_raw = str_replace("No Such Instance currently exists at this OID", "0", $mem_raw);
|
|
||||||
list ($memfreeio, $memfreeproc, $memfreeprocb, $memusedio, $memusedproc, $memusedprocb) = explode("\n", $mem_raw);
|
|
||||||
echo("$hostname\n");
|
|
||||||
$memfreeproc = $memfreeproc + $memfreeprocb;
|
|
||||||
$memusedproc = $memusedproc + $memusedprocb;
|
|
||||||
$memfreeio = $memfreeio + 0;
|
|
||||||
$memfreeproc = $memfreeproc + 0;
|
|
||||||
$memusedio = $memusedio + 0;
|
|
||||||
$memusedproc = $memusedproc + 0;
|
|
||||||
$memtotal = $memfreeio + $memfreeproc + $memusedio + $memusedproc;
|
|
||||||
if (!is_file($cpurrd)) {
|
|
||||||
$rrdcreate = shell_exec($config['rrdtool'] . " create $cpurrd --step 300 \
|
|
||||||
DS:LOAD5S:GAUGE:600:-1:100 \
|
|
||||||
DS:LOAD5M:GAUGE:600:-1:100 \
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
if (!is_file($temprrd)) {
|
|
||||||
$rrdcreate = shell_exec($config['rrdtool'] . " create $temprrd --step 300 \
|
|
||||||
DS:TEMPIN1:GAUGE:600:-25:100 \
|
|
||||||
DS:TEMPOUT1:GAUGE:600:-25:100 \
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
if (!is_file($memrrd)) {
|
|
||||||
$rrdcreate = shell_exec($config['rrdtool'] . " create $memrrd --step 300 \
|
|
||||||
DS:IOFREE:GAUGE:600:0:U \
|
|
||||||
DS:IOUSED:GAUGE:600:-1:U \
|
|
||||||
DS:PROCFREE:GAUGE:600:0:U \
|
|
||||||
DS:PROCUSED:GAUGE:600:-1:U \
|
|
||||||
DS:MEMTOTAL:GAUGE:600:-1:U \
|
|
||||||
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");
|
|
||||||
|
|
||||||
}
|
|
||||||
shell_exec($config['rrdtool'] . " update $temprrd N:$tempin1:$tempout1");
|
|
||||||
shell_exec($config['rrdtool'] . " update $cpurrd N:$cpu5s:$cpu5m");
|
|
||||||
shell_exec($config['rrdtool'] . " update $memrrd N:$memfreeio:$memusedio:$memfreeproc:$memusedproc:$memtotal");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user