0

I'm currently planning to analyze csv-reports from our ActiveDirectory and configuration files from our switches with Python.
I'm thinking of having seperate modules for each type of data (csv, txt). But I would like to avoid writing much of the testing and reporting capabilities from scratch.

Is there a python-module or tool, that can help me with this?

Especially I'm looking for a solution to analyze generic text-files. Something to write rules like this: if there is this regex-match, there has to be this match before this match, otherwise report an error.

USE-Cases:
- Analyze switchconfig and report an error when a port is in a given vlan but has no mac-acl applied.
- Look for users in a csv where the Street attribute doesn't match the given string.

vinzBad
  • 133
  • 8

1 Answers1

0

For the 'analyze switchconfig...' case, you probably want NetConf to query, retrieve and present the networking information. There's a very nice NetConf Python library made by Juniper called PyEZ

For the second use-case, that just sounds like AWK, because it's very 'upon matching a pattern, execute action'. If AWK is too arcane for you, there's PyAWK and PAWK Not sure how nice they are, I have not tried them myself. For stuff like that, I find native Python's regex more than sufficient.

Marcin
  • 2,281
  • 1
  • 16
  • 14