Is it possible to use a variable in the Device Template? I've created a template for device type X with a number of sensors and would like to run Auto-Discovery with a Template and have it auto populate the hostname in the sensor description.
I see in the template file:
<create id="pingsensor" kind="ping" requires="ping" displayname="Ping Latency - device01name">
Can we replace the "device01name" with something like $hostname to have the description created automatically without user intervention?
Article Comments
Dear nativevelan
The auto-numbering can be turned off with a registry setting.
There is no placeholder for hostnames. I put that suggestion on our list where we collect user feedback.
Apr, 2015 - Permalink
Hello Mr. Seifert,
any updates on this ?
We'd like to use this feature also, for we are adding sensors with templates a lot. Having a possibility to use variables/placeholders like %devicename would make it a lot easier to add sensors.
The problem about sensors beeing added with a sensorname followed by an incremental number is, that when we are adding lots of sensors to a library using filters will cut off the devicetree leaving only the sensorname and it's not very helpful beeing in need to hover on that sensor to see which device the sensor belongs to...
is there any posibily to keep the device (name) in the library when using filters on sensortypes ?
thank you in advance
Oct, 2015 - Permalink
Dear Mr. Panknin
Please don't expect such placeholder in the foreseeable future. While we plan to improve the auto-discovery handling, no decisions about the depth and scope have been made yet.
Libraries in PRTG are a collection of sensors, their parent device is not visible from the library view.
Please allow me to elaborate on the auto-discovery. We don't want to add feature after feature and then end up with a very complex system. We are aware of certain limitations, but decided it is not the right way to just pile on some options and placeholders.
Oct, 2015 - Permalink
Dear Mr. Seifert,
Thank you for your response to this thread. I am saddened by Paessler's decision to exclude this feature request from auto-discovery, and strongly suggest you revisit with your colleagues. There is nothing more frustrating that trying to diagnose an issue with multiple alerts and be faced with PING1-PING23 in DOWN status then having to drill into each of those to determine what they are. We are not asking for different interactive functionality. We are simply asking for a better template system so that we can work with the system more easily.
May, 2016 - Permalink
According to this Thread it will great if we can use several placeholders like %ip, %hostname etc. If you discover an Subnet and use template Ping for example, you get more than 200 new Sensors named PINGXXX. You have to modify them manually.
Aug, 2016 - Permalink
For the time being, no placeholders are planned for device templates. It looks like an easy change, but it is not.
We are aware of the ongoing demand for this, but still feel that using a placeholder in templates might not be the best possible solution. Any solution to increase the visibility of the parent device for ping sensors implies changes deep in PRTG. We want to make sure to get the right one before we implementing something.
Aug, 2016 - Permalink
I too would like to see this feature in a future update. When adding groups of devices, we have to manually rename all of the sensors on every device. It is a very monotonous and tedious task, being able to automate or adjust the name of sensors on a device would be a boon to our productivity. While attempting to add this to our ping sensors, I added a new .odt file in the devicetemplates folder using the generic ping .odt file:
Original:
<create id="pingsensor" kind="ping" requires="ping" displayname="Ping">
I tried as a new .odt file with both these, but they still add with just the name Ping:
<create id="pingsensor" kind="ping" requires="ping" displayname="%name - Ping">
<create id="pingsensor" kind="ping" requires="ping" displayname="$name - Ping">
I also tried making a new ping_sensor.htm in the webroot/help folder, but that didn't work either
Dec, 2019 - Permalink
Dear ryankane1,
we get a lot of feedback for PRTG, including many good ideas, but we cannot implement everything. Doing one thing means to not do another thing at that time. Adding placeholders for device template does not have the priority to be implemented soon.
As alternative, you can use the PRTG API to read the host property and to set a new sensor name.
Dec, 2019 - Permalink
Has anyone ever thought about writing a customer sensor or API for ping with hostname in a 2nd channel?
Sep, 2020 - Permalink
Hello,
in PRTG, a sensor channel stores numbers. String usage is only possible with pre-defined lookup tables. A channel cannot be set to an arbitrary strings.
Sep, 2020 - Permalink
Hallo Herr. Seifert...
This would be a handy feature indeed...
If it could work like the SNMP labeld, when '[OID]' gets replaced with content
Like:
displayName="Uptime [1.3.6.1.2.1.1.5.0]"
gets replaced with
"Uptime hostname"
Along those same lines... Is there a way to specify that the ping sensors should be "Master for Parent" in a template...
Vilen Dank...
Oct, 2023 - Permalink
Hello JR,
for improved device templates, we have no short-term plans. A problem with things like placeholders is that the overall usage rate would be quite small, development tries to implement features with wider usage rate. I agree that for a more automated sensor management, naming flexibility would be useful in templates.
The first ping sensor created by auto-discovery should be automatically set as master for parent, even with no such explicit setting in the device template.
Oct, 2023 - Permalink
Did you find a solution for this kind of sensor-renaming? It seems that simple placeholders like %host for example aren't resolved if you seek for new sensors based on a modified template. Is there a supported, official way to replace the auto-incrementing counting on sensors of the same type with the hostnames of the devices they belong to?
Apr, 2015 - Permalink