angela-d / prtg-zendesk-webhook

Automate ticket creation when PRTG sensors are triggered, to easily delegate IT tasks.
GNU General Public License v2.0
2 stars 1 forks source link

Missing dependencies... #2

Closed JRAndreassen closed 3 years ago

JRAndreassen commented 3 years ago

Please update the README.MD with the required libraries. Preferably with links / statements to install.

In particular: "Call-ZenDesk "/api/v2/tickets.json" Post $Body"

Where is "Call-ZenDesk" Thanks JR

angela-d commented 3 years ago

There isn't any required libraries.

Call-ZenDesk is a procedural function inside the code, it doesn't pull in third-party stuff.

Call-ZenDesk (earlier in the code):

# call the zendesk api
function Call-ZenDesk($Api, $Method, $Body) {

  # by default, powershell seems to want to use insecure/deprecated tls, the following fixes that
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  Invoke-RestMethod -Method $Method -Uri "$($BaseUri)$($Api)" -Headers $AuthHeader -Body $Body
}

Call-ZenDesk = triggers the function call $Api = /api/v2/tickets.json $Body is pulled from a variable earlier in the code that digests the message body and puts it in json format:

$Body = ConvertTo-Json($Transaction)

You don't "install" it like a NPM app, you copy the script into PRTG and inform the script of your API details: https://github.com/angela-d/prtg-zendesk-webhook#how-to-use-it

JRAndreassen commented 3 years ago

"The first thing you go blind on are the eyes"

Thanks... JR

angela-d commented 3 years ago

:) Hope it's useful for you!