Hello,
if you look at the "Settings" of one "old" and one "new (duplicate)" sensor for the same interface you will likely note a slight difference in the "Interface Number" field, which is a :_
The _ is part of a fix introduced with version 9.1.6, to be able to differ in cases where the ifAlias was empty (like in this case) against when there was no ifAlias defined at all for an interface. For interfaces with empty ifAlias PRTG now internally uses the _ to mark this. This was implemented to be able to detect interface name changes from "empty" to "something" in the ifAlias.
The problem now here is, that this can't be changed in another way I'm afraid. It would also have occurred with the older version of PRTG as it was not able to handle an empty ifAlias correctly. However, to go forward with this, the only way also for future discoveries to avoid duplicate sensors again, would sadly be to using/keeping the new sensors, which have the _, and then to delete the old sensors.
The other "possible solution" would be:
use a gawk-script to replace the IDs http://gnuwin32.sourceforge.net/packages/gawk.htm
gawk -f PRTGFix.awk "PRTG Configuration.dat" > "PRTG Configuration_Fixed.dat"
Contents of PRTGFix.awk
=====================================
BEGIN {
# print "Start program" > log.txt
# Discoveryfound =0: Not found
# Discoveryfound =1: Found, not yet fixed
# Discoveryfound =2: Found and fixed
discoveryfound=0
interfacefound=0 } {
if ( discoveryfound >= 1 ) {
if (discoveryfound == 1 ) {
if ($0 ~ /snmptraffic[0-9]+/ && $0 !~ /:/ ) {
print $0":_"
discoveryfound = 2
interfacefound = 0
}
else { print $0 }
}
else {
if (interfacefound == 1 ) {
print $0":_"
discoveryfound = 0
interfacefound = 0
}
else { print $0 }
}
if ($0 ~ /<interfacenumber>/ ) { interfacefound = 1 }
}
else { print $0 }
if ($0 ~ /<discoveryid>/ ) {
discoveryfound=1
}
}
=====================================
Beware that his will fix _all_ SNMP traffic sensors (Switch/Router/Servers etc), so the SNMP traffic sensors on Servers (which don't have the IfAlias property) will error (SNMP Error no such name), removing the :_ will return these to a working state.
Add comment