mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
switch to preg_split (split deprecated). ignore temps >1000 and == 0 for lmsensors
git-svn-id: http://www.observium.org/svn/observer/trunk@1150 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -42,7 +42,7 @@ function snmp_cache_cip($oid, $device, $array, $mib = 0)
|
||||
$device_id = $device['device_id'];
|
||||
#echo("Caching: $oid\n");
|
||||
foreach(explode("\n", $data) as $entry) {
|
||||
list ($this_oid, $this_value) = split("=", $entry);
|
||||
list ($this_oid, $this_value) = preg_split("/=/", $entry);
|
||||
$this_oid = trim($this_oid);
|
||||
$this_value = trim($this_value);
|
||||
$this_oid = substr($this_oid, 30);
|
||||
@@ -69,7 +69,7 @@ function snmp_cache_ifIndex($device) {
|
||||
$data = trim(shell_exec($cmd));
|
||||
$device_id = $device['device_id'];
|
||||
foreach(explode("\n", $data) as $entry) {
|
||||
list ($this_oid, $this_value) = split("=", $entry);
|
||||
list ($this_oid, $this_value) = preg_split("/=/", $entry);
|
||||
list ($this_oid, $this_index) = explode(".", $this_oid);
|
||||
$this_index = trim($this_index);
|
||||
$this_oid = trim($this_oid);
|
||||
@@ -217,7 +217,7 @@ function snmp_cache_oid($oid, $device, $array, $mib = 0) {
|
||||
$device_id = $device['device_id'];
|
||||
#echo("Caching: $oid\n");
|
||||
foreach(explode("\n", $data) as $entry) {
|
||||
list ($this_oid, $this_value) = split("=", $entry);
|
||||
list ($this_oid, $this_value) = preg_split("/=/", $entry);
|
||||
list ($this_oid, $this_index) = explode(".", $this_oid);
|
||||
$this_index = trim($this_index);
|
||||
$this_oid = trim($this_oid);
|
||||
|
||||
Reference in New Issue
Block a user