Git Product home page Git Product logo

stackstorm-netbox's Introduction

stackstorm-netbox

NetBox is an Open Source IPAM and DCIM tool originally created by DigitalOcean.

Configuration

Copy the example configuration in netbox.yaml.example to /opt/stackstorm/configs/netbox.yaml and edit as required.

It should look like this:

---
hostname: "netbox.corp.lan"
api_token: "aaabbbccc111222333"
use_https: true
ssl_verify: true

After editing, run sudo st2ctl reload --register-configs to ensure your configuration is loaded.

Actions

There are more than 290 actions in this pack. Each maps to a particular NetBox API endpoint.

The action naming convention is easy to understand as it follows this basic pattern:

<http_verb>.<netbox_app>.<netbox_model>

Example for the action to make a GET request for Sites:

get.dcim.sites

Each action has been auto generated based on the NetBox OpenAPI (Swagger) spec file. The actions are periodically updated in accordance with new NetBox releases. Check the change log for details.

All GET actions have the ability to store the NetBox API response directly into the ST2 Key Store rather than provide it as standard action output. This is useful in cases where that reponse is extremely large and thus passing it between actions is impractical. This is controlled with the save_in_key_store, save_in_key_store_key_name, and save_in_key_store_ttl action parameters. Look at any get.* action meta file for more details.

Sensors

The pack contains a single sensor meant to interact with the NetBox Webhook functionality. NetBox has the ability to send webhooks to enternal systems when certain user defined events occur. The netbox_webhooks sensor is setup to process those events and fire triggers into StackStorm.

The sensor injects three types of triggers based on the webhook event:

  • netbox.webhook.object_created
  • netbox.webhook.object_updated
  • netbox.webhook.object_deleted

The trigger payload contains the entire contents of the webhook data from NetBox.

The sensor exposes three optional pack config parameters to control its operation. This example can be added to the netbox pack config.

sensor_address: 192.168.1.100  # defaults 0.0.0.0, making the sensor reachable on all host addresses
sensor_port: 6000  # defaults to 6000
sensor_secret: "<webhook secret>"  # defaults to empty string, which disables signature verification

Based on your desired settings, the URL for the webhook's configuration inside of NetBox will be:

http://<ip-address>:<port>/netbox/webhooks/

Note: the sensor does not support HTTPS but this could be accomplished by fronting the sensor with Nginx/Apache/etc, which would terminate the SSL connection and then proxy the request to the sensor over HTTP.

stackstorm-netbox's People

Contributors

lampwins avatar abhi1693 avatar lindsayhill avatar cognifloyd avatar arm4b avatar thgrw avatar kami avatar mamercad avatar nzlosh avatar blag avatar sanecz avatar enykeev avatar nmaludy avatar khaddict avatar whites2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.