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

PRTG Network Monitor

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

Free Download

Top Tags


View all Tags

How to extract script name field from PRTG sensor with the help of powershell script

Votes:

0

Your Vote:

Up

Down

Hi

I have written powershell script to extract the the information related to sensors like name , id , channel values , priority , interval etc . But I am not finding suitable command to extract the information Script name from relevant sensor . Sensor setting ---> script .

The sensors are in Passelers monitoring tool PRTG . I am extracting data from PRTG server with the help of Powershell script ... but not able to extract data of field called as script ( used to mention script name , used to run in that sensor)

Script Snippet

'Device: ' + $sensor.Device | Out-File -FilePath $outFile -Append 'Type: ' + $sensor.Type | Out-File -FilePath $outFile -Append 'Id: ' + $sensor.ID | Out-File -FilePath $outFile -Append 'Name: ' + $sensor.Name | Out-File -FilePath $outFile -Append

  1. $sensor | Format-Table -AutoSize | Out-File -FilePath $outFile -Append $query | Format-Table -AutoSize | Out-File -FilePath $outFile -Append
  2. $sensor | Get-ObjectProperty | Out-File -FilePath $outFile -Append $sensor | Get-ObjectProperty Tags,IntervalErrorMode,Priority,Interval | Out-File -FilePath $outFile -Append $sensor | Get-Channel | Format-Table -AutoSize | Out-File -FilePath $outFile -Append

May you please share the script format to extract this info

powershell prtg-network-monitor scripting

Created on Jun 23, 2020 7:38:35 AM by  AshishKasture (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

I assume you are using the PrtgAPI module (https://github.com/lordmilko/PrtgAPI/).

using the "Get-ObjectProperty" Cmdlet you can get all properties from the sensors like

# script name
(Get-Sensor -Id 20089 | Get-ObjectProperty).ExeFile
# script parameters
(Get-Sensor -Id 20089 | Get-ObjectProperty).ExeParameters

Created on Jul 8, 2020 5:17:46 AM by  Guenther Schmitz (0) 1



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.