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

XML Sensor Antwort nicht wohlgeformt PE132

Votes:

0

Hallo, ich habe ein XML File mit Werten meiner Raid-Disks. Diese möchte ich in PRTG anzeigen lassen. Anbei das PS1 File.

$result = Invoke-WebRequest -Uri "http://micms01.metob2k.local:61220/xml" -ErrorAction SilentlyContinue -UseBasicParsing

if ($result.StatusCode -ne 200){
write-host "<prtg>"
write-host "<error>1</error>"
write-host "<text>HTTP Request Failed</text>"
write-host "</prtg>"
Exit
}

[xml] $xdoc = $result.Content

## Write-Output $result.Content
## Write-Output $xdoc

Write-Output "<prtg>"

foreach ($xmlnode in $xdoc.Hard_Disk_Sentinel.Childnodes.Hard_Disk_Summary) {
Write-Output "<result>"
Write-Output "<channel>$($xmlnode.Hard_Disk_Serial_Number)</channel>"
Write-Output "<value>$($xmlnode.Health)</value>"
Write-Output "<float>1</float>"
Write-Output "</result>"
}
Write-Host "</prtg>"

Es erscheint in PRTG Anwort nicht wohlgeformt. Die Werte stehen aber in der Meldung drin. Anbei das LogFile des Sensors.

Result of Sensor 8572-Data
Data['fastcount'].asString := '0';
Data['valuetype'].asString := '0';
Data['resultfile'].asString := 'Result of Sensor 8572.txt';
Data['windowsloginusername'].asString := 'administrator';
Data['hostv6'].asString := '';
Data['blockedsens'].asString := '';
Data['tlsexplicit_default'].asString := '';
Data['channelnames'].asString := 'Ausführungsdauer'#$D#$A + 
'1'#$D#$A + 
'';
Data['vmwareparams'].asString := '1';
Data['isexesensor'].asString := '1';
Data['windowsloginpassword'].asString := '***';
Data['scriptplaceholder3'].asString := '';
Data['reboot'].asString := '44858.350468206';
Data['scriptplaceholder1'].asString := '';
Data['exeparamshash'].asString := 'da39a3ee5e6b4b0d3255bfef95601890afd80709';
Data['tlsexplicit_port'].asString := '';
Data['monitorchange'].asString := '0';
Data['inerror'].asString := '1';
Data['scriptplaceholder4'].asString := '';
Data['host'].asString := '192.168.30.49';
Data['unit'].asString := '#';
Data['tlsexplicit_ftp'].asString := '';
Data['timeout'].asString := '60';
Data['notonpod'].asString := '0';
Data['momopersistent'].asString := '';
Data['linuxloginpassword'].asString := '';
Data['exefile'].asString := 'micms01raid7.ps1';
Data['lastuptime'].asString := '0';
Data['writeresult'].asString := '1';
Data['reqmsginterval'].asString := '60';
Data['windowslogindomain'].asString := 'metob2k';
Data['tlsexplicit_imap'].asString := '';
Data['channel'].asString := 'Wert';
Data['uptimecount'].asString := '0';
Data['canlinux'].asString := '1';
Data['channelinfos'].asString := '{"1":{"Unit":"oukTimeResponse","CustomUnit":"","ValueLookupName":"","LimitMode":"0","LimitMinError":"","LimitMinWarning":"","LimitMaxError":"","LimitMaxWarning":""}}';
Data['environment'].asString := '';
Data['mutexname'].asString := '';
Data['scriptplaceholder5'].asString := '';
Data['usednstime'].asString := '0';
Data['newpowershell'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['sensorid'].asString := '8572';
Data['ipversion'].asString := '0';
Data['tlsexplicit_smtp'].asString := '';
Data['scriptplaceholder2'].asString := '';
Data['usewindowsauthentication'].asString := '1';
Data['simulate'].asString := '0';
Data['exeparams'].asString := '';
Data['lastmsg'].asString := '#O132 (<prtg> <result> <channel></channel> <value></value> <float>1</float> </result> <result> <channel>S4X6NF0N302313K</channel> <value>100 %</value> <float>1</float> </result> <result> <channel>S6PUNM0T100958Z</channel> <value>100 %</value> <float>1</float> </result> <result> <channel>S6PUNM0T346477Y</channel> <value>100 %</value> <float>1</float> </result> <result> <channel>S6PUNM0T406148R</channel> <value>100 %</value> <float>1</float> </result> <result> <channel>S6PUNM0T413055E</channel> <value>100 %</value> <float>1</float> </result> <result> <channel>S6PUNM0T402437M</channel> <value>100 %</value> <float>1</float> </result> <result> <channel></channel> <value></value> <float>1</float> </result> <result> <channel></channel> <value></value> <float>1</float> </result> <result> <channel></channel> <value></value> <float>1</float> </result> </prtg> )';
Data['tlsexplicit_pop3'].asString := '';



Datei Result of Sensor 8572.txt

<prtg>
<result>
<channel></channel>
<value></value>
<float>1</float>
</result>
<result>
<channel>S4X6NF0N302313K</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel>S6PUNM0T100958Z</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel>S6PUNM0T346477Y</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel>S6PUNM0T406148R</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel>S6PUNM0T413055E</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel>S6PUNM0T402437M</channel>
<value>100 %</value>
<float>1</float>
</result>
<result>
<channel></channel>
<value></value>
<float>1</float>
</result>
<result>
<channel></channel>
<value></value>
<float>1</float>
</result>
<result>
<channel></channel>
<value></value>
<float>1</float>
</result>
</prtg>

Kann mir bitte jemand helfen, wo der Fehler liegt ? Vielen Dank vorab.
Grüße
Olli

pe132 ps1 xml

Created on Oct 25, 2022 8:48:28 AM

Last change on Oct 27, 2022 1:25:53 PM by  Moritz Heller [Paessler Support]



1 Reply

Votes:

0

Hi there,

It seems like your script submits "100 %". This is not integer value, the script needs to send only "100". Please try this and let me know whether this works.

Created on Oct 27, 2022 1:27:17 PM by  Moritz Heller [Paessler Support]




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.