No Problem but a Solution:
I had the problem, that i does not know how many sms Credits i had remaining at bulksms provider. So i write a PowerShell Script, and keep it simple, it works for me and maybe someone else can use this too.
Installation:
Copy the Script and save it as bulkSMSCreditStatus.ps1 Script see below. Put the Script into your PRTG Installation
e.g. C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
Add a new Sensor to the Server Probe, this make sense because, this Probe sends the sms messages.
Choose the Script
Add Parameters: -bulksmsUSR YOUR_BULKSMSUER -bulksmsPW YOUR_Secret_Password
Important: Security Context ==> Use Windows credentials of parent device
Save and your finished.
Now you can define Values for LimitMinWarning and LimitMinError.
If everything is fine and works you should see this
Please contact if questions occur.
#Get BulkSMS Credit Status # v. 1.1 # © 2018 Frank Fischer # www.freaky-media.de # # ################# # Settings for the Sensor # Define Parameter with User and Password # -bulksmsUSR username_at_bulksms -bulksmsPW YourSuperSecretPW # # Security Context ==> Use Windows credentials of parent device # # Define Values for LimitMinWarning and LimitMinError # v1.0 Initial Release # v1.1 Change API URL 2018.06 ################# param( $bulksmsUSR, $bulksmsPW ) #URL [string]$bulksmsAPIURLCredits = "https://bulksms.vsms.net/eapi/user/get_credits/2/2.0?username=$bulksmsUSR&password=$bulksmsPW" $WebResponse = Invoke-WebRequest $bulksmsAPIURLCredits $bulksmsCredits = $WebResponse.ToString() $bulksmsCredits = $bulksmsCredits.split("|") $bulksmsStatus = $bulksmsCredits[0] $bulksmsCreds = $bulksmsCredits[1] if($bulksmsStatus -eq "0") { Write-Host @" <?xml version='1.0' encoding='UTF-8'?> <prtg> <result> <channel>API Status</channel> <value>$bulksmsStatus</value> <float>1</float> </result> <result> <channel>Credit Status</channel> <value>$bulksmsCreds</value> <customunit>Credits</customunit> <LimitMinWarning>50</LimitMinWarning> <LimitMinError>20</LimitMinError> <text>Remaining Credits</text> <float>1</float> </result> </prtg> "@ } else { Write-Host @" <?xml version='1.0' encoding='UTF-8'?> <prtg> <error>1</error> <text>An Error occured: $bulksmsCreds</text> </prtg> "@ }
Add comment