Skip to content

Commit

Permalink
Cherry pick and merge 59f43cf.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Oct 1, 2024
1 parent c87738f commit baaed2d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
11 changes: 11 additions & 0 deletions app/Helpers/snmp_14179_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,16 @@
if (!empty($details->serial)) {
$details->manufacturer = 'Cisco Systems';
}

$details->description = my_snmp_get($ip, $credentials, "1.3.6.1.2.1.1.1.0");
if (!empty($details->description) and stripos($details->description, "Cisco Controller") !== false) {
$details->os_group = 'Cisco';
$details->os_family = 'Cisco IOS-XE';
$temp = my_snmp_get($ip, $credentials, "1.3.6.1.2.1.47.1.1.1.1.10.1");
$details->os_version = (!empty($temp)) ? $temp : '';
$details->os_name = (!empty($temp)) ? "Cisco IOS-XE " . $temp : 'Cisco IOS-XE';
$details->os_cpe_name = 'ios_xe';
}

return($details);
};
12 changes: 12 additions & 0 deletions app/Helpers/snmp_9_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
$details->os_name = "Cisco IOS-XE ".$details->os_version;
$details->os_cpe_name = 'ios_xe';
}
if (stripos($details->description, "Cisco Controller") !== false) {
$details->os_group = 'Cisco';
$details->os_family = 'Cisco IOS-XE';
$temp = my_snmp_get($ip, $credentials, "1.3.6.1.2.1.47.1.1.1.1.10.1");
$details->os_name = (!empty($temp)) ? "Cisco IOS-XE " . $details->os_version : 'Cisco IOS-XE';
$details->os_cpe_name = 'ios_xe';
}
if (stripos($details->description, "Cisco Internetwork Operating System Software") !== false) {
$details->os_group = 'Cisco';
$details->os_family = 'Cisco IOS';
Expand Down Expand Up @@ -166,5 +173,10 @@
$details->os_name = my_snmp_get($ip, $credentials, "1.3.6.1.4.1.9.9.249.1.1.1.1.2");
}

# Wireless Access Controller 9800
if (empty($details->os_version)) {
$details->os_version = my_snmp_get($ip, $credentials, "1.3.6.1.2.1.47.1.1.1.1.10.1");
}

return($details);
};
18 changes: 9 additions & 9 deletions app/Helpers/snmp_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,15 +1231,15 @@ function snmp_audit(string $ip = '', object $credentials = null, int $discovery_
$module = new \StdClass();
$module->description = $value;
$module->module_index = str_replace('.1.3.6.1.2.1.47.1.1.1.1.2.', '', $key);
$module->object_ident = $temp_object_id['.1.3.6.1.2.1.47.1.1.1.1.3.'.$module->module_index];
$module->contained_in = $temp_contained_in['.1.3.6.1.2.1.47.1.1.1.1.4.'.$module->module_index];
$module->class = $temp_class['.1.3.6.1.2.1.47.1.1.1.1.5.'.$module->module_index];
$module->hardware_revision = $temp_hardware_revision['.1.3.6.1.2.1.47.1.1.1.1.8.'.$module->module_index];
$module->firmware_revision = $temp_firmware_revision['.1.3.6.1.2.1.47.1.1.1.1.9.'.$module->module_index];
$module->software_revision = $temp_software_revision['.1.3.6.1.2.1.47.1.1.1.1.10.'.$module->module_index];
$module->serial = $temp_serial_number['.1.3.6.1.2.1.47.1.1.1.1.11.'.$module->module_index];
$module->asset_ident = $temp_asset_id['.1.3.6.1.2.1.47.1.1.1.1.15.'.$module->module_index];
$module->is_fru = $temp_is_fru['.1.3.6.1.2.1.47.1.1.1.1.16.'.$module->module_index];
$module->object_ident = (!empty($temp_object_id['.1.3.6.1.2.1.47.1.1.1.1.3.' . $module->module_index])) ? $temp_object_id['.1.3.6.1.2.1.47.1.1.1.1.3.' . $module->module_index] : '';
$module->contained_in = (!empty($temp_contained_in['.1.3.6.1.2.1.47.1.1.1.1.4.' . $module->module_index])) ? $temp_contained_in['.1.3.6.1.2.1.47.1.1.1.1.4.' . $module->module_index] : '';
$module->class = (!empty($temp_class['.1.3.6.1.2.1.47.1.1.1.1.5.' . $module->module_index])) ? $temp_class['.1.3.6.1.2.1.47.1.1.1.1.5.' . $module->module_index] : '';
$module->hardware_revision = (!empty($temp_hardware_revision['.1.3.6.1.2.1.47.1.1.1.1.8.' . $module->module_index])) ? $temp_hardware_revision['.1.3.6.1.2.1.47.1.1.1.1.8.' . $module->module_index] : '';
$module->firmware_revision = (!empty($temp_firmware_revision['.1.3.6.1.2.1.47.1.1.1.1.9.' . $module->module_index])) ? $temp_firmware_revision['.1.3.6.1.2.1.47.1.1.1.1.9.' . $module->module_index] : '';
$module->software_revision = (!empty($temp_software_revision['.1.3.6.1.2.1.47.1.1.1.1.10.' . $module->module_index])) ? $temp_software_revision['.1.3.6.1.2.1.47.1.1.1.1.10.' . $module->module_index] : '';
$module->serial = (!empty($temp_serial_number['.1.3.6.1.2.1.47.1.1.1.1.11.' . $module->module_index])) ? $temp_serial_number['.1.3.6.1.2.1.47.1.1.1.1.11.' . $module->module_index] : '';
$module->asset_ident = (!empty($temp_asset_id['.1.3.6.1.2.1.47.1.1.1.1.15.' . $module->module_index])) ? $temp_asset_id['.1.3.6.1.2.1.47.1.1.1.1.15.' . $module->module_index] : '';
$module->is_fru = (!empty($temp_is_fru['.1.3.6.1.2.1.47.1.1.1.1.16.' . $module->module_index])) ? $temp_is_fru['.1.3.6.1.2.1.47.1.1.1.1.16.' . $module->module_index] : '';

if ((string)$module->is_fru === '1') {
$module->is_fru = 'y';
Expand Down
5 changes: 3 additions & 2 deletions app/Helpers/snmp_model_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ function get_details_from_oid(string $oid = ''): object
case '1.3.6.1.4.1.141.1.1.29': $device->model = 'InfiniStream 2900'; $device->type = 'network device'; break;
case '1.3.6.1.4.1.141.1.1.2990': $device->model = 'InfiniStream 2990'; $device->type = 'network device'; break;
case '1.3.6.1.4.1.1411.102': $device->model = 'Juniper EX2500'; $device->type = 'switch'; break;
case '1.3.6.1.4.1.14179.1.1.4.3': $device->model = '4402 WLAN Controller'; $device->type = 'wap'; $device->os_group = 'Cisco'; $device->os_family = 'Cisco IOS'; break;
case '1.3.6.1.4.1.14179.1.1.4.3': $device->model = '4402 WLAN Controller'; $device->type = 'wac'; $device->os_group = 'Cisco'; $device->os_family = 'Cisco IOS'; break;
case '1.3.6.1.4.1.14179.1.1.4.4': $device->model = 'WS-SVC-WISM-1-K9 WLAN Controller'; $device->type = 'wac'; $device->os_group = 'Cisco'; $device->os_family = 'Cisco IOS'; break;
case '1.3.6.1.4.1.1429.2.1.6.1.0.2.0.1': $device->model = 'WebSTAR DPC2100 Series'; $device->type = 'cable modem'; break;
case '1.3.6.1.4.1.1429.2.2.6.2': $device->model = 'D98xx Program Receiver'; $device->type = 'satellite receiver'; break;
case '1.3.6.1.4.1.14501': $device->model = 'ISG'; $device->type = 'gateway'; break;
Expand Down Expand Up @@ -6172,7 +6173,7 @@ function get_details_from_oid(string $oid = ''): object
case '1.3.6.1.4.1.9.1.1066': $device->model = 'Cisco UC520'; $device->type = 'voip gateway'; break;
case '1.3.6.1.4.1.9.1.1067': $device->model = 'Cisco Catalyst 2975 GS48PSL'; $device->type = 'switch'; break;
case '1.3.6.1.4.1.9.1.1068': $device->model = 'Cisco Catalyst C2975 Stack'; $device->type = 'switch'; break;
case '1.3.6.1.4.1.9.1.1069': $device->model = 'Cisco 5500 Wlc'; $device->type = 'router'; break;
case '1.3.6.1.4.1.9.1.1069': $device->model = 'Cisco 5500 Wlc'; $device->type = 'wac'; break;
case '1.3.6.1.4.1.9.1.107': $device->model = 'Cisco LS 1010'; $device->type = 'switch'; break;
case '1.3.6.1.4.1.9.1.1070': $device->model = 'Cisco SR 520T1'; $device->type = 'router'; break;
case '1.3.6.1.4.1.9.1.1071': $device->model = 'Cisco Pwr C3900Poe'; break;
Expand Down

0 comments on commit baaed2d

Please sign in to comment.