• Stars
    star
    210
  • Rank 187,585 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python client for interacting with the SolarWinds Orion API

Orion SDK for Python

This project contains a python client for interacting with the SolarWinds Orion API

API Documentation

For documentation about the SolarWinds Orion API, please see the wiki, tools, and sample code (in languages other than Python) in the main OrionSDK project.

Install

pip install orionsdk

Usage

import orionsdk

swis = orionsdk.SwisClient("server", "username", "password")

aliases = swis.invoke('Metadata.Entity', 'GetAliases', 'SELECT B.Caption FROM Orion.Nodes B')

print(aliases)

SSL Certificate Verification

Initial support for SSL certificate valuation was added in 0.0.4. To enable this, you will need to save the self-signed cert to a file. One way of doing this is with OpenSSL:

openssl s_client -connect server:17778

Then add an entry to your hosts file for SolarWinds-Orion and you will be able to verify via doing the following:

import orionsdk
swis = orionsdk.SwisClient("SolarWinds-Orion", "username", "password", verify="server.pem")
swis.query("SELECT NodeID from Orion.Nodes")

Setting Timeout

import orionsdk
import requests

session = requests.Session()
session.timeout = 30 # Set your timeout in seconds
swis = orionsdk.SwisClient("SolarWinds-Orion", "username", "password", verify="server.pem", session=session)
swis.query("SELECT NodeID from Orion.Nodes")

Setting Retry

import orionsdk
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry


def retry_session(retries=3,
                  backoff_factor=0.3,
                  status_forcelist=(500, 502, 504)):
    session = requests.Session()
    retry = Retry(
        total=retries,
        read=retries,
        connect=retries,
        backoff_factor=backoff_factor,
        status_forcelist=status_forcelist)
    adapter = HTTPAdapter(max_retries=retry)
    session.mount('http://', adapter)
    session.mount('https://', adapter)
    return session


swis = orionsdk.SwisClient(
    "SolarWinds-Orion",
    "username",
    "password",
    verify="server.pem",
    session=retry_session())
swis.query("SELECT NodeID from Orion.Nodes")

License

This software is licensed under the Apache License, version 2 ("ALv2"), quoted below.

Copyright © 2015 SolarWinds Worldwide, LLC.  All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.

Related Projects

Solarwinds Interface Traffic Forecaster

SolarwindsInterfaceTrafficPrediction is an example of using the Orion SDK for Python and machine learning techniques to predict network interface traffic.

More Repositories

1

OrionSDK

SDK for the SolarWinds Orion platform, including tools, documentation, and samples in PowerShell, C#, Go, Perl, and Java.
C#
397
star
2

containers

Containerized offerings of SolarWinds products and tools
Shell
55
star
3

tinygo-lessons

Using TinyGo to program the Arduino Nano 33 IoT
Go
47
star
4

zig-build

Node.js native addon build and cross-compile library using Zig
TypeScript
24
star
5

nova

TypeScript
23
star
6

rkubelog

Send k8s Logs to Papertrail and Loggly Without DaemonSets (for Nodeless Clusters)
Go
23
star
7

fluent-plugin-papertrail

Fluentd integration with Papertrail.
Ruby
21
star
8

appoptics-apm-go

AppOptics APM Instrumentation for Go
Go
18
star
9

docker-plugin-papertrail

A Docker plugin for Papertrail to send and read container logs. As a SolarWinds Innovation Project, this adapter is supported in a best-effort fashion.
Go
12
star
10

solarwinds-snap-agent-docker

Docker and Kubernetes assets for running SolarWinds Snap Agent
Shell
11
star
11

appoptics-apm-node

AppOptics APM Instrumentation Agent for Node.js
JavaScript
11
star
12

prometheus2appoptics

A Prometheus remote storage adapter for AppOptics
Go
10
star
13

istio-adapter

An Istio Mixer adapter for integration with AppOptics, Papertrail, and Loggly. As a SolarWinds Innovation Project, this adapter is supported in a best-effort fashion.
Go
9
star
14

golessons

A series of interactive lessons teaching Go
9
star
15

PowerOrion

PowerShell
9
star
16

7zip-sfx

7-Zip self-extractor stub, modified for 64-bit binaries, unRAR code removed
C++
8
star
17

papertrail-go

Golang library to ship logs to papertrail using syslog over udp or tcp or tls with local buffering
Go
7
star
18

fluentd-deployment

Fluentd deployment manifests for integration with Loggly and Papertrail
Ruby
6
star
19

mlnet-workshop

Anomaly Detection Algorithm Comparison in ML.NET
C#
6
star
20

k8slessons

Kubernetes Lessons
Go
6
star
21

probprog-workshop

Workshop on probabilistic programming for Tech Summit 2020 (Brno, December 12 2019)
Jupyter Notebook
5
star
22

apm-python

OpenTelemetry-based SolarWinds APM Python library
Python
5
star
23

ansible-swisnap

Ansible role for SolarWinds Snap Agent installation
Jinja
5
star
24

swi-k8s-opentelemetry-collector

Kubernetes infrastructure monitoring
Go
4
star
25

snap-plugin-lib

v2 Plugin Framework for SolarWinds Snap Agent; includes v1 forked from https://github.com/intelsdi-x/snap-plugin-lib-go
Go
4
star
26

machine-learning-workshops

Location for machine learning examples.
C#
3
star
27

uamsclient-ansible

Jinja
3
star
28

cloud-observability-integration

Go
3
star
29

fluent-plugin-loggly-syslog

Fluentd syslog plugin for Loggly
Ruby
3
star
30

apm-go

OpenTelemetry-based SolarWinds APM Go library
Go
3
star
31

solarwinds-apm-ruby

Ruby
3
star
32

terraform-provider-swo

A custom terraform provider that supports SWO resources.
Go
3
star
33

uamsclient-chef

Ruby
2
star
34

ec2-runner-action

TypeScript
2
star
35

solarwinds-bindings-node

Node.js native bindings for SolarWinds APM
C++
2
star
36

appoptics-kubernetes-controller

AppOptics Controller for Kubernetes
Go
2
star
37

solarwinds-apm-node

SolarWinds APM Instrumentation Agent for Node.js
JavaScript
2
star
38

pull-request

Shell
2
star
39

appoptics-apm-ruby

AppOptics APM for Ruby apps and services
Ruby
2
star
40

apm-ruby

OpenTelemetry-based SolarWinds APM Ruby library
Ruby
2
star
41

apm-js

OpenTelemetry-based SolarWinds APM JavaScript library
TypeScript
2
star
42

tailwindcss-cli

JavaScript
1
star
43

swisnap-cookbook

HTML
1
star
44

snap-plugin-collector-ping

Simple snap collector for gathering ping metrics
Go
1
star
45

pop-pagination

Library to help facilitate pagination alongside Pop models
Go
1
star
46

example_grpc

A simple example of gRPC
Makefile
1
star
47

grpchan

Go
1
star
48

apm-proto

gRPC-defined protobuf for Solarwinds APM services
Makefile
1
star
49

swo-client-go

Solarwinds Observability Platform Golang client
Go
1
star
50

ace-context

Asynchronous Chained Execution Context for Node
JavaScript
1
star
51

appoptics-php-testapp-laravel

Test apps for laravel
PHP
1
star