mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2134 from SaaldjorMike/issue-2132
Fixes issue where snmp_get would not return the value 0
This commit is contained in:
@ -1,11 +1,5 @@
|
||||
<?php
|
||||
|
||||
// If anybody has again the idea to implement the PHP internal library calls,
|
||||
// be aware that it was tried and banned by lead dev Adam
|
||||
//
|
||||
// TRUE STORY. THAT SHIT IS WHACK. -- adama.
|
||||
|
||||
|
||||
function string_to_oid($string) {
|
||||
$oid = strlen($string);
|
||||
for ($i = 0; $i != strlen($string); $i++) {
|
||||
@ -133,7 +127,7 @@ function snmp_get($device, $oid, $options=null, $mib=null, $mibdir=null) {
|
||||
if (is_string($data) && (preg_match('/(No Such Instance|No Such Object|No more variables left|Authentication failure)/i', $data))) {
|
||||
return false;
|
||||
}
|
||||
else if ($data) {
|
||||
elseif ($data || $data === '0') {
|
||||
return $data;
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user