<HTML>
<HEAD>
<TITLE>SNMP community string not being removed (ASA/PIX/FWSM)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I am running RANCID 2.3.6, and noticed that the snmp community string was not being removed on certain lines from our Firewall Services Module (FWSM) configs. The specific line was 'snmp-server host outside 10.10.196.238 poll community &lt;comm_str&gt;'. I checked, and it doesn&#8217;t look like this bug was fixed in 2.3.8.<BR>
<BR>
There is no Cisco Command Lookup Tool for the FWSM directly, however it is based on older versions of the PIX/ASA commands. For ASA version 7.x and lower, the format of the command is 'snmp-server host interface_name ip_address [trap | poll] [community text] [version {1 | 2c}] [udp-port port] '.<BR>
<BR>
For ASA version 8.x and higher, the format changed a little. It is 'snmp-server host {interface {hostname | ip_address}} [trap | poll] [community &nbsp;0 | 8 community-string] [version {1 | 2c | 3 username}] [udp-port port] '.<BR>
<BR>
To cover both of these formats, I changed this section of rancid from...<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (/^(snmp-server community) (\S+)/) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($filter_commstr) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessHistory(&quot;SNMPSERVERCOMM&quot;,&quot;keysort&quot;,&quot;$_&quot;,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;!$1 &lt;removed&gt;$'&quot;) &amp;&amp; next;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessHistory(&quot;SNMPSERVERCOMM&quot;,&quot;keysort&quot;,&quot;$_&quot;,&quot;$_&quot;) &amp;&amp; next;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<BR>
To...<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (/^(snmp-server .*community) ([08] )?(\S+)/) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($filter_commstr) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessHistory(&quot;SNMPSERVERCOMM&quot;,&quot;keysort&quot;,&quot;$_&quot;,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;!$1 $2&lt;removed&gt;$'&quot;) &amp;&amp; next;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessHistory(&quot;SNMPSERVERCOMM&quot;,&quot;keysort&quot;,&quot;$_&quot;,&quot;$_&quot;) &amp;&amp; next;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<BR>
I don't have an ASA 8.x device, so I couldn't test this with a real config. It worked when I dummied up an ASA config, and it works with my FWSM configs.<BR>
<BR>
Skye.<BR>
</SPAN></FONT>
</BODY>
</HTML>