I'm running an XML Custom EXE/Script Sensor in PRTG. It is a PowerShell script, and no matter what I do, PRTG interprets the value as "0" for the channel "Open Tickets."
I've created duplicate results/channels for "New Tickets" and "In Progress Tickets", however, I haven't coded in the variable, yet. When using the hard-coded values, PRTG ingests these normally. The weird thing is the output of the PowerShell script for the variable doesn't have anything different than the hard coded values.
This is driving me crazy. Any ideas?
I'm posting the script, the PowerShell Result, and the PRTG ingest below.
PowerShell Script:
$username = "USERNAME" $password = "PASSWORD" $url = "https://url.com/helpdesk/api/Stats" $pair = "$($username):$($password)" $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base64 = [System.Convert]::ToBase64String($bytes) $basicAuthValue = "Basic $base64" $headers = @{ Authorization = $basicAuthValue } $response = Invoke-WebRequest -Uri $url -Method GET -Headers $headers $content = $response.Content | ConvertFrom-Json $unclosed = $content.Unclosed Write-Host " <prtg> <result> <channel>Open Tickets</channel> <value>$unclosed</value> </result> <result> <channel>New Tickets</channel> <value>51</value> </result> <result> <channel>In Progress Tickets</channel> <value>5</value> </result> </prtg>"
PowerShell ISE Result:
<prtg> <result> <channel>Open Tickets</channel> <value>48</value> </result> <result> <channel>New Tickets</channel> <value>51</value> </result> <result> <channel>In Progress Tickets</channel> <value>5</value> </result> </prtg>
PRTG Data Table from Ingest:
- Open Tickets: 0
- New Tickets: 51
- In Progress Tickets: 5
Add comment