[rancid] Re: Rancid & Enterasys B2/B3/N3/N7 switch

Valentino Vaia valvai81 at gmail.com
Thu Jan 28 17:36:34 UTC 2010


relychaure at free.fr ha scritto:
> Selon Valentino Vaia <valvai81 at gmail.com>:
>
>   
>> My mail address is  valvai81 at gmail.com .
>>
>> To correct the error
>>
>> sh: B2login: command not found
>> 192.168.1.1: missed cmd(s): show version,show config
>> 192.168.1.1: End of run not found
>>
>>
>> you must add to the $PATH variable the path of yours scripts  for example:
>> PATH=$PATH:/usr/local/rancid/bin
>>
>>
>>
>>
>>
>>     
> Hi,
> When I add PATH=$PATH:/home/rancid/bin in B2rancid script, I have an error :
> rancid at nsradminfedlog:~/bin$ ./B2rancid 192.168.1.1
> Can't modify constant item in scalar assignment at ./B2rancid line 48, near
> "$PATH:"
> syntax error at ./B2rancid line 48, near "$PATH:"
> "use" not allowed in expression at ./B2rancid line 49, at end of line
> Execution of ./B2rancid aborted due to compilation errors.
>
> I try with the user root but with the same result.
>
> So I add the PATH on rancid-run script.
> rancid at nsradminfedlog:~/bin$ ./rancid-run 192.168.1.1
>
> I have no error but when I verify the result on
> /home/rancid/var/logs/SW_SC_R.20100128.102727, I have nothing !!
>
> starting: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
>
> ending: jeudi 28 janvier 2010, 10:27:27 (UTC+0100)
>
> So I put the PATH on B2login :
> rancid at nsradminfedlog:~/bin$ ./B2rancid 192.168.1.1
> sh: B2login: command not found
> 192.168.1.1: missed cmd(s): show config
> 192.168.1.1: End of run not found
> !
> rancid at nsradminfedlog:~/bin$ ./B2login 192.168.1.1
> can't read "PATH": no such variable
>     while executing
> "PATH=$PATH:/home/rancid/bin"
>     (file "./B2login" line 53)
>
>
>
>
>
> ....
> An idea ??
>
>
>   
You haven't to modify the script.
At the shell prompt you must modify the $PATH for example

rancid at nsradminfedlog:~/bin$ PATH=$PATH:/home/rancid/bin


When you execute the rancid-run the $PATH variable is correct, but when 
you want try the script (perl B2rancid) you must specificate the correct 
PATH. This is true not only for my scripts (B2rancid and B2login) but 
also to all the Rancid scripts.
You can also modify the B2rancid in the line where is called the B2login
from:

system "B2login -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "B2login failed for $host: $!\n";


to:

system "/home/rancid/bin/B2login -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "B2login failed for $host: $!\n";







More information about the Rancid-discuss mailing list