Skip to content

Instantly share code, notes, and snippets.

@dword4
Last active March 15, 2018 21:09
Show Gist options
  • Save dword4/7f02b1bd76fe4839f3f367fc945b9eda to your computer and use it in GitHub Desktop.
Save dword4/7f02b1bd76fe4839f3f367fc945b9eda to your computer and use it in GitHub Desktop.
LibreNMS adding a device with salt
# adds a device forcefullly in LNMS via the API
lnms_api_add:
cmd.run:
- name: >-
curl -X POST --data-binary '{"hostname":"{{ salt['grains.get']('ip4_interfaces:ens18:0') }}","force_add":"true","port":"161","version":"v2c","community":"public"}' -k -v -H 'X-Auth-Token: SOMEAPITOKEN' 'http://192.168.1.85/api/v0/devices'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment