mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Tidy up debug vs. non-debug output
This commit is contained in:
@@ -364,7 +364,6 @@ function rrd_create_update($device, $name, $def, $val, $step = 300)
|
|||||||
if (!is_file($rrd) && $def != null) {
|
if (!is_file($rrd) && $def != null) {
|
||||||
// add the --step and the rra definitions to the array
|
// add the --step and the rra definitions to the array
|
||||||
$newdef = "--step $step ".implode(' ', $def).$config['rrd_rra'];
|
$newdef = "--step $step ".implode(' ', $def).$config['rrd_rra'];
|
||||||
d_echo("Creating RRD $rrd: $newdef");
|
|
||||||
rrdtool_create($rrd, $newdef);
|
rrdtool_create($rrd, $newdef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,10 +11,12 @@
|
|||||||
* the source code distribution for details.
|
* the source code distribution for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
d_echo("MIB-based polling");
|
echo("MIB-based polling");
|
||||||
|
d_echo("\n", ": ");
|
||||||
|
|
||||||
$devicemib = array($device['sysObjectID'] => "all");
|
$devicemib = array($device['sysObjectID'] => "all");
|
||||||
poll_mibs($devicemib, $device, $graphs);
|
poll_mibs($devicemib, $device, $graphs);
|
||||||
|
|
||||||
d_echo("Done MIB-based polling");
|
d_echo("Done MIB-based polling");
|
||||||
|
echo("\n");
|
||||||
?>
|
?>
|
||||||
|
@@ -944,17 +944,17 @@ function snmp_translate($oid, $module, $mibdir = null)
|
|||||||
|
|
||||||
$lines = preg_split('/\n+/', shell_exec($cmd));
|
$lines = preg_split('/\n+/', shell_exec($cmd));
|
||||||
if (!$lines) {
|
if (!$lines) {
|
||||||
d_echo("No results from snmptranslate");
|
d_echo("No results from snmptranslate\n");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if (!preg_match('/(.*)::(.*)/', $lines[0], $matches)) {
|
if (!preg_match('/(.*)::(.*)/', $lines[0], $matches)) {
|
||||||
d_echo("This doesn't look like a MIB: ".$lines[0]);
|
d_echo("This doesn't look like a MIB: $lines[0]\n");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
d_echo("SNMP translated: $module::$oid -> $matches[1]::$matches[2]");
|
d_echo("SNMP translated: $module::$oid -> $matches[1]::$matches[2]\n");
|
||||||
return array($matches[1], $matches[2]);
|
return array($matches[1], $matches[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1071,7 +1071,7 @@ function save_mibs($device, $mibname, $oids, $mibdef, &$graphs)
|
|||||||
function poll_mibs($list, $device, &$graphs)
|
function poll_mibs($list, $device, &$graphs)
|
||||||
{
|
{
|
||||||
if (!is_dev_attrib_enabled($device, "poll_mib")) {
|
if (!is_dev_attrib_enabled($device, "poll_mib")) {
|
||||||
d_echo("MIB module disabled for ".$device['hostname']);
|
d_echo("MIB module disabled for ".$device['hostname']."\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$mibdefs = array();
|
$mibdefs = array();
|
||||||
@@ -1085,7 +1085,7 @@ function poll_mibs($list, $device, &$graphs)
|
|||||||
save_mibs($device, $nam, $oids, $mibdefs[$nam], $graphs);
|
save_mibs($device, $nam, $oids, $mibdefs[$nam], $graphs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
d_echo("MIB: no match for $module::$name");
|
d_echo("MIB: no match for $module::$name\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user