What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Network adapter template

Votes:

0

I want to monitor Hyper-V host network adapters. Auto discovery find many network adapters. I tried delete needless network adapter sensors and create device template. When I make device discovery whit this template, it find all network adapters again. Any help, how edit this template?

auto-discovery customization device-template discovery interface network-monitor prtg template traffic

Created on Jul 26, 2016 9:59:40 AM

Last change on Aug 14, 2019 5:46:38 AM by  Luciano Lingnau [Paessler]



Best Answer

Accepted Answer

Votes:

1

Disclaimer: This is Not an Officially Supported Feature

Thank you for the clarification.
I've checked with development and there is an unofficial way to provide a list (similar to a response file) with one entry per interface that you want to have a sensor for, to be used with Auto-Discovery. Please check the following device template for reference:

<?xml version="1.0" encoding="UTF-8"?>
  <devicetemplate id="custom" name="Custom Traffic Createdata" priority="1">
    <check id="ping" meta="ping"/>
    <check id="snmp" meta="snmp" requires="ping"/>
    <create id="snmptraffic_vEthernet" kind="snmptraffic" requires="snmp" displayname="Traffic vEthernet">
      <createdata>
		<interfacenumber>901:vEthernet</interfacenumber>
      </createdata>
    </create>
	<create id="snmptraffic_vSwitch" kind="snmptraffic" requires="snmp" displayname="Traffic vSwitch">
      <createdata>
		<interfacenumber>902:vSwitch</interfacenumber>
      </createdata>
    </create>
  </devicetemplate>

The device template above will always only add two SNMP Traffic Sensors, associated with two distict interfaces named vEthernet and vSwitch. This is only practical if you have hundreds of servers which have interfaces with exactly the same name.

Usage Notes

  • The index (901, 902) should be an interface name that doesn't exist. That causes the sensor's "Interface Index Tracking" logic to kick-in and identify the correct interface index after the first scan.
  • You'll have to use multiple <create> statements, each will contain a different <createdata> with a DIFFERENT id.
  • The <interfacenumber> must contain the name of the interface that the sensor will monitor(exactly as it shows up in the sensor's settings for an existing deployed sensor)
  • This example is designed to work with the Use ifAlias Port Identification option (SNMP Compatibility Options). Adjust as necessary depending on your use case.
  • The sensors within the defined create will ALWAYS be deployed, regardless of there being an interface with the corresponding name.
  • The property provided in the </interfacenumber> should match the defined identification property from the SNMP Compatibility Options.
  • Instead of relying on the static displayname property it is also possible to enable the Automatic sensor name update if name changes in device in the device/group/probe/root settings and have PRTG automatically rename the sensors according to the defined name template.

Related

As of recent recent PRTG versions it is possible to have a "custom meta-scan", which would allow the creation of custom rules within a metascan for interfaces:

Now that you understand how this works, it's time to go one step further and automate this. Please refer to:

Support-related notes

  • Editing templates manually is not officially supported, we can't guarantee this will always work as expected
  • We can't provide Technical Support for this features
  • This feature's behavior may change without prior notice.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Aug 2, 2016 1:35:47 PM by  Luciano Lingnau [Paessler]

Last change on Aug 30, 2019 5:19:34 AM by  Luciano Lingnau [Paessler]



20 Replies

Votes:

0

Hello and thank you for your KB-Post.

The issue with Network Adapters is that most systems will have many, the same applies to hard disks. As PRTG doesn't know "which one you want to monitor". During an auto-discovery PRTG will query the target host for a list of existing adapters/interfaces. It will then deploy one sensor per active/existing interface. This behavior cannot be changed I'm afraid.

If you intend to perform further auto-discoveries on this device, pause the unwanted sensors instead of deleting them. They will not be deployed by further discoveries again, will have a minimal performance impact and will not count toward the total number of sensors used from the license.

This behavior is described here:


Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jul 26, 2016 2:00:44 PM by  Luciano Lingnau [Paessler]

Last change on Aug 2, 2016 1:47:11 PM by  Luciano Lingnau [Paessler]



Votes:

0

Hello,

ok, thank You. Its any other option for automatic copy existing sensors (by its id) to other devices with stored position for first deploy?

Have a nice day Marek

Created on Jul 27, 2016 1:30:39 PM



Votes:

0

I have this code from other template <create id="snmptraffic13:Ethernet 213:Ethernet 213:Ethernet 213:Ethernet 213:Ethernet 2"> which add only right network adapters, but i dont know section after snmptraffic for other network interfaces.

M.

Created on Jul 27, 2016 1:33:46 PM



Accepted Answer

Votes:

1

Disclaimer: This is Not an Officially Supported Feature

Thank you for the clarification.
I've checked with development and there is an unofficial way to provide a list (similar to a response file) with one entry per interface that you want to have a sensor for, to be used with Auto-Discovery. Please check the following device template for reference:

<?xml version="1.0" encoding="UTF-8"?>
  <devicetemplate id="custom" name="Custom Traffic Createdata" priority="1">
    <check id="ping" meta="ping"/>
    <check id="snmp" meta="snmp" requires="ping"/>
    <create id="snmptraffic_vEthernet" kind="snmptraffic" requires="snmp" displayname="Traffic vEthernet">
      <createdata>
		<interfacenumber>901:vEthernet</interfacenumber>
      </createdata>
    </create>
	<create id="snmptraffic_vSwitch" kind="snmptraffic" requires="snmp" displayname="Traffic vSwitch">
      <createdata>
		<interfacenumber>902:vSwitch</interfacenumber>
      </createdata>
    </create>
  </devicetemplate>

The device template above will always only add two SNMP Traffic Sensors, associated with two distict interfaces named vEthernet and vSwitch. This is only practical if you have hundreds of servers which have interfaces with exactly the same name.

Usage Notes

  • The index (901, 902) should be an interface name that doesn't exist. That causes the sensor's "Interface Index Tracking" logic to kick-in and identify the correct interface index after the first scan.
  • You'll have to use multiple <create> statements, each will contain a different <createdata> with a DIFFERENT id.
  • The <interfacenumber> must contain the name of the interface that the sensor will monitor(exactly as it shows up in the sensor's settings for an existing deployed sensor)
  • This example is designed to work with the Use ifAlias Port Identification option (SNMP Compatibility Options). Adjust as necessary depending on your use case.
  • The sensors within the defined create will ALWAYS be deployed, regardless of there being an interface with the corresponding name.
  • The property provided in the </interfacenumber> should match the defined identification property from the SNMP Compatibility Options.
  • Instead of relying on the static displayname property it is also possible to enable the Automatic sensor name update if name changes in device in the device/group/probe/root settings and have PRTG automatically rename the sensors according to the defined name template.

Related

As of recent recent PRTG versions it is possible to have a "custom meta-scan", which would allow the creation of custom rules within a metascan for interfaces:

Now that you understand how this works, it's time to go one step further and automate this. Please refer to:

Support-related notes

  • Editing templates manually is not officially supported, we can't guarantee this will always work as expected
  • We can't provide Technical Support for this features
  • This feature's behavior may change without prior notice.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Aug 2, 2016 1:35:47 PM by  Luciano Lingnau [Paessler]

Last change on Aug 30, 2019 5:19:34 AM by  Luciano Lingnau [Paessler]



Votes:

0

Disclaimer: This is Not an Officially Supported Feature

Remarks

  • Requires snmpwalk.exe from net-snmp to work.
  • This example is designed to work with the Use ifAlias Port Identification option (SNMP Compatibility Options). Adjust as necessary depending on your use case.
  • In recent PRTG versions (18.x.y) it appears that the probe has issues running the powershell script file, which results in ERROR: 106 during the discovery. Update: It appears as this can be mitigated/resolved with the following workaround

As of PRTG version 17.1.33 it should be possible to use generic meta-scans with the SNMP Traffic sensor. This effectively allows one to deploy only the sensors for specific interfaces. Here's the relevant data for an example:

\devicetemplates\Custom Traffic CustomMeta.odt
<?xml version="1.0" encoding="UTF-8"?>
  <devicetemplate id="custom" name="Custom Traffic CustomMeta" priority="1">
    <check id="ping" meta="ping"/>
    <check id="snmp" meta="snmp" requires="ping"/>
    <create id="snmptraffic" kind="snmptraffic" meta="customexexmlgeneric" requires="snmp" displayname="SNMP Traffic">
    <metadata>
      <exefile>snmp_traffic_metascan.ps1</exefile>
	  <exeparams>-deviceaddress '%host' -filterstring '*(paessler.de)'</exeparams>
    </metadata>
    </create>
  </devicetemplate>

In this file you can define what sort of filter will be used (this example is based on the interface name). -filterstring '*(paessler.de)' defines that only interfaces who's name ends in (paessler.de).

snmp_traffic_metascan.ps1
param(
    $deviceaddress = "localhost",
	$filterstring = "*Ethernet*"
    )

# Store the output in the variable $data
$data = snmpwalk.exe -v 2c -c "public" -"OQ" $deviceaddress .1.3.6.1.2.1.31.1.1.1.18
$interfaceList = @()

#Add results to object
FOREACH ($line in $data)
{
    
    # Remove the whitespace at the beginning on the line and Split on whitespaces characteres
    $line = $line -replace '^([^.]*).', ''
    $line = $line -split '\s=\s'
    
    # Define Properties
    $properties = @{
        if_index = $line[0]
        if_name = $line[1]
    }
    
    # Add to object
    $interface = New-Object -TypeName PSObject -Property $properties
    $interfaceList += $interface
}

Write-Output "<?xml version=`"1.0`" encoding=`"UTF-8`"?>"
Write-Output "<prtg>"

foreach ($entry in $interfaceList| Where-Object {$_.if_name -like $filterstring}){
    
    #Where the magic happens
    Write-Output "<item>"
	Write-Output "<name>($($entry.if_index)) $($entry.if_name) Traffic</name>"
    Write-Output "<interfacenumber>$($entry.if_index):$($entry.if_name)</interfacenumber>"
    Write-Output "</item>"

}

Write-Output "</prtg>"

This file defines the actual processing and rules, it's output determinates which interfaces will be created/deployed.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jul 21, 2017 1:57:41 PM by  Luciano Lingnau [Paessler]

Last change on Aug 28, 2018 6:13:20 AM by  Luciano Lingnau [Paessler]



Votes:

1

Dear Support
I have done exactly what is mentioned here , yet an auto discovery with a custom template is not giving any result. This is a major and critical issue for us. Our case:
We have 86 Juniper MX routers in our network, and a regular autodiscovery would yield +2000 SNMP traffic sensor per device since the integrated "PortScan" Meta Scan is inculing all VLANs under each physical interface as separate entries:

for example:

ae1 ==>PHYSICAL

>LOGIAL

ae1.1369
ae1.1593
ae1.1817
ae1.2261
ae1.2262
ae1.2392
ae1.2541
ae1.2668
ae1.3261
ae1.3262
ae1.32767
ae1.3392
ae1.3768
ae1.3820
ae1.3821
ae1.3822
ae1.3823
ae1.4070
ae1.487 ... ETC

We are not interested to view all interfaces with "." suffix.

Imagine integrating these 86 routers, we would end up with 172000 SNMP traffic sensor which is something that would kill PRTG and there isn't any PRTG setup that can withstand such number.

We are upgrading our license now from XL1 to XL5, yet this limitation is killing the use of your system.

All other competitor tools have the option to add a rule for any Autodiscovery on Device/iNTERFACE levels.

Please support us on this since your reply would be the final decision for us if we should cancel PRTG upgrade and move for another Tool.

Appreciating your reply

Created on May 16, 2018 6:46:00 AM

Last change on May 16, 2018 11:50:57 AM by  Luciano Lingnau [Paessler]



Votes:

0

Following up with Ehab via E-mail. We'll have to have a much closer look at the data and behavior to find out what is going on.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on May 17, 2018 11:26:20 AM by  Luciano Lingnau [Paessler]



Votes:

0

Dear Support after implementing all modifications, it is working but NOT AT ALL TIMES.

We 're getting a random ERROR 106 when autodiscovery is run. So some devices are discovered successfully, others are not. and as you have stated, :

"In recent PRTG versions (18.x.y) it appears that the probe has issues running the powershell script file, which results in ERROR: 106 during the discovery."

We already have the latest PRTG (18.x.y) which is causing a big trouble for us. Any news for the ERROR 106 RANDOM issue.

Please support as we have lost control over this issue.

Appreciate the great efforts...

Ehab J. Haddad Zain SA

Created on Aug 4, 2018 11:24:03 AM



Votes:

0

We've looked further into this with Ehab.

We managed to resolve the issue (which was a premature timeout) by adjusting the Metascan Timeout of the Probe. This is necessary when the script takes longer than usual to run (for instance, if the device replies a bit slower, or powershell takes a bit longer than usual to run). This appears to have eliminated all ERROR: 106 occurrences with this script/workaround.

If you're experiencing similar issues where the script doesn't work reliably and frequently results in the following log:

2018-08-07 14:32:11.00 Template Assigned; Device ID: 2128; Name: Custom Traffic CustomMeta2
2018-08-07 14:32:21.21 Template Create Meta Request; Device ID: 2128; Create ID: snmptraffic; ERROR: 106ErrorMessage: Timeout (5000 ms)
2018-08-07 14:32:27.12 Autodiscovery Finished: Device ID: 2128; Sensor(s): 0; Templates: Custom Traffic CustomMeta2

Save the content of the box below as "key.reg" and import (double-click) the file on the probe where the discovery is being run:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe]
"MetaScanTimeout"=dword:0000003c

This effectively increases the timeout of any metascans to 60 seconds.

Best Regards,
Luciano Lingnau [Paessler Support]

Created on Aug 28, 2018 6:10:17 AM by  Luciano Lingnau [Paessler]



Votes:

0

Is there a way to do the same thing with Disk IO Sensors? https://www.paessler.com/manuals/prtg/windows_physical_disk_io_sensor

We'd like to create a template, where only the "_Total" Sensor is created.

by default, any template including the Disk IO Sensor will always create a sensor for every disk on the system, but we have systems that often mount disks temporarly and this happens during auto discover, so it creates a sensor for it. after the disk is unmounted, the sensor returns an alarm for the missing disk. as it's not always the same disk, even with pausing the sensors, it will create new ones.

kind regards Chris

Created on Feb 5, 2019 3:34:37 PM



Votes:

0

Hello there,

It's not possible to edit a template for the Windows Physical Disk Sensor that way. Since the Sensor itself works a different way.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Feb 8, 2019 1:54:08 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Hello,

Just to be sure: is the script snmp_traffic_metascan and the snmpwalk necessarily run from the local probe? Or are they from the remote probe on which the device is being created?

Best regards,

Matthieu

Created on Nov 21, 2019 5:23:25 PM



Votes:

0

Hi Matthieu,

You can run this for every device. Please note that this is a device template, you can use for auto discoveries. The default directory for those is C:\Program Files (x86)\PRTG Network Monitor\devicetemplates.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Nov 22, 2019 1:18:12 PM by  Birk Guttmann [Paessler Support]

Last change on Apr 15, 2020 3:09:36 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Dear Support,

I have done what is written here , yet an auto discovery with a custom template is not giving any result.
I want to Discover only Switch Interfaces with an specific Description.
My Powershell script does work, if i testing it with Powershell, but it comes no Results back to the PRTG.

What directory have i to use for the device Template and which one for the PS Script? Where can i found the logs of the discovery jobs?

Kind Regards Markus

Created on Apr 15, 2020 8:55:38 AM

Last change on Apr 15, 2020 8:55:38 AM



Votes:

0

Dear support

I only want to add bandwith sensors on physical interface , not on interface vlan like ae1.xxx. Can i make auto-discovery with template ? Please help me.

Created on Aug 12, 2020 9:55:43 AM



Votes:

0

Check out the following script for this :)

Created on Aug 13, 2020 7:33:26 AM by  Stephan Linke [Paessler Support]



Votes:

0

Thank for your answer, but i user PRTG version 14. Is there another way?

Created on Aug 14, 2020 2:19:32 AM



Votes:

0

I'm afraid not, as it uses PowerShell for the placeholder functionality. If you're using the free version of PRTG, you can still upgrade to the latest version free of charge :)

Created on Aug 14, 2020 6:20:24 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hello!

Is there a way, to enable the error statistics in the create data section? And maybe also to set "don't show error, when state is disabled" ? This World be very helfen.

<create id="snmptraffic_vEthernet" kind="snmptraffic" requires="snmp" displayname="Traffic vEthernet">
<createdata>
<interfacenumber>901:vEthernet</interfacenumber>
... MORE CREATE DATA ?
</createdata> 
</create>

Created on Feb 24, 2021 5:14:32 PM

Last change on Feb 24, 2021 7:40:29 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Hello,

Thank you for your message.

Regarding what you would like to achieve, I invite you to configure the SNMP Traffic sensors accordingly (enable the options you want in their settings) and then create a device template anew.

Then, when you execute an auto-discovery, the SNMP Traffics sensors created should display the Error In / Out channels and use the option Ignore all "disconnected" states (which by the way is the option used by default).

Regards.

Created on Feb 25, 2021 9:08:56 AM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.