182FF with cup packs
I've got to do a policy review of some 150 PIX and ASA firewalls.
I have a word document I have to fill in with certain details, one doc per firewall.
Now I've written myself a nice expect script that'll ssh to all of the boxes and collect the config file and dump the results I want into a text file (or files depending on what I need)
Then I take this file and grep it for the config lines I need to put into the report.
For instance, I am grepping the config file for certain terms like "mtu", "ntp server", "snmp-server", "^http .*$", "^ssh .*$". (as the sections of the document are things like "list the interface mtu's", "are ntp servers configured", "are snmp communities configured", "what are the ssh and http management settings".
Currently I am just outputing the lines of each grep command into a text file with a blank line between each search term, in the order of the word document sections.
Ideally, I would like to just create some sort of mail merge in word and fill in the document sections automatically, by pointing it at an output file.
Problem is, that every mail merge I have ever done (years and years ago) was always fairly simple, with a CSV file of just names and addresses, and I'm not entirely sure how I'd go about getting this into word.
I can vary the output from my script to whatever is needed.
I could easilly make the output file something like this:
Would this work?
Or maybe I could pre-pend and append a " then stick a field delimiter between each section and a record delimiter after each firewall?
Any ideas?
I have a word document I have to fill in with certain details, one doc per firewall.
Now I've written myself a nice expect script that'll ssh to all of the boxes and collect the config file and dump the results I want into a text file (or files depending on what I need)
Then I take this file and grep it for the config lines I need to put into the report.
For instance, I am grepping the config file for certain terms like "mtu", "ntp server", "snmp-server", "^http .*$", "^ssh .*$". (as the sections of the document are things like "list the interface mtu's", "are ntp servers configured", "are snmp communities configured", "what are the ssh and http management settings".
Currently I am just outputing the lines of each grep command into a text file with a blank line between each search term, in the order of the word document sections.
Ideally, I would like to just create some sort of mail merge in word and fill in the document sections automatically, by pointing it at an output file.
Problem is, that every mail merge I have ever done (years and years ago) was always fairly simple, with a CSV file of just names and addresses, and I'm not entirely sure how I'd go about getting this into word.
I can vary the output from my script to whatever is needed.
I could easilly make the output file something like this:
Code:
<firewall_1>
<mtu>
interface1 mtu
interface2 mtu
interface3 mtu
</mtu>
<ntp>
ntp server 1.2.3.4
ntp server 1.2.3.5
</ntp>
<snmp>
snmp community 1
snmp community 2
</snmp>
<http_management>
http enable
http hosts etc
</http_management>
<ssh_management>
ssh enable
ssh hosts etc
</ssh_management>
</firewall_1>
<firewall_2>
<mtu>
interface1 mtu
interface2 mtu
interface3 mtu
</mtu>
<ntp>
ntp server 1.2.3.4
ntp server 1.2.3.5
</ntp>
<snmp>
snmp community 1
snmp community 2
</snmp>
<http_management>
http enable
http hosts etc
</http_management>
<ssh_management>
ssh enable
ssh hosts etc
</ssh_management>
</firewall_2>
Or maybe I could pre-pend and append a " then stick a field delimiter between each section and a record delimiter after each firewall?
Any ideas?