PaperCutSoftware / PRTGTemplateGenerator

PRTG Template Generator for PaperCut health API
MIT License
5 stars 0 forks source link

Template adds sensors to wrong devices #6

Closed lucianolingnau closed 5 years ago

lucianolingnau commented 5 years ago

Hi There. I'm with Paessler's Tech Support Team.

A while back I had reported issue #3 but I made a small mistake in the proposed solution. Actually, to fix the template, what needs to be adjusted is the template ID, not the priority. On line 2 in the odt files, it needs to be id="custom". In other words, it needs to look for example like this:

<?xml version='1.0' encoding='utf-8'?>
<devicetemplate adddevicename="PaperCut Printers" id="custom" name="PaperCut Printers" priority="1">
    <check id="ping" meta="ping" />

Whenever the ID is not "custom", it results on the template being applied/used to discover any device (which leads to the papercut sensors being created when discovery switches or any other kind of device. We've noticed the previously suggested "fix" from #3 didn't work because we had other customers report the issue.

Sorry for the confusion (and misleading solution proposed in #3 )

alecthegeek commented 5 years ago

Thanks for this @lucianolingnau -- Should the priority go back to 40 as well?

lucianolingnau commented 5 years ago

Hey @alecthegeek - Thanks for the swift reply. The priority is only relevant in PRTG's templates when multiple templates that create the very same sensor (same create ID) are used. Since this is a custom template and the create ID's are unique, it doesn't really make much a difference. When someone uses PRTG to create a custom template, the priority is 1 by default, so I wouldn't change it back to 40:

<?xml version="1.0" encoding="UTF-8"?>
  <devicetemplate id="custom" name="Custom Test Template" priority="1">
    <check id="ping" meta="ping"/>
    <check id="wmi" meta="wmi" requires="ping"/>