Adjusting Network Switch / Router wizard
Posted: Mon Sep 14, 2015 1:04 pm
I have been working on adjusting the switch wizard so that it uses ifAlias instead of ifDescr. So when we run the wizard, we can use the Alias field when we choose to use Port Name. I've found the lines where this is done, but it doesn't seem to work. My understanding is that cfgmaker creates a temp cfg file and the wizard populates this. However, after making the changes below, cfgmaker is still using ifDescr instead of ifAlias.
Here are my changes:
Edit the file /usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php and in switch_configwizard_get_cfgmaker_cmd I added extra argument to use ifAlias.
I checked the script and it grabs description from "/MRTG_INT_DESCR=".
But checking the temp mrtg cfg file looks like it is still using the ifdesrc value. For example:
"GigabitEthernet1/1"
If you scroll down a bit, the <description> part has the alias as part of the description.
<td>GigabitEthernet1/1 HPC OBA1 </td>
This means that at some point, it grabbed the alias. Perhaps I am not looking at the right spot and looking for some guidance to see how we can use ifAlias instead of fiDescr for port names.
Here's the data to help:
snmpwalk
IF-MIB::ifDescr.1 = STRING: GigabitEthernet1/1
IF-MIB::ifAlias.1 = STRING: HPC OBA1
Here are my changes:
Edit the file /usr/local/nagiosxi/html/includes/configwizards/switch/switch.inc.php and in switch_configwizard_get_cfgmaker_cmd I added extra argument to use ifAlias.
Code: Select all
$args[] = "--ifdesc=alias";But checking the temp mrtg cfg file looks like it is still using the ifdesrc value. For example:
"GigabitEthernet1/1"
If you scroll down a bit, the <description> part has the alias as part of the description.
<td>GigabitEthernet1/1 HPC OBA1 </td>
This means that at some point, it grabbed the alias. Perhaps I am not looking at the right spot and looking for some guidance to see how we can use ifAlias instead of fiDescr for port names.
Here's the data to help:
snmpwalk
IF-MIB::ifDescr.1 = STRING: GigabitEthernet1/1
IF-MIB::ifAlias.1 = STRING: HPC OBA1