- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Generate custom issue in python
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2020 05:55 PM
Hello, I followed the example from the "Getting started with 5 scripts' to generate a custom issue in python. After some minor modification, my script runs without error but the custom issue created doesn't contain the attributes (defined as string) Device, IPAddress, and Contact in the Custom Issue.Am I missing something?
####################################################
import requests, json, re
from infoblox_netmri.easy import NetMRIEasy
# This values will be provided by NetMRI before execution
defaults = {
"api_url": api_url,
"http_username": http_username,
"http_password": http_password,
"job_id": job_id,
"device_id": device_id,
"batch_id": batch_id
}
# Create NetMRI context manager. It will close session after execution
with NetMRIEasy(**defaults) as easy:
device = easy.get_device()
easy.log_message('info', device_devicename)
snmpcommand = easy.send_command('show run | incl contact')
devicecontact = snmpcommand.strip("snmp-server contact ")
issue_id = easy.generate_issue("NewDiscovery","Info",**{
"Device": device_devicename,
"IPAddress": device_deviceipdotted,
"Contact": devicecontact,
"device_id": device_id,
"batch_id": batch_id
})
Solved! Go to Solution.
Re: Generate custom issue in python
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020 08:33 AM
Can you post a Screen Shot of your Custom Issue as well?
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: Generate custom issue in python
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 04:31 PM
Sorry for the late reply. I was able to solve the problem. My confusion was due to the different "default" variables in python and NetMRIEasy.