Hi Guys,
I have integrated Opsgenie with Automate (labtech) via API Key. i have followed the same step those were told in documentation and imported the script It was working before 4 days. but now script giving error . I don't why
this is the error when script runs on server . server is exchange server.
Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure
channel.
At C:\Windows\system32\config\systemprofile\AppData\Local\9e1cd5b9f46d4e17b9179
fbe197f1909.ps1:36 char:11
+ $result = Invoke-RestMethod -Method "Post" -Uri $uri -Headers $headers -Body
$bo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeRestMethodCommand
here is the script :-
param (
[string]$eu = "False",
[string]$apiKey = "apiKey",
[string]$status = "status",
[string]$clientname = "client",
[string]$computername = "computer",
[string]$locationname = "location",
[string]$fieldname = "field",
[string]$result = "result",
[string]$when = "when",
[string]$contactName = "contact",
[string]$monitorName = "monitor"
)
if($eu -eq "True") {
$uri = "https://api.eu.opsgenie.com/v1/json/integrations/webhooks/connectwiseautomate?apiKey=" + $apiKey;
}
else {
$uri = "https://api.opsgenie.com/v1/json/integrations/webhooks/connectwiseautomate?apiKey=" + $apiKey;
}
$body = ConvertTo-Json @{
status = $status
clientName = $clientname
computerName = $computername
locationName = $locationname
fieldName = $fieldname
result = $result
when = $when
contactName = $contactName
monitorName = $monitorName
}
$headers = [Hashtable] @{
Type = 'application/json'
};
$result = Invoke-RestMethod -Method "Post" -Uri $uri -Headers $headers -Body $body -ContentType 'application/json'
Write-Output $result
I have also tried to integrated the CW email integration . email are failing from CW automate to send to ops genie email.
Any idea why script is failing ?
Thanks you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.