I have had PRTG installed for a number of years and have been upgrading with each new version. All of the switchports that were created a while back look like this "(006) Fa0/6 Fa0/6" or if they have a custom description "(007) Fa0/7 Server123". In the SNMP compatibility options, I have the Port name template set as ([port]) [ifname] [ifalias].

Now, when I run an auto-discovery, it will try to create new entries for all of the ports without a custom description, like "(006) Fa0/6 FastEthernet0/6". It doesn't recognize the port "(006) Fa0/6 Fa0/6" as being the same one, even with Port Name Update set to "Automatic sensor name update".

Any ideas of what i can change so that it doesn't try to create new sensors for all of the existing sensors when I run auto-discover?


Article Comments

Hello,

please check the "Interface Number"-Field in the settings of an old and a new (duplicate) sensor for the same interface. Do they show something different?

best regards.


Jul, 2012 - Permalink

This example is from a different switch, but old (original) port discovery has "10101" for the interface number and the newly discovered port has "10101:_".


Jul, 2012 - Permalink

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.


Jul, 2012 - Permalink