[rancid] Re: rancid with Cisco ASA 5520 in Multiple Context Mode

Carlo Finotti carlo.finotti at gmail.com
Tue Apr 21 20:48:51 UTC 2009


On Tue, Apr 21, 2009 at 10:56 AM, Carlo Finotti <carlo.finotti at gmail.com> wrote:
> But is your ASA running in multiple conext mode?  How do you get
> around running sudo everytime?
>
> here is an example:
>
> user at ciscobackup:~$ ./test2.sh
> [sudo] password for user:
>
> This is what ends up in my firewall.cfg file.  The clogin application
> can ssh to the firewall but then it does not run any of the
> pre-defined Cisco commands. ex (terminal pager 0; changeto context
> firewall1; sh run; exit)
>
> spawn ssh -c 3des -x -l rancid 10.2.2.1
> rancid at 10.2.2.1's password:
> Type help or '?' for a list of available commands.
> firewall/admin> enable
> Password: **********
> firewall/admin#
>
>
> On Tue, Apr 21, 2009 at 8:38 AM, Deny IP Any Any <denyipanyany at gmail.com> wrote:
>> is it possible your sudo is asking for a password? It'll save it the
>> first time you manually do it, but when ran from a script, it might
>> not.
>>
>> Your setup looks very similar to how I have several scripts setup:
>>
>> bwindle at wh-mon06:~$ more p10-jax-asa-cpu.sh
>> #!/bin/sh
>> NOW=`date +%d%b%Y-%H%M`
>>
>> ~rancid/bin/clogin -f /var/lib/rancid/.cloginrc -c 'ping web 192.168.122.12 ; sh
>> ow int web ; show cpu usage ; show processes cpu-hog' 192.168.121.11 > /home/bwi
>> ndle/jax-asa-failover/$NOW
>>
>>
>>
>>
>> --
>> deny ip any any (4393649193 matches)
>>
>>
>> On Mon, Apr 20, 2009 at 9:37 PM, Carlo Finotti <carlo.finotti at gmail.com> wrote:
>>> So I have been trying to use rancid with "clogin" to simply backups up
>>> my firewall running in multiple context mode.  When I run the command
>>> below from a ubuntu command line it works with no issues but if I add
>>> it to a bash script it breaks, any suggestions?
>>>
>>> sudo /usr/lib/rancid/bin/clogin -f /home/user/.cloginrc-firewall -c
>>> 'terminal pager 0; changeto context test; sh run; changeto context
>>> test1; changeto context test2; sh run; changeto context test3; exit'
>>> 10.2.2.1 > /home/user/backups/firewall-test.cfg
>>>
>>> If anyone has any suggestions on creating a bash script with "clogin"
>>> I would appreciate the feedback because I have been racking my brain
>>> :-\  And I am by no means a linux guru so that is why I am struggling.
>>>  My goal is to back up (4) separate firewalls, (3) core switches and
>>> (6) routers while making it as simple as possible.
>>>
>>> Thanks,
>>> Carlo
>>> _______________________________________________
>>> Rancid-discuss mailing list
>>> Rancid-discuss at shrubbery.net
>>> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>>>
>>
>


More information about the Rancid-discuss mailing list