Hello. I'm following https://kb.paessler.com/en/topic/56353-is-it-possible-to-monitor-the-copy-of-a-file-from-one-server-to-another-and-get-the-speed-of-the-t but can't get it to work. Error message is:
Response not wellformed: "(<prtg> <result> <channel>Transfer Time</channel> <value>00:00:00.0474189</value> </result> <text>OK</text> </prtg> )" (code: PE132)
Here's my NasMonitor.ps1:
$time=Measure-Command -Expression {Copy-Item D:\Permanent\NasMonitor\NasMonitor.txt \\192.168.1.103\nas\60Zona\NasMonitor}
Write-Host "<prtg>"
Write-Host "<result>"
"<channel>Transfer Time</channel>"
"<value>"+ $time +"</value>"
"</result>"
"<text>OK</text>"
Write-Host "</prtg>"
When I execute it from PowerShell it works. Enabling Write EXE result to disk, Result of Sensor 2073.txt shows:
<prtg>
<result>
<channel>Transfer Time</channel>
<value>00:00:00.0407119</value>
</result>
<text>OK</text>
</prtg>
And Result of Sensor 2073.Data.txt shows:
Data['blockedsens'].asString := '';
Data['canlinux'].asString := '1';
Data['channel'].asString := 'Value';
Data['channelinfos'].asString := '{"1":{"Unit":"oukTimeResponse","CustomUnit":"","ValueLookupName":"","LimitMode":"0","LimitMinError":"","LimitMinWarning":"","LimitMaxError":"","LimitMaxWarning":""},"2":{"Unit":"oukCustom","CustomUnit":"#","ValueLookupName":"","LimitMode":"0","LimitMinError":"","LimitMinWarning":"","LimitMaxError":"","LimitMaxWarning":""}}';
Data['channelnames'].asString := 'Execution Time'#$D#$A +
'1'#$D#$A +
'Value'#$D#$A +
'2'#$D#$A +
'';
Data['environment'].asString := '';
Data['exefile'].asString := 'NasMonitor.ps1';
Data['exeparams'].asString := '';
Data['fastcount'].asString := '0';
Data['host'].asString := '192.168.1.103';
Data['hostv6'].asString := '';
Data['inerror'].asString := '1';
Data['interfacenumber'].asString := '';
Data['inum'].asString := '';
Data['ipversion'].asString := '0';
Data['isexesensor'].asString := '1';
Data['lastmsg'].asString := '#O132 (<prtg> <result> <channel>Transfer Time</channel> <value>00:00:00.0423838</value> </result> <text>OK</text> </prtg> )';
Data['lastuptime'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['linuxloginpassword'].asString := '***';
Data['monitorchange'].asString := '0';
Data['mutexname'].asString := '';
Data['notonpod'].asString := '0';
Data['reboot'].asString := '42820.9591687269';
Data['reqmsginterval'].asString := '60';
Data['resultfile'].asString := 'Result of Sensor 2073.txt';
Data['sensorid'].asString := '2073';
Data['simulate'].asString := '0';
Data['timeout'].asString := '60';
Data['tlsexplicit_default'].asString := '';
Data['tlsexplicit_ftp'].asString := '';
Data['tlsexplicit_imap'].asString := '';
Data['tlsexplicit_pop3'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['tlsexplicit_smtp'].asString := '';
Data['unit'].asString := '#';
Data['uptimecount'].asString := '0';
Data['usednstime'].asString := '0';
Data['usewindowsauthentication'].asString := '0';
Data['valuetype'].asString := '0';
Data['windowslogindomain'].asString := '';
Data['windowsloginpassword'].asString := '***';
Data['windowsloginusername'].asString := '';
Data['writeresult'].asString := '1';
I can't see what's malformed. File is being copied and transfer time is being shown. What am I missing?
Add comment