hi,
I'd like to write some custom script (PS or Python) that would be exposed over Solarwinds rest api so other systems could use it. Is this possible?
br
Yes. First get the SDK (with examples and documentation)Powershell:GitHub - solarwinds/OrionSDK: SDK for the SolarWinds Orion platform, including tools, documentation, and samples in PowerShell, C#, Go, Perl, and Java.Python:GitHub - solarwinds/orionsdk-python: Python client for interacting with the SolarWinds Orion API And examples are all over Thwack, but check (+) Scripts - The Orion Platform - THWACK - SolarWinds Community specfically. If you run into issues, let us know.
well, I already have SDK and everything and I do not see there what I need. That0s why I am asking. Mybe I missed it :-)) can you show me what example or part of SDK describes how to "publish" you own script to be available over Solarwinds APi?
There's no way to "publish" information, but there is a way to query for information. It can be done via a curl (https request) and should provide you with most of what you need.
What exactly are you looking to build for the other system to consume?
This gets my mind jogging as this would be cool. I wouldn't see this ever being supported though natively in the API to expose a custom script (I mean consider the security implications of that alone...) That said -- there could be some close solutions.
One that comes to mind .. you can create Orion Events via the API. Those Orion events could be the trigger of an alert that has an action (your script) in which could take some input from the action perhaps. It's plausible but would require a bit of trial and error perhaps.
I could happily elaborate on that more just throwing out the ideas as this seems interesting!