Can anyone point to a python sample script where this can be achieved? or at least part of it, just need something to get me started.
Via the CLI on the ASA there are multiple ways to go about it. I usually do:
1 - sh access-list <name> | I 1.2.3.4
2 - if actual line # has an object or group as name, then I go and search for that object/group and show its contents
For automation, the following can be used as well:
sh run object in-line | i1.2.3.4
I can then split the output line using python and get the object name.
However, for the following, I would need a way to read the previous line to where the string is found.
sh run object-group network | i object-group|<object-name>
Any ideas anyone? Or knows a better way to achieve it?
I've seen some scripts using "ciscoconfparse" but it seems to work only with downloaded config txt files and not on actual devices via ssh/telnet/etc.
Regards