mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Cisco 1912 support (yay for dinosours) - number of fixes to be able to support snmp v1, bulkwalk doesnt work
git-svn-id: http://www.observium.org/svn/observer/trunk@666 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
1
html/images/os/cat1900.png
Symbolic link
1
html/images/os/cat1900.png
Symbolic link
@@ -0,0 +1 @@
|
||||
catos.png
|
@@ -4,7 +4,7 @@
|
||||
|
||||
echo("Interfaces : ");
|
||||
|
||||
$cmd = $config['snmpbulkwalk'] . " -m IF-MIB -O nsq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -m IF-MIB -O nsq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||
$cmd .= " ifDescr";
|
||||
if ($debug) echo("$cmd\n");
|
||||
$interfaces = trim(shell_exec($cmd));
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
function snmp_cache_cip($oid, $device, $array, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O snQ -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O snQ -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
$data = trim(shell_exec($cmd));
|
||||
@@ -33,7 +33,7 @@ function snmp_cache_cip($oid, $device, $array, $mib = 0) {
|
||||
function snmp_cache_ifIndex($device) {
|
||||
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
$cmd .= "-m IF-MIB ifIndex";
|
||||
$data = trim(shell_exec($cmd));
|
||||
$device_id = $device['device_id'];
|
||||
@@ -52,7 +52,7 @@ global $config;
|
||||
|
||||
function snmpwalk_cache_oid($poll_oid, $device, $array, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $poll_oid;
|
||||
@@ -71,7 +71,7 @@ function snmpwalk_cache_oid($poll_oid, $device, $array, $mib = 0) {
|
||||
|
||||
function snmpwalk_cache_twopart_oid($oid, $device, $array, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
@@ -90,7 +90,7 @@ function snmpwalk_cache_twopart_oid($oid, $device, $array, $mib = 0) {
|
||||
|
||||
function snmpwalk_cache_threepart_oid($oid, $device, $array, $mib = 0) {
|
||||
global $config, $debug;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
@@ -110,7 +110,7 @@ function snmpwalk_cache_threepart_oid($oid, $device, $array, $mib = 0) {
|
||||
|
||||
function snmp_cache_slotport_oid($oid, $device, $array, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
|
||||
$device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
@@ -132,7 +132,7 @@ function snmp_cache_slotport_oid($oid, $device, $array, $mib = 0) {
|
||||
|
||||
function snmp_cache_oid($oid, $device, $array, $mib = 0) {
|
||||
global $config;
|
||||
$cmd = $config['snmpbulkwalk'] . " -O UQs -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -O UQs -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
|
||||
if($mib) { $cmd .= "-m $mib "; }
|
||||
$cmd .= $oid;
|
||||
$data = trim(shell_exec($cmd));
|
||||
|
9
includes/osdiscovery/discover-cat1900.php
Executable file
9
includes/osdiscovery/discover-cat1900.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
if(!$os) {
|
||||
|
||||
if(strstr($sysDescr, "Cisco Systems Catalyst 1900")) { $os = "cat1900"; }
|
||||
|
||||
}
|
||||
|
||||
?>
|
7
includes/polling/device-cat1900.inc.php
Executable file
7
includes/polling/device-cat1900.inc.php
Executable file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
list(,$version) = split(',',$sysDescr,2);
|
||||
|
||||
$hardware = "1900";
|
||||
|
||||
?>
|
@@ -2,7 +2,7 @@
|
||||
|
||||
if($device['os_group'] == "ios") {
|
||||
$portifIndex = array();
|
||||
$cmd = $config['snmpwalk'] . " -CI -m CISCO-STACK-MIB -O q -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " portIfIndex";
|
||||
$cmd = ($device['snmpver'] == 'v1' ? $config['snmpwalk'] : $config['snmpbulkwalk']) . " -CI -m CISCO-STACK-MIB -O q -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " portIfIndex";
|
||||
#echo("$cmd");
|
||||
$portifIndex_output = trim(shell_exec($cmd));
|
||||
foreach(explode("\n", $portifIndex_output) as $entry){
|
||||
|
Reference in New Issue
Block a user