mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
some fixes
git-svn-id: http://www.observium.org/svn/observer/trunk@513 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -4,7 +4,7 @@ echo("hrDevice : ");
|
||||
|
||||
$hrDevice_oids = array('hrDeviceIndex','hrDeviceType','hrDeviceDescr','hrDeviceStatus','hrDeviceErrors','hrProcessorLoad');
|
||||
|
||||
foreach ($hrDevice_oids as $oid) { echo("$oid "); $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
|
||||
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
|
||||
|
||||
foreach($hrDevice_array[$device[device_id]] as $hrDevice) {
|
||||
if(is_array($hrDevice)) {
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
$oids = shell_exec($config['snmpwalk'] . " -CI -m HOST-RESOURCES-MIB -Osq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " hrStorageIndex");
|
||||
$oids = trim(str_replace("hrStorageIndex.","",$oids));
|
||||
|
||||
echo(".. $oids .. ");
|
||||
|
||||
foreach(explode("\n", $oids) as $data) {
|
||||
if($data) {
|
||||
$data = trim($data);
|
||||
|
||||
@@ -37,7 +37,6 @@ if($device[os] != "Snom") {
|
||||
|
||||
foreach($oids[$proto] as $oid){
|
||||
$oid_ds = truncate($oid, 19, '');
|
||||
echo("\n$oid");
|
||||
$rrd_create .= " DS:$oid_ds:COUNTER:600:U:100000000000";
|
||||
$snmpstring .= " $oid.0";
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ while ($hrDevice = mysql_fetch_array($query)) {
|
||||
$this_hrDevice = $hrDevice_array[$device[device_id]][$hrDevice[hrDeviceIndex]];
|
||||
|
||||
$update_query = "UPDATE `hrDevice` SET";
|
||||
$update_query .= ", `hrDeviceStatus` = '".mres($this_hrDevice[hrDeviceStatus])."'";
|
||||
$update_query .= ", `hrDeviceErrors` = '".mres($this_hrDevice[hrDeviceErrors])."'";
|
||||
$update_query .= ", `hrProcessorLoad` = '".mres($this_hrDevice[hrProcessorLoad])."'";
|
||||
$update_query .= " WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrDevice['hrDeviceIndex']."'";
|
||||
$update_query .= ", `hrDeviceStatus` = '".mres($this_hrDevice['hrDeviceStatus'])."'";
|
||||
$update_query .= ", `hrDeviceErrors` = '".mres($this_hrDevice['hrDeviceErrors'])."'";
|
||||
$update_query .= ", `hrProcessorLoad` = '".mres($this_hrDevice['hrProcessorLoad'])."'";
|
||||
$update_query .= " WHERE hrDevice_id = '".$hrDevice['hrDevice_id']."'";
|
||||
@mysql_query($update_query); $mysql++; echo(".");
|
||||
|
||||
$procrrd = addslashes($config['rrd_dir'] . "/" . $device['hostname'] . "/hrProcessor-" . $hrDevice['hrDeviceIndex'] . ".rrd");
|
||||
|
||||
@@ -135,7 +135,6 @@
|
||||
}
|
||||
|
||||
$woo = "$polled:$ifInOctets:$ifOutOctets:$ifInErrors:$ifOutErrors:$ifInUcastPkts:$ifOutUcastPkts:$ifInNUcastPkts:$ifOutNUcastPkts";
|
||||
echo("\n rrdtool update $rrdfile $woo\n");
|
||||
$ret = rrdtool_update("$rrdfile", $woo);
|
||||
|
||||
/// End Update IF-MIB
|
||||
|
||||
Reference in New Issue
Block a user