Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #############
- # ___ ___ _____ ___
- #| _ \ _ \_ _/ __|
- #| _/ / | || (_ |
- #|_| |_|_\ |_| \___|
- # NETWORK MONITOR
- #-------------------
- # Description: This
- # Parameters:
- # -URL: The URL of the temperature probe
- # ------------------
- # (c) 2015 Stephan Linke | Paessler AG
- param($url)
- $regex = [regex]'(\d+\D\d+)\D+(\d+\D\d+)\D+(\d+\D\d+)'
- (Invoke-Webrequest -URI $URL) -match $regex
- Write-Host @"
- <PRTG>
- <result>
- <channel>Temperature</channel>
- <value>$($matches[1])</value>
- <showChart>1</showChart>
- <showTable>1</showTable>
- <Float>1</Float>
- <DecimalMode>All</DecimalMode>
- <unit>Temperature</unit>
- <mode>Absolute</mode>
- </result>
- <result>
- <channel>Humidity</channel>
- <value>$($matches[2])</value>
- <showChart>1</showChart>
- <showTable>1</showTable>
- <Float>1</Float>
- <DecimalMode>All</DecimalMode>
- <unit>Percent</unit>
- <mode>Absolute</mode>
- </result>
- <result>
- <channel>Brightness</channel>
- <value>$($matches[3])</value>
- <showChart>1</showChart>
- <showTable>1</showTable>
- <Float>1</Float>
- <unit>CustomUnit</unit>
- <customunit>Lux</customunit>
- <mode>Absolute</mode>
- <DecimalMode>All</DecimalMode>
- </result>
- </PRTG>
- "@;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement