Skip to content

Instantly share code, notes, and snippets.

@laf
Created August 4, 2017 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laf/b6d2c4ecbb86e6737d77127f562d678d to your computer and use it in GitHub Desktop.
Save laf/b6d2c4ecbb86e6737d77127f562d678d to your computer and use it in GitHub Desktop.
diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php
index 6ace36283..fb3680ea1 100644
--- a/includes/snmp.inc.php
+++ b/includes/snmp.inc.php
@@ -220,7 +220,8 @@ function snmp_get_multi_oid($device, $oids, $options = '-OUQn', $mib = null, $mi
}
$cmd = gen_snmpget_cmd($device, $oids, $options, $mib, $mibdir);
- $data = trim(external_exec($cmd));
+ $data = external_exec($cmd);
+ $data = trim($data, "\" \n\r");
$array = array();
foreach (explode("\n", $data) as $entry) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment