mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
a million fixes. half way to 0.6.0! :D
git-svn-id: http://www.observium.org/svn/observer/trunk@407 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+6
-4
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
//
|
||||
// Interface Status Poller
|
||||
//
|
||||
@@ -9,7 +10,6 @@
|
||||
|
||||
$interface_query = mysql_query("SELECT *, I.interface_id AS sqlid FROM `interfaces` AS I, `devices` AS D where I.device_id = D.device_id AND D.status = '1' AND I.device_id LIKE '%" . $argv[1] . "' ORDER BY I.device_id DESC");
|
||||
|
||||
var_dump($interface_query);
|
||||
while ($interface = mysql_fetch_array($interface_query)) {
|
||||
$hostname = $interface['hostname'];
|
||||
$host = $interface['host'];
|
||||
@@ -24,10 +24,12 @@
|
||||
$old_mac = $interface['mac'];
|
||||
$old_up_admin = $interface['up_admin'];
|
||||
$snmpver = $interface['snmpver'];
|
||||
$snmp_cmd = "snmpget -O qv -".$interface['snmpver']." -c ".$interface['community']." ".$interface['hostname'].":".$interface['port']." ifDescr.$ifIndex ifAdminStatus.$ifIndex ifOperStatus.$ifIndex ";
|
||||
$snmp_cmd .= "ifAlias.$ifIndex 1.3.6.1.2.1.10.7.2.1.$ifIndex ifName.$ifIndex";
|
||||
$snmp_cmd = "snmpget -m IF-MIB -O qv -".$interface['snmpver']." -c ".$interface['community']." ".$interface['hostname'].":".$interface['port']." ifDescr.$ifIndex ifAdminStatus.$ifIndex ifOperStatus.$ifIndex ";
|
||||
$snmp_cmd .= "ifAlias.$ifIndex ifName.$ifIndex";
|
||||
$snmp_output = trim(shell_exec($snmp_cmd));
|
||||
list($ifDescr, $ifAdminStatus, $ifOperStatus, $ifAlias, $ifDuplex, $ifName) = explode("\n", $snmp_output);
|
||||
list($ifDescr, $ifAdminStatus, $ifOperStatus, $ifAlias, $ifName) = explode("\n", $snmp_output);
|
||||
|
||||
## DUPLEX IS AT .1.3.6.1.4.1.9.5.1.4.1.1.10 <-- DUPLEX, K? BUT ONLY CATALYFAILS!
|
||||
|
||||
$ifDescr = trim(str_replace("\"", "", $ifDescr));
|
||||
$name = $ifDescr;
|
||||
|
||||
Reference in New Issue
Block a user