- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Need help in NETMRI Script Creation for generating CSV under triggered Jobs section
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 05:41 AM - edited 07-14-2020 05:47 AM
I have a use case of writing a python script under Triggered Jobs section of Netmri for Policy rule violation trigger type
Instead of writing a Adhoc Command under violation Section, We have to write a python script with following details
Trigger Type: Policy Rule
Trigger Event: Rule Id(Eg: QOS_PL13.1)
Device Group: Selected One (Eg: QOS-WAN-ASR)
Python Script should produce the following output
A CSV file should be generated containing following columns
RULE ID(Primary Key), DEVICEID, DEVICE IP, RULE STANDARD CONFIGURATION, RUNTIME DEVICE CONFIGURATION
Imp Note:
- RuleID and standard configuration can be hardcoded for specific Device Group. RuleID can also be stored from Trigger Event field in CSV
- Runtime Device Configuration, DeviceID and Device IP can be taken by logging in to the device.
- for every Rule Id, we will create different scripts containing similar logic to create csv file. Only command to fetch Runtime device configuration will change.
- This script will only be executed in case of any violations of policy rule
Query:
Is there any possiblilty of creating csv/excel file from script execution with triggered job section. if yes, where the csv will be stored.
Sample Configuration which can be used:
Rule ID:
QOS_PL13.1
RULE STANDARD CONFIGURATION:
policy-map QOS-WAN-EDGE
class QOS-VOICE
priority percent 20
class QOS-VIDEO
bandwidth remaining percent 50
class QOS-CONTROL
bandwidth remaining percent 5
class QOS-BUSAPPS
bandwidth remaining percent 15
random-detect dscp-based
service-policy QOS-MARK-BUSAPPS
class QOS-BULK-SCAVENGER
bandwidth remaining percent 5
random-detect dscp-based
service-policy QOS-MARK-BULK-SCAVENGER
class class-default
bandwidth remaining percent 25
set ip dscp default
fair-queue
random-detect dscp-based
^\S
RUNTIME DEVICE CONFIGURATION:
sh run|sec class-map match-any QOS-VOICE