New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How can I use meta-scans for custom EXE/Script sensors?

Votes:

0

Your Vote:

Up

Down

I would like to use meta-scans when adding custom EXE/Script sensors via auto-discovery. Is there an option to include such scans with device templates?

auto-discovery custom-exe custom-script-exe custom-sensor device-template exe-script-sensor meta-scan prtg

Created on Jan 27, 2016 3:39:20 PM by  Gerald Schoch [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 16.1.22 or later

Using Meta-Scan Functionality for EXE/Script Advanced Sensors

As of PRTG version 16.1.22 it is possible to create custom EXE/Script Advanced sensors that use a meta-scan when you add the sensor via Auto-Discovery.

To apply this meta-scan functionality you can write a custom sensor using an executable file that returns an XML list. Your sensor can then use the data from the XML to create one sensor for each entry in this list. The data from the XML will be added to the according sensor.

What Do You Need?

There are a few things you have provide to add your custom EXE/Script Advanced sensor with meta-scan.

  • You need your custom sensor in executable file format, for example, mysensor.exe (you can also use another supported executable file, for example, PS1 or BAT).
  • You need a parameter that triggers the meta-scan, for example, -metascan
  • When you run mysensor.exe –metascan it has to write XML output to the console in the following format: <prtg> <item> <name>Sensor name</name> <exefile>myfile.exe</exefile> <params>-run 1</params> </item> <item> <name>Sensor name 2</name> <exefile>myfile.exe</exefile> <params>-run 2</params> </item> [...] </prtg>
  • You need a device template that adds your sensor using the meta-scan. The template has to look like this: <?xml version="1.0" encoding="UTF-8"?> <devicetemplate id="customexexml" name="my custom exe xml" priority="1"> <check id="ping" meta="ping"/> <create id="<my meta id>" kind="exexml" meta="customexexmlscan" requires="ping"> <metadata> <exefile> mysensor.exe </exefile> <exeparams> -metascan </exeparams> </metadata> <createdata/> </create> </devicetemplate>
  • Replace <my meta id> with a unique ID.
  • mysensor.exe is your custom sensor that returns an XML which is used to create the actual sensors.
  • If the meta-scan needs credentials, you can use the same placeholders for <exeparams> as you can use in the parameters field in the EXE/Script Advanced sensor settings.
  • You can use the same exe with different parameters or even different exe files for the meta-scan and the sensor itself.

You can now run an Auto-Discovery using this template (my custom exe xml in this example). This will add the sensors according to the XML output automatically. In this example, the added sensors Sensor name and Sensor name 2 will execute myfile.exe with the parameters -run 1 and -run 2.

Created on Jan 27, 2016 3:46:13 PM by  Gerald Schoch [Paessler Support]

Last change on Aug 19, 2016 11:56:37 AM by  Gerald Schoch [Paessler Support]



Please log in or register to enter your reply.


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.