Hello, I have a question about EXE/Script Advanced sensor and its XML structure to create sensor channels. I customaze my own .ovl file that works fine but is there a way how to specify via XML that channel use this .ovl file at Lookup?
I thought that it should work like this but dont:
# Get data from shelly plug to variable $result $result = Invoke-RestMethod -Uri $url -Method Get # Get relay state value to variable for later use (could be use directly in code) $relayState = $result.relays[0].ison # Converting Shelly Plug relay state from True/False to 1/0 so PRTG can understand that $translatedState = if ($result.relays.ison -eq "True") { "1" } else { "0" } # Parsing and creating XML output for PRTG to create sensor and its parameters $prtgresult="" $prtgresult+="<prtg>" $prtgresult+=" <result>" $prtgresult+=" <channel>Status</channel>" $prtgresult+=" <value>$translatedState</value>" $prtgresult+=" <float>0</float>" $prtgresult+=" </result>" $prtgresult+=" <ValueLookup>id='$file'</ValueLookup>" $prtgresult+="</prtg>" Write-Output $prtgresult
Powershell return this:
<prtg> <result> <channel>Status</channel> <value>0</value> <float>0</float> </result> <ValueLookup>id='prtg.standardlookups.shellyplugs.status'</ValueLooku p></prtg>
So where do I make mistake or is it even possible to specify .ovl file within sensors channel creation?
Add comment