Skip to content

Instantly share code, notes, and snippets.

@freedomwarrior
Created August 31, 2018 12:57
Show Gist options
  • Select an option

  • Save freedomwarrior/dd69386e73ee1f89340c7309cc1d5136 to your computer and use it in GitHub Desktop.

Select an option

Save freedomwarrior/dd69386e73ee1f89340c7309cc1d5136 to your computer and use it in GitHub Desktop.
import requests
headers = {'X-Auth-Token': 'TOKENHERE'}
res = ['10.15.200.77', 'v2c', 'public']
data = '{"hostname":"%s","version":"%s","community":"%s"}' % (res[0],res[1],res[2])
response = requests.post('http://librenms.com/api/v0/devices', data=data, headers=headers)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment