Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #require --version 4.0
- <#
- ___ ___ _____ ___
- | _ \ _ \_ _/ __|
- | _/ / | || (_ |
- |_| |_|_\ |_| \___|
- BulkSMSCreditCheck
- Description: Simply pass the get credits API URL in the sensor and it will show the remaining credits.
- Author: Stephan Linke
- Version History
- ----------------------------
- 1.0 Initial Release
- #>
- param([string]$url,[switch]$use_comma = $FALSE)
- $remaining_credits = (Invoke-WebRequest -UseBasicParsing -Uri $url).Content.Split("|")[1];
- if($use_comma)
- { $remaining_credits = $remaining_credits.Replace(".",",") }
- Write-Host (@"
- <prtg>
- <result>
- <channel>Remaining Credits</channel>
- <float>1</float>
- <value>{0}</value>
- </result>
- <text>{0} remaining SMS credits</text>
- </prtg>
- "@ -f $remaining_credits)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement