Hello,
I am looking for a way to get the content of an txt File displayed on a map. The content of the file gets refreshed every 5 minutes.
A script-sensor doesn’t work for me, for every "new" line of data a new channel is created and the channel from a line that got replaced just gets a "no value" message instead of being deleted. In addition to that, I couldn´t find a way to sort the channels by their Value, from high to low.
This is the script I used
Write-output '<?xml version="1.0" encoding="Windows-1252" ?>' Write-output '<prtg>' $InputData = @(Get-Content C:\folder\file.txt) foreach ($line in $inputData) { $lineName = $line.SubString(3) $lineNumber = $line.SubString(0,2) Write-output ' <result>' $channel =' <channel>' + $lineName + '</channel>' $value =" <value>"+ $lineNumber + "</value>" echo $channel echo $value Write-output ' </result>' } echo ' <text>Demo values. OS: %OS%^</text>' echo '</prtg>'
My next approach was to display the whole TXT file with a Custom-HTML-Object here is what I tried:
(The "file.txt" is located on the PRTG-Server himself)
<iframe src='file://PRTGserver/c$/folder/file.txt'></iframe>
If I try to access file:PRTGserver/c$/folder/file.txt manually with a web-browser, it works great. I also tried to use "localhost" and the IP-Address. But in all three cases it doesn´t work with the Custom-HTML-Object.
Then I made the folder a network share with read permissions for everyone.
I could verify that the network share worked as intended by opening the file from my own PC (with Web browser of cause).
But again, it didn’t work with the Custom-HTML-Sensor.
<iframe src='file://PRTGserver/folder/file.txt'></iframe>
Does someone either has another idea how I could display the file content or know what I must change to make my approaches work ?
Best regards, More
Add comment