We use SolarWinds and Pingdom to monitor some web sites for internal and external accessibility. I want to be able to compare the API pollers that we use to pull data from Pingdom for alerting, to the checks in Pingdom to make sure we have the CheckID's configured correctly. I've done this in PowerShell and run manually it works fine.
Now I want to create a PowerShell SAM monitor so I can be alerted if someone sets an API Poller up wrong.
I've set the Component monitor to use credentials that have access to the data, and verified this with a manual run. But when I try to run it in SAM I get
"Errors: ==============================================
Connect-Swis : Cannot bind parameter 'Credential'. Cannot convert the "domain\username" value of type "System.String" to type "System.Management.Automation.PSCredential".
At line:15 char:44
+ $swis = Connect-Swis -host $hostname -cred $cred"
This is the bit of the script in question
#Gets users credentials to be used for the proxy with details for logging in
$creds = $args[0]
$token = 'redacted'
$headers = @{
'authorization'="Bearer $token"
}
#uri for the checks
$uri = 'https://api.pingdom.com/api/3.1/checks/'
#Setup Solarwinds connection
$hostname="redacted"
$cred = $args[0]
$swis = Connect-Swis -host $hostname -cred $cred
How can I make this work?