LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   [WORKAROUND] mrtg - network interface changed it's index. How to MANUALLY change it in MRTG? (https://www.linuxquestions.org/questions/linux-networking-3/%5Bworkaround%5D-mrtg-network-interface-changed-its-index-how-to-manually-change-it-in-mrtg-4175727975/)

czezz 08-12-2023 07:57 AM

[WORKAROUND] mrtg - network interface changed it's index. How to MANUALLY change it in MRTG?
 
Network interface on my router has (somehow) automatically changed ifIndex from 11 to 19

Code:

snmpwalk -v2c -c public 192.168.1.1 ifIndex
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifIndex.2 = INTEGER: 2
IF-MIB::ifIndex.3 = INTEGER: 3
IF-MIB::ifIndex.4 = INTEGER: 4
IF-MIB::ifIndex.5 = INTEGER: 5
IF-MIB::ifIndex.6 = INTEGER: 6
IF-MIB::ifIndex.7 = INTEGER: 7
IF-MIB::ifIndex.9 = INTEGER: 9
IF-MIB::ifIndex.10 = INTEGER: 10
IF-MIB::ifIndex.19 = INTEGER: 19 <-- that was 11 when I generated mrtg.chg on April 2023

On the mrtg.log I can see it happened on: 2023-08-10 11:55:06
Code:

2023-08-10 11:45:05 -- Started mrtg with config '/etc/mrtg.cfg'
2023-08-10 11:50:04 -- Started mrtg with config '/etc/mrtg.cfg'
2023-08-10 11:55:05 -- Started mrtg with config '/etc/mrtg.cfg'
2023-08-10 11:55:06 -- 2023-08-10 11:55:06: WARNING: Can not determine ifNumber for public@192.168.1.1:::::2        ref: 'Name'        key: 'wlan0'
2023-08-10 11:55:08 -- 2023-08-10 11:55:06: ERROR: Target[192.168.1.1_wlan0][_IN_] ' $target->[6]{$mode} ' did not eval into defined data
2023-08-10 11:55:08 -- 2023-08-10 11:55:06: ERROR: Target[192.168.1.1_wlan0][_OUT_] ' $target->[6]{$mode} ' did not eval into defined data
2023-08-10 12:00:05 -- Started mrtg with config '/etc/mrtg.cfg'
2023-08-10 12:00:06 -- 2023-08-10 12:00:06: WARNING: Can not determine ifNumber for public@192.168.1.1:::::2        ref: 'Name'        key: 'wlan0'
2023-08-10 12:00:07 -- 2023-08-10 12:00:06: ERROR: Target[192.168.1.1_wlan0][_IN_] ' $target->[6]{$mode} ' did not eval into defined data
2023-08-10 12:00:07 -- 2023-08-10 12:00:06: ERROR: Target[192.168.1.1_wlan0][_OUT_] ' $target->[6]{$mode} ' did not eval into defined data

In mrtg.cfg I can see that previously this interface index was: 11
Code:

...
### Interface 11 >> Descr: 'wlan0' | Name: 'wlan0' | Ip: 'No Ip' | Eth: 'No Ethernet Id' ###
...

Question: how can I tell MRTG to look now on ifIndex = 19 instead of 11?

The easiest would be to re-generate mrtg.cfg with cfgmaker.
But there MUST be way to manually change that (and it is nowhere in mrtg.cfg)

czezz 08-17-2023 04:22 PM

I didnt find the way to change the index manually.
Not even by re-running cfgmaker.

The WA was to restart router and somehow it reverted the ifIndex back to 11.


All times are GMT -5. The time now is 05:59 PM.