Custom Sensor Types

Custom sensors allow a number of monitoring tasks that go far beyond the standard sensor set to be performed. Apart from parameterized versions of SNMP, packet sniffer and NetFlow sensors you can create your own sensors using WQL (WMI Query Language) and by compiling an EXE file, using any Windows software development tool.

PRTG supports four custom sensor types:

Custom EXE/DLL/BAT/CMD/VBS/PowerShell and WQL Sensors

You must create the sensor as a file and place it in a specific folder on the system running the PRTG probe (i.e. if you are using remote probes the files must be copied to the remote system!):

  • Place executables (.EXE, .DLL), batchfiles (.CMD, .BAT), VBS scripts (.VBS), or PowerShell scripts (.PS1) into the "PRTG Network Monitor\Custom Sensors\EXE" subfolder.
  • Place WQL scripts (.WQL) into the "PRTG Network Monitor\Custom Sensors\WMI WQL scripts" subfolder.

You will find a sample set of demo sensors in these folders, too. As soon as a file is placed into the folders mentioned above, you can create or edit your own Custom EXE sensor or WMI Custom sensor and select the new file from the list of files.

The probe will then execute the file on the probe system using the account configured for the "PRTG Probe Service" ("system" is the default). The local probe will run the file on the local PRTG Core Server system. But for remote probes, the file will actually run on the remote system. If your custom sensor code relies on other files (eg. DLLs, .NET framework, Windows PowerShell etc.) you must copy/install these files onto the probe machine manually!

See Interface Definition for Custom EXE Sensors for detailed documentation.

In the "parameter" field you can use the following placeholders:

  • "%host": Device IP/DNS.
  • "%device": Device name.
  • "%probe": Probe name.
  • "%name": Sensor name.

Please make sure you write the placeholders in quotes to ensure that they are working properly if their values contain blanks.

Notes

  • For PowerShell scripts, make sure that they may be executed by either signing the files or changing the security policy for Powershell.exe accordingly.
  • The API interface for custom EXE sensors is compatible to the custom EXE sensors provided by IPCheck Server Monitor 5.

Continue

Keywords: Sensor,WMI,EXE,BAT,CMD,PS1,Powershell,WQL