mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
correctly use transport for observernms-custom, also add debug info
git-svn-id: http://www.observium.org/svn/observer/trunk@1926 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -6,7 +6,9 @@ if ($device['os_group'] == "unix")
|
||||
{
|
||||
# FIXME snmp_walk
|
||||
# ObserverNMS-style temperature
|
||||
$oids = shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -CI -c ".$device['community']." ".$device['transport'].":".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891 | sed s/.1.3.6.1.4.1.2021.7891.// | grep '.1.1 ' | grep -v '.101.' | cut -d'.' -f 1");
|
||||
$cmd = $config['snmpwalk'] . " -M " . $config['mibdir'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -CI -c ".$device['community']." ".$device['transport'].":".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891 | sed s/.1.3.6.1.4.1.2021.7891.// | grep '.1.1 ' | grep -v '.101.' | cut -d'.' -f 1";
|
||||
if ($debug) { echo "$cmd\n"; }
|
||||
$oids = shell_exec($cmd);
|
||||
$oids = trim($oids);
|
||||
if ($oids) echo("Observer-Style ");
|
||||
foreach (explode("\n",$oids) as $oid)
|
||||
@@ -15,7 +17,7 @@ if ($device['os_group'] == "unix")
|
||||
if ($oid != "")
|
||||
{
|
||||
# FIXME snmp_get
|
||||
$descr_query = $config['snmpget'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -c ".$device['community']." ".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891.$oid.2.1 | sed s/.1.3.6.1.4.1.2021.7891.$oid.2.1\ //";
|
||||
$descr_query = $config['snmpget'] . " -M " . $config['mibdir'] . " -".$device['snmpver']." -m SNMPv2-SMI -Osqn -c ".$device['community']." ".$device['transport'].':'.$device['hostname'].":".$device['port']." .1.3.6.1.4.1.2021.7891.$oid.2.1 | sed s/.1.3.6.1.4.1.2021.7891.$oid.2.1\ //";
|
||||
$descr = trim(str_replace("\"", "", shell_exec($descr_query)));
|
||||
$fulloid = ".1.3.6.1.4.1.2021.7891.$oid.101.1";
|
||||
discover_sensor($valid_sensor, 'temperature', $device, $fulloid, $oid, 'observium', $descr, '1', '1', NULL, NULL, NULL, NULL, $current);
|
||||
|
||||
Reference in New Issue
Block a user