- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 03:31 AM
Hi,
I am new to XML scripts. I wanted to create a xml rule in NetMRI. The requirement is to define 10 command lines in the rule. NetMRI should iterate through each line and test each line in the current device configuration. In the end it gives me the lines Found and Not Found as output.
Any help would be greatly appreciated.
Thank You.
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 08:09 AM
Can you post the lines that you want to check?
Also, you can accomplish this without XML as well
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 08:32 AM
snmp-server enable traps transceiver all
snmp-server enable traps tty
snmp-server enable traps auth-framework sec-violation
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps config-ctid
snmp-server enable traps energywise
aaa accounting commands 1 default start-stop group .*
aaa accounting commands 15 default start-stop group .*
aaa accounting connection default start-stop group .*
aaa accounting exec default start-stop group .*
aaa accounting network default start-stop group .*
aaa accounting system default start-stop group .*
aaa accounting update newinfo
aaa authentication login default group .* local
aaa authorization commands 1 default group .* none
aaa authorization commands 15 default group .* none
aaa authorization config-commands
aaa new-model
aaa session-id common
Siddharth Sharma
Sr. Network Engineer
.........................................................
US Direct Dial (O) : +1-612.671.9464 M: +91-7039630779
[cid:image001.jpg@01D5DC0F.4D937FF0]Ameriprise Financial
Ameriprise India Private Limited
Plot # A - 112, Sector 65, Noida
Uttar Pradesh, India 201301
We shape financial solutions for a lifetime(r)
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 08:40 AM
For this, I would create two rules. One for SNMP and one for AAA
I will post them here shortly
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 08:48 AM
Siddharth Sharma
Sr. Network Engineer
.........................................................
US Direct Dial (O) : +1-612.671.9464 M: +91-7039630779
[cid:image001.jpg@01D5DC11.C1B1AFE0]Ameriprise Financial
Ameriprise India Private Limited
Plot # A - 112, Sector 65, Noida
Uttar Pradesh, India 201301
We shape financial solutions for a lifetime(r)
Re: XML script to iterate through rules
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 08:56 AM - edited 02-05-2020 09:11 AM
Please see attached
You will also need to add a Device Filter or it will run that against all the devices
Also, join us on Slack and here is a list of Scripts and Rules, I'm going to upload these to that list
https://github.com/infobloxopen/netmri-toolkit
Here you will find some additional rules
https://github.com/infobloxopen/netmri-toolkit/tree/master/policy/rule_logic_builder
Twitter: https://twitter.com/sifbaksh
https://sifbaksh.com
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 09:32 AM
Are you determined to create it in XML? Instead you could use the Logic Rule Builder to specify that all of those statements must be present in any order, and that no others of those types may exist. Like Sif suggested, one rule for AAA and another for SNMP seems preferable. If you combine those into a policy, the resulting analysis will flag any violations.
Once those rules work as you wish, you could Export the rules or policy in XML format and then examine it.
Re: XML script to iterate through rules
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 11:00 AM
I wanted to write a XML script which tells me out of 6 commands defined in the rule what all commands failed while iterating the rule from top to bottom.
Thanks !