mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updates
git-svn-id: http://www.observium.org/svn/observer/trunk@484 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
5486
mibs/CISCO-SWITCH-ENGINE-MIB.my
Normal file
5486
mibs/CISCO-SWITCH-ENGINE-MIB.my
Normal file
File diff suppressed because it is too large
Load Diff
39
new-poller.php
Executable file
39
new-poller.php
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
if($argv[1]) { $where = "WHERE `device_id` = '$argv[1]'"; }
|
||||
|
||||
function snmp_array($oid, $device, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
$data = trim(shell_exec($cmd));
|
||||
$array = array();
|
||||
$device_id = $device['device_id'];
|
||||
foreach(explode("\n", $data) as $entry) {
|
||||
list ($this_oid, $this_value) = split(" = ", $entry);
|
||||
list ($this_oid, $this_index) = explode(".", $this_oid);
|
||||
$array[$device_id][$this_oid][$this_index] = $this_value;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
$interface_data = array();
|
||||
$device_query = mysql_query("SELECT * FROM `devices` $where ORDER BY device_id DESC");
|
||||
while ($device = mysql_fetch_array($device_query)) {
|
||||
|
||||
$oids = array('ifName','ifDescr','ifAlias');
|
||||
foreach ($oids as $oid) {
|
||||
$entries = snmp_array($oid, $device);
|
||||
$interface_data = @array_merge($entries, $interface_data);
|
||||
}
|
||||
print_r($interface_data);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -6,9 +6,6 @@ include("includes/functions.php");
|
||||
|
||||
$search = $argv[1] . "$";
|
||||
|
||||
|
||||
|
||||
|
||||
$data = trim(`cat ips-scanned.txt | grep alive | cut -d" " -f 1 | egrep $search`);
|
||||
|
||||
foreach( explode("\n", $data) as $ip) {
|
||||
|
Reference in New Issue
Block a user