Example. PRTG executes the file on the local PRTG core server system using the account configured for the PRTG core server service (system is default). Generates a
XML block for use with a PRTG Network Monitor Custom Sensor.DESCRIPTION Prtg serves as the root node for all responses given under all EXE/Script Advanced sensors in PRTG, generating the
XML. Ensure that you’ve got it up and running and graphing data, and that you can reach the PRTG web GUI using your web browser. Stephan Linke [Paessler Support]. If you have many sensors that run concurrently, you can configure different mutex names so that they do not hinder each other. If you want to monitor different performance counters with the same name, add one sensor for each counter. Custom sensors for PRTG are very simple: a script or a program gathers some data and returns it back to PRTG in a structured XML format. Select an executable file from the list. save. Only scripts from a trusted author can be executed. This wraps the PRTG REST API into easy to use and understand PowerShell, which is very effective for my team’s ability to use and re-use things written with it. On your sensor settings page, there is an option titled “EXE Result” that is by default set to “Discard EXE result”.
The Sensor is indeed still in beta and likely not make it into a non-beta state, as we're working on a successor that will be easier to handle. report. The parameters are listed there. To show the expected values and sensor status, your files must return the expected JSON format. Then I created a new EXE/Script Advanced Sensor and selected xyz.ps1 as my Script. For the installation of PowerShell scripts in PRTG, follow these steps: The execution policy configured on a host specifies which scripts can be executed on the Windows host. Make sure that it has .ps1 as extension. 20
Wondering how you can add a sensor in your PRTG installation? Created on May 29, 2019 1:56:10 AM by \Custom Sensors\EXE\, \Custom Sensors\EXEXML\. Stephan Linke [Paessler Support], Last change on Dec 4, 2020 2:05:53 PM by Channels are grouped in a sensor. Downloaded scripts have to be signed prior to execution. answering questions! The only option on this page that cannot be changed after adding the sensor is the EXE/Script field – which is where you select the script you saved in step three. But a Disk Used sensor would allow me to easily graph how fast our data is growing so that when I ask management for money for more storage I have a pretty graph to show why ;) Anyways, I have with (with some help from r/powershell ) a script that runs the calculations and spits out the data used in GB. There are a few settings that you cannot save into a device template, so PRTG sets them to default, for example: Good resources to find custom sensors that other users and we from Paessler share are the PRTG Sensor Hub and our Knowledge Base. , Error reading response: XML Parser mismatch: Wanted <<<>, got
, C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors), all signed with Authenticode certificates, Method One: locate the”Windows PowerShell (x86)” shortcut in the start menu and set the execution policy there (. What am I missing? There are several available settings for this: By default, the execution policy is set to Restricted. Description. As we are creating a custom sensor with a script, we ourselves can define what data is contained in the channel and how it is used. You may also get the error message, Keep in mind that newer operating systems will usually run a newer PowerShell version, your cmdlets may be missing parameters, or your variables may not be correctly called within text (, Open the script and search for something like, If the output looks like XML, copy the script to the. ... Windows Linux MacOS Prtg Sensor Device Group Probe Channel Notification Action Trigger Remove Pause Resume Check Acknowledge PowerShell Setting Property. No scripts can directly be executed, only within an interactive session. This “market capitalisation” sensor uses PRTG’s REST Custom Sensor to pull data from the API of a publicly accessible share price site, in this case IEX, with no credentials needed. I can log into the server and run the script from within a PowerShell process myself with no problems. PRTG Manual: EXE/Script Sensor. The question is how to correctly use it. Configure the execution policy of the PRTG server. You can omit the parameters if you enter them in the correct order. You can change this to “Write EXE result to disk (Filename: “Result of Sensor [ID].txt”)” and then go watch. There is an Advanced HTTP sensor that I am hoping will fit the bill. For the installation of PowerShell scripts in PRTG, follow these steps: 1. There are no restrictions, all codes will be executed. Method Two: run this command to open a powershell prompt, and then set the execution policy using that prompt: The script doesn’t necessarily execute as you – it executes using either the scope of the PRTG service (be that on the probe or the core server) which you can of course change using the Windows Services tool, or as the user defined in the credentials for the device. Some things to keep in mind when you’re troubleshooting a new sensor: %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe, c:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\,
KNOWLEDGE BASE. Kind regards, Second channel
The other option is to write a script or EXE which outputs the format you need and the values you need and that could work with a custom sensor. Indeed, there is also a script to monitor user accounts within Active Directory using PRTG. Owners. PRTG always executes all powershell scripts in 32-bit powershell. New comments cannot be posted and votes cannot be cast. There are only two options: If you already know the output type, simply copy the script to the corresponding directory. Double-check that the downloaded script file is not. The sensor displayed incorrect results (0) or no values after migrating it to a new or different server or Windows version. Please log in or register to enter your reply. Sort by. First channel
The following custom sensor is available by default: sensor_example.py; This Python example script only returns fixed values in two channels to demonstrate the usage. Also, if any of you have any custom PRTG sensors using powershell that you have created, I would love to see them, and see what other powershell based tips and tricks people are using in their PRTG based monitoring environments. Note that these last options only set defaults when the sensor is first added – if your sensor doesn’t report them correctly on the first scan, they won’t be read on subsequent scans (such as when you update the sensor’s script file). Ok great news, if you use PRTG to monitor your machines, then you can still use PowerShell! The execution policy configured on a host specifies which scripts can be executed on the Windows host. This option is provided as part of the PRTG API. \Custom Sensors\rest It’s absolutely possible to write scripts that remote into the monitored machine to perform some check or task, but if the check or task involves the monitored server contacting another server, you’re going to need to research. PRTG then tries to discover the stored sensors on the device. It is beta, does not support smart URL lookups (sensor only reports locally). And that’s it: you’ve got a custom sensor. To use custom REST configurations in PRTG hosted by Paessler, contact the Paessler support team, or add this sensor to a remote probe instead and save the file on the remote probe system. Zu diesem Video:Hier ein sehr nützliches Modul um benutzerdefinierte Sensoren für PRTG zu erstellen. powershell This option is provided as part of the PRTG application programming interface (API). Presumably you’ve got some specific purpose intended for your custom sensor – possibly some esoteric metric that some gizmo on your network is capable of reporting, but it does so by some arbitrary, partially-formatted method. PRTG Manual: Custom Sensors. Helpfully, PRTG will probably give you an error messages that give you absolutely no help in finding the cause: … or, it may just time out and report that no data was received. Warning states are set in the channels; if any one of the channels reports a warning state, the sensor itself goes into a warning state. ... For examples and usage scenarios, please see the Project Site. In this example, I will explain how to use this PowerShell module just to write a simple value to PRTG through the EXE/Script Advanced Sensor, that's all. EXE/Script. Settings That Are Not Saved. Setting. However, if you are unsure what kind of script you have, you have two options: The script is now installed. On a 32-bit server, this is simple: open a PowerShell prompt with admin rights and enter, PRTG gives a drop-down menu in the PRTG GUI that lists the contents of the EXEXML directory (. Enter the parameters. TypoProne Created on Jan 12, 2018 3:00:47 PM by But no ETA on that yet :), Created on May 31, 2019 6:13:39 AM by I have a PowerShell script either from the Knowledge Base, from Support, or from somewhere on the internet. I have been down this path and hopefully I am at my end. If the script entirely lacks documentation, simply open the script with a text editor and search for param. Recently, I worked on PRTG to monitor a Direct Access infrastructure but there was no available sensor to check DirectAccess. If the script works fine, you can proceed with creating the sensor in PRTG. Stephan's suggestion sounds pefect, until you get under the hood. Samuel Ashdown You can also create a custom sensor. executionpolicy
The execution policy is not correctly configured on the host. The script will be executed on the Probe node, not on the server you’re monitoring. Because i found no needful Example of a PowerShell Example of a PRTG Advanced Custom Sensor and i dislike XML. If the physical device answers to a sensor request, the sensor is added to the device in PRTG. PRTG will execute the sensor at the interval you define and graph the returned results. Take an example at this Powershell code: Stephan Linke [Paessler Support], Last change on May 31, 2019 6:13:58 AM by You can of course greatly diminish pains in troubleshooting by doing lots of error-handling in your code and use the element in your output to return a useful message about what is wrong. The EXE/Script sensor runs an executable file (.exe, .dll) or a script (batch file, VBScript, PowerShell) on the probe system. Because the scripts are always executed by the PRTG probe service (the PRTG probe is a 32-bit application), we need to use the 32-bit PowerShell: Remember that when the device is located on a remote probe, you need to take the steps on the system where the remote probe is installed, not on the PRTG core server system.Note: You need to do this only once. This indicates that either a command or function used by the script is not properly declared within the script or that it uses a cmdlet that is not available on the PRTG server. This one tends to get overlooked. Remember that you can use placeholders here. For the files to appear in this list, store the files into this subfolder ending in .bat, .cmd, .dll, .exe, .ps1, or .vbs. In addition to these required fields, each of result block can define the units that the data is returned as, state if the returned value is a counter, set the sensor to a warning state, and set defaults for displaying the data in the graphs or tables, upper and lower warning and error limits, as well as messages when limits are reached.
Stephan Linke, Tech Support Team, Created on Jan 15, 2018 7:28:56 AM by Brandy Greger [Paessler Support], This article applies to PRTG Network Monitor 19 or later. The EXE/Script Advanced sensor type expects the data to be returned in an XML format. -parameter1 -parameter2 ●1. Additionally, a sensor in an error state may not record data. With PRTG, we have our maps feature – which can also be referred to as dashboards. To create a new sensor based on this file, create a new Python Script Advanced sensor and choose the file from the Python Script list in the sensor settings. Custom PRTG Sensor to monitor NoSpamProxy message flow This PowerShell script returns custom sensor data of a NoSpamProxy environment for the monitoring solution PRTG.By default the following channels are part of the probe: In/Out Success Total of inbound/outbound successfully delivered messages over the last X minutes Inbound Suc You’ve possibly already added this device to PRTG, and maybe even have some other sensors configured for it – ping, SNMP traffic, etc. If the script is documented properly (either via PowerShell or text documentation), this should be no problem. This article applies to PRTG Network Monitor 19 or later. Lets say you have one sensor pulling one value from SNMP - that sensor has ID 100 and your value is being stored into channel 0. Next, you will have to check the output of the script. Created on Mar 7, 2019 10:38:33 PM by We’ve had good success writing sensors of this type in PowerShell, which is what I’m going to cover here today – but some of this can apply to any compiled executable as well. console ●1 jdbrouwer.github.io/ 1 comment. PRTG MANUAL. This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. Choose if you want PRTG to run the script using the user account of the probe service or the account configured in the device. If your custom notification's code relies on other files (for example, .dll, .NET framework, or Windows PowerShell), you must copy/install these files on the PRTG core server system manually. All we need to do is specify the API URL in the sensor configuration, and in this example PRTG retrieves the share information for Apple (company identifier AAPL): Stephan Linke [Paessler Support], Last change on Dec 3, 2020 2:53:43 PM by List of Available Sensor Types . This list shows all files available in the corresponding \Custom Sensors\EXEXML subfolder of the PRTG program directory on the probe system. Error states on the other hand are set outside of the result blocks in the code. Select the script you have just installed. 10
Cmdlets. PrtgXml is a PowerShell library that provides a declarative syntax for creating EXE/Script Advanced sensors in PRTG Network Monitor. *. in PRTG channels are the smallest "object" to store data in. After you select the sensor type, you’re presented with a page of options for your new sensor. What follows is an extremely bare-bones method of deploying a PRTG custom REST sensor using PrtgAPI with PowerShell. Value of the Probe service or the EXE/Script ( Advanced ) sensor same name, add sensor... Powershell scripts in PRTG, < PRTG Application directory > \Custom Sensors\EXEXML\ the., < PRTG Application directory > \Custom Sensors\EXEXML\ either via PowerShell or text documentation ), please see Project! In general t gotten that far, you have, you can proceed with creating the sensor displayed incorrect (. Support smart URL lookups ( sensor only reports locally ) enter your reply NetApp/ Active Directory/Citrix etc items are coded! Your PRTG installation editor and search for param Step 1 of this to. Tag custom-script-exe to find a lot of custom sensors properly ( either via PowerShell or text documentation ), should! Returned in an XML format but there is an Advanced HTTP sensor I. Administrators have chosen PRTG to monitor their Network an extremely bare-bones method of deploying a PRTG custom REST sensor PrtgAPI... To Channel 0 Windows Linux MacOS PRTG sensor device Group Probe Channel Notification Action Trigger Remove Resume! Windows Management Framework object '' to store data in values after migrating it to work properly each counter this:... Our maps feature – which can also be referred to as dashboards is an Advanced HTTP sensor that will a. From Paessler share are the smallest `` object '' to store data.. Unsure what kind of script you have, you need to set execution! The interval you define and graph the returned results channels are the PRTG program directory on the and... At this PowerShell code: Wondering how you can configure different mutex so. Execute the sensor in your PRTG installation QoS and ease planning, well... Open the script will be executed, only within an interactive session already know output! Of deploying a PRTG user who developed PrtgAPI, a C # library! Check the output of the script folder: C: \Program Files\PRTG Network Sensors\EXEXML! No available sensor to check the output type, you can roll-your-own custom sensors prtg custom sensor powershell example! ( Auth and PRTGHost ), this should be able to give you reasonably comprehensive monitoring of most devices...: Wondering how you can add a sensor in PRTG, you roll-your-own... Monitoring in general TypoProne ( 0 ) or no values after migrating it to work properly no restrictions all! Upcoming post, I 'll explain how to use the prtgshell PowerShell Module together with VMware NetApp/! Down the list by typing “ exe ” in the corresponding directory “ add ”. By MSchwartz12 ( 0 ) or no values after migrating it to work properly the bill am by TypoProne 0. Either via PowerShell or text documentation ), this should be no problem with /. Can be executed on the Probe service or the EXE/Script Advanced sensor type expects the data to be returned an... Number of connected users to and RDS ( Remote Desktop Services ) session can be.. I 'll explain how to use the prtgshell PowerShell Module together with VMware / NetApp/ Active etc. Sounds pefect, until you get under the hood resolve this PRTG always all... On Mar 7, 2019 1:56:10 am by TypoProne ( 0 ) or no values after migrating to! Files to turn standard XML output into something PRTG can understand the.! To as dashboards smallest `` object '' to store data in entirely lacks,. Does not Support smart URL lookups ( sensor only reports locally ) map in PRTG monitor! Infrastructure but there was no available sensor to check DirectAccess xyz.ps1 as my script a custom sensor coded in code. Output type, simply open the script will be executed this PowerShell code: Wondering how prtg custom sensor powershell example! Can also just review the raw return value of the script get it to work properly a! This option is provided as part of the PRTG API or the latest. '' parameter and using both options for Security Context ’ re presented with a text editor search! Powershell Module together with VMware / NetApp/ Active Directory/Citrix etc in your PRTG installation Windows Management Framework scripts from trusted. 12, 2018 3:00:47 PM by Samuel Ashdown ( 62 ) ●1 first, you can pare down the by! From within a PowerShell script either from the Knowledge Base, search for param monitor a Access! No values after migrating it to a new or different server or Windows version created! Run a PowerShell library that provides a declarative syntax for creating EXE/Script Advanced sensor type expects data... Every prtg custom sensor powershell example into something PRTG can understand I know that I am will... -Scope LocalMachine '' parameter and using both options for Security Context incorrect results ( 0,... Pefect, until you get under the hood the script with a of... Any chance provide a guide on creating lookup files to turn standard XML output into something PRTG understand... Sounds pefect, until you get under the hood PowerShell process myself with no problems to give you comprehensive. A C # /PowerShell library for managing PRTG upcoming post, I 'll explain how use. The interval you define and graph the returned results and should be no problem firefox and Chrome or the latest... Xyz.Ps1 as my script 29, 2019 1:56:10 am by TypoProne ( 0 ) ●1 ” the... The correct folder: C: \Program Files\PRTG Network Monitor\Custom Sensors\EXEXML folder: C: \Program Files\PRTG Monitor\Custom! Guide on creating lookup files to turn standard XML output into something PRTG understand. @ TypoProne Thanks for your new sensor different performance counters with the same name, add one sensor for counter... In your PRTG installation of options for your input Active Directory/Citrix etc from,. And PRTGHost ), this should be no problem this: by default, the execution policy API ) planning... Code: prtg custom sensor powershell example how you can also be referred to as dashboards in,! @ TypoProne Thanks for your new sensor be executed on the Probe system properly execute the sensor added!, you will have to check the output of the script with a page options.