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

Help with custom XMLEXE sensor using Perl script, please

Votes:

0

A PRTG user shared a Perl script on GitHub that pulls operational statistics from a Cyber Power UPS and makes the data available to PRTG in XML format. When I run the script from the command prompt it executes as expected and returns XML formatted for PRTG. However, when I try to use the script with PRTG the sensor reports that no data was returned. I enabled the "Write EXE result to disk" setting on the sensor and find that the result file is empty (zero bytes). I looked for a KB article on using Perl with PRTG but didn't find anything.

As a test I changed the sensor to execute perl.exe and in the PRTG sensor parameters field entered '-v'. That * should * execute the perl.exe interpreter and request the installed Perl version information. I realize that this will result in PRTG complaining that the returned data is not in the proper format but it should also allow me to see the version information in the PRTG log file. However, the log file remains empty even after making this change.

Based on those observations it appears that Perl is either not executing (not sure how to test) or the output from Perl that normally goes to the console is not being picked up by PRGT.

Help, what can I do next to continue troubleshooting this issue?

Thank you...

custom-sensor perl prtg xmlexe

Created on Aug 13, 2017 1:33:00 PM



1 Reply

Votes:

0

Seems the fix was a simple one. Rather than having PRTG start perl.exe with the .pl script specified as a parameter I created a 2 line batch file. That's it.

@ECHO OFF c:\perl\bin\perl.exe "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\prtg-cp-ups.pl"

Created on Aug 14, 2017 2:39:19 PM




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.