Mailing List Archive

Dell N3048P, End of run not found. Regex issue?
Hi there

trying to get Rancid to work with a Dell N3048P. I'm running into probably the very same issues as here.
https://shrubbery.net/pipermail/rancid-discuss/2015-June/008426.html

During troubleshooting I have followed the steps in the FAQ (https://shrubbery.net/rancid/FAQ).

I have tried my best to get it to work and I've tried alot so I might miss a few things here in this post.

I've concluded that tlogin works fine for the login procedure, I've landed in that since that one has the same WHILE as described in the post above. Making it somewhat easier for me to modify:
bin/tlogin jg-dsw01
jg-dsw01
spawn ssh -x -l rancid jg-dsw01
rancid@jg-dsw01's password:

JG-DSW01>enable

JG-DSW01#
JG-DSW01#


I think the problem boils down to the exit "procedure" here.
JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.


When looking at the hostname.raw it looks like this:
eula-consent support-assist reject
eula-consent hiveagent reject
exit

JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.^M


So with that I thought that I need to modify the 'trandic' script, which I did. I copied it to a new name and modified the original 'if' line that would give a clean_run=1. Sadly, I'm horrible at regex but I've used a few online tools to verify the expression. I also added a PRINT line inside that scope so I would see if it went into it or not.

Original:
if (/[>#]\s?exit$/) {

Current:
if (/[>#]\s?exit.*$/) {

I've tried others more loose as well but nothing makes it go into that 'if' when I run it.

rancid@m5-server08:~$ bin/neo-jgdsw01-trancid -d jg-dsw01
executing tlogin -t 90 -c"show running-config" jg-dsw01
PROMPT MATCH: #
HIT COMMAND:JG-DSW01#show running-config
In ShowConfig: JG-DSW01#show running-config
jg-dsw01: End of run not found
jg-dsw01: clean_run is false
jg-dsw01: found_end is false
JG-DSW01>exitConnection to jg-dsw01 closed.
rancid@m5-server08:~$


I'm new to rancid and I honeslty have no idea where to go from here.

Does anyone have any pointers here? Any help greatly appreciated. Thanks.


--

Henrik


Disclaimer

This e-mail, its contents and any files transmitted with it are confidential and may be legally privileged. It is intended solely for the addressee(s) only. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance upon it. If you have received this e-mail in error, please notify us immediately and delete the material from your computer system. If you are an individual, you are hereby informed that Banijay companies as data controllers are, in accordance with the General Data Protection Regulation ("GDPR"), processing and disclosing your personal data in the carrying out of its business, including, where appropriate, transferring personal data outside the European Union/EEA-area and transferring personal data to other entities within the Banijay group for their own processing as data controllers. If you are an individual, you retain all of your rights under the GDPR and may send any GDPR-related inquiries to the respective Banijay company.
Re: Dell N3048P, End of run not found. Regex issue? [ In reply to ]
I forgot to mention,

this works:
bin/tlogin -c "show running-config" jg-dsw01

But the exit-line looks different from other switches.
eula-consent hiveagent reject
exit

JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.^M


Compared to the exit when I run the same on another switch. This is the last lines in the .raw file from that switch:
end
ip dhcp server
!
end
FH-ASW05#exit
Connection to fh-asw05 closed by remote host.^M
Connection to fh-asw05 closed.^M


That's why I landed in the conclusion that it must be that regex in my original post that's the culprit. But I'm honestly fumbling in the dark here. Maybe it's that 'end' word I should focus on. Hmm...


--
Henrik
________________________________
From: Rancid-discuss <rancid-discuss-bounces@www.shrubbery.net> on behalf of Henrik Cednert (Filmlance) <henrik.cednert@filmlance.se>
Sent: 23 June 2021 10:34
To: Rancid-discuss@www.shrubbery.net <Rancid-discuss@www.shrubbery.net>
Subject: [rancid] Dell N3048P, End of run not found. Regex issue?

Hi there

trying to get Rancid to work with a Dell N3048P. I'm running into probably the very same issues as here.
https://shrubbery.net/pipermail/rancid-discuss/2015-June/008426.html

During troubleshooting I have followed the steps in the FAQ (https://shrubbery.net/rancid/FAQ).

I have tried my best to get it to work and I've tried alot so I might miss a few things here in this post.

I've concluded that tlogin works fine for the login procedure, I've landed in that since that one has the same WHILE as described in the post above. Making it somewhat easier for me to modify:
bin/tlogin jg-dsw01
jg-dsw01
spawn ssh -x -l rancid jg-dsw01
rancid@jg-dsw01's password:

JG-DSW01>enable

JG-DSW01#
JG-DSW01#


I think the problem boils down to the exit "procedure" here.
JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.


When looking at the hostname.raw it looks like this:
eula-consent support-assist reject
eula-consent hiveagent reject
exit

JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.^M


So with that I thought that I need to modify the 'trandic' script, which I did. I copied it to a new name and modified the original 'if' line that would give a clean_run=1. Sadly, I'm horrible at regex but I've used a few online tools to verify the expression. I also added a PRINT line inside that scope so I would see if it went into it or not.

Original:
if (/[>#]\s?exit$/) {

Current:
if (/[>#]\s?exit.*$/) {

I've tried others more loose as well but nothing makes it go into that 'if' when I run it.

rancid@m5-server08:~$ bin/neo-jgdsw01-trancid -d jg-dsw01
executing tlogin -t 90 -c"show running-config" jg-dsw01
PROMPT MATCH: #
HIT COMMAND:JG-DSW01#show running-config
In ShowConfig: JG-DSW01#show running-config
jg-dsw01: End of run not found
jg-dsw01: clean_run is false
jg-dsw01: found_end is false
JG-DSW01>exitConnection to jg-dsw01 closed.
rancid@m5-server08:~$


I'm new to rancid and I honeslty have no idea where to go from here.

Does anyone have any pointers here? Any help greatly appreciated. Thanks.


--

Henrik


Disclaimer


This e-mail, its contents and any files transmitted with it are confidential and may be legally privileged. It is intended solely for the addressee(s) only. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance upon it. If you have received this e-mail in error, please notify us immediately and delete the material from your computer system. If you are an individual, you are hereby informed that Banijay companies as data controllers are, in accordance with the General Data Protection Regulation (?GDPR?), processing and disclosing your personal data in the carrying out of its business, including, where appropriate, transferring personal data outside the European Union/EEA-area and transferring personal data to other entities within the Banijay group for their own processing as data controllers. If you are an individual, you retain all of your rights under the GDPR and may send any GDPR-related inquiries to the respective Banijay company.
Re: Dell N3048P, End of run not found. Regex issue? [ In reply to ]
So actually, I got it to work. Not sure if it's proper by-the-book and elegant solution or not, but hey... if it works it works.

I had to change the lines giving successful return in ShowVersion and ShowConfig in the 'trancid' that I used here. And I'm also using my previously modified 'find exit'.

ShowVersion:

old: if (/^$prompt/) { $found_version=1; last};
new: if (/^.*[#>].*$/) { $found_version=1; last};


ShowConfig:
old: if (/^$prompt/) { $found_end=1; $clean_run=1; return 0};
new: if (/^.*[#>].*$/) { $found_end=1; $clean_run=1; return 0 };

And in the TOP: while(<INPUT>) { tr/\015//d;

old: if (/[>#]\s?exit$/) {
new: if (/[>#]\s?exit.*$/) {


Cheers


--
Henrik
________________________________
From: Rancid-discuss <rancid-discuss-bounces@www.shrubbery.net> on behalf of Henrik Cednert (Filmlance) <henrik.cednert@filmlance.se>
Sent: 23 June 2021 10:51
To: Rancid-discuss@www.shrubbery.net <Rancid-discuss@www.shrubbery.net>
Subject: Re: [rancid] Dell N3048P, End of run not found. Regex issue?

I forgot to mention,

this works:
bin/tlogin -c "show running-config" jg-dsw01

But the exit-line looks different from other switches.
eula-consent hiveagent reject
exit

JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.^M


Compared to the exit when I run the same on another switch. This is the last lines in the .raw file from that switch:
end
ip dhcp server
!
end
FH-ASW05#exit
Connection to fh-asw05 closed by remote host.^M
Connection to fh-asw05 closed.^M


That's why I landed in the conclusion that it must be that regex in my original post that's the culprit. But I'm honestly fumbling in the dark here. Maybe it's that 'end' word I should focus on. Hmm...


--
Henrik
________________________________
From: Rancid-discuss <rancid-discuss-bounces@www.shrubbery.net> on behalf of Henrik Cednert (Filmlance) <henrik.cednert@filmlance.se>
Sent: 23 June 2021 10:34
To: Rancid-discuss@www.shrubbery.net <Rancid-discuss@www.shrubbery.net>
Subject: [rancid] Dell N3048P, End of run not found. Regex issue?

Hi there

trying to get Rancid to work with a Dell N3048P. I'm running into probably the very same issues as here.
https://shrubbery.net/pipermail/rancid-discuss/2015-June/008426.html

During troubleshooting I have followed the steps in the FAQ (https://shrubbery.net/rancid/FAQ).

I have tried my best to get it to work and I've tried alot so I might miss a few things here in this post.

I've concluded that tlogin works fine for the login procedure, I've landed in that since that one has the same WHILE as described in the post above. Making it somewhat easier for me to modify:
bin/tlogin jg-dsw01
jg-dsw01
spawn ssh -x -l rancid jg-dsw01
rancid@jg-dsw01's password:

JG-DSW01>enable

JG-DSW01#
JG-DSW01#


I think the problem boils down to the exit "procedure" here.
JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.


When looking at the hostname.raw it looks like this:
eula-consent support-assist reject
eula-consent hiveagent reject
exit

JG-DSW01#exit

JG-DSW01>exitConnection to jg-dsw01 closed.^M


So with that I thought that I need to modify the 'trandic' script, which I did. I copied it to a new name and modified the original 'if' line that would give a clean_run=1. Sadly, I'm horrible at regex but I've used a few online tools to verify the expression. I also added a PRINT line inside that scope so I would see if it went into it or not.

Original:
if (/[>#]\s?exit$/) {

Current:
if (/[>#]\s?exit.*$/) {

I've tried others more loose as well but nothing makes it go into that 'if' when I run it.

rancid@m5-server08:~$ bin/neo-jgdsw01-trancid -d jg-dsw01
executing tlogin -t 90 -c"show running-config" jg-dsw01
PROMPT MATCH: #
HIT COMMAND:JG-DSW01#show running-config
In ShowConfig: JG-DSW01#show running-config
jg-dsw01: End of run not found
jg-dsw01: clean_run is false
jg-dsw01: found_end is false
JG-DSW01>exitConnection to jg-dsw01 closed.
rancid@m5-server08:~$


I'm new to rancid and I honeslty have no idea where to go from here.

Does anyone have any pointers here? Any help greatly appreciated. Thanks.


--

Henrik


Disclaimer


This e-mail, its contents and any files transmitted with it are confidential and may be legally privileged. It is intended solely for the addressee(s) only. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance upon it. If you have received this e-mail in error, please notify us immediately and delete the material from your computer system. If you are an individual, you are hereby informed that Banijay companies as data controllers are, in accordance with the General Data Protection Regulation (?GDPR?), processing and disclosing your personal data in the carrying out of its business, including, where appropriate, transferring personal data outside the European Union/EEA-area and transferring personal data to other entities within the Banijay group for their own processing as data controllers. If you are an individual, you retain all of your rights under the GDPR and may send any GDPR-related inquiries to the respective Banijay company.
Re: Dell N3048P, End of run not found. Regex issue? [ In reply to ]
Wed, Jun 23, 2021 at 08:34:25AM +0000, Henrik Cednert (Filmlance):
> Hi there
>
> trying to get Rancid to work with a Dell N3048P. I'm running into probably the very same issues as here.
> https://shrubbery.net/pipermail/rancid-discuss/2015-June/008426.html
>
> During troubleshooting I have followed the steps in the FAQ (https://shrubbery.net/rancid/FAQ).
>
> I have tried my best to get it to work and I've tried alot so I might miss a few things here in this post.
>
> I've concluded that tlogin works fine for the login procedure, I've landed in that since that one has the same WHILE as described in the post above. Making it somewhat easier for me to modify:
> bin/tlogin jg-dsw01
> jg-dsw01
> spawn ssh -x -l rancid jg-dsw01
> rancid@jg-dsw01's password:
>
> JG-DSW01>enable
>
> JG-DSW01#
> JG-DSW01#
>
>
> I think the problem boils down to the exit "procedure" here.
> JG-DSW01#exit
>
> JG-DSW01>exitConnection to jg-dsw01 closed.
>
>
> When looking at the hostname.raw it looks like this:
> eula-consent support-assist reject
> eula-consent hiveagent reject
> exit
>
> JG-DSW01#exit
>
> JG-DSW01>exitConnection to jg-dsw01 closed.^M
>
>
> So with that I thought that I need to modify the 'trandic' script, which I did. I copied it to a new name and modified the original 'if' line that would give a clean_run=1. Sadly, I'm horrible at regex but I've used a few online tools to verify the expression. I also added a PRINT line inside that scope so I would see if it went into it or not.

Hi. What device type are you using for this device in your router.db
configuration file? I am not familiar with the N3048, but it looks like
it is just a switch. So, I would expect it to be device type 'dell' or
'smc'. Could you try one of those?

> Original:
> if (/[>#]\s?exit$/) {
>
> Current:
> if (/[>#]\s?exit.*$/) {
>
> I've tried others more loose as well but nothing makes it go into that 'if' when I run it.
>
> rancid@m5-server08:~$ bin/neo-jgdsw01-trancid -d jg-dsw01
> executing tlogin -t 90 -c"show running-config" jg-dsw01
> PROMPT MATCH: #
> HIT COMMAND:JG-DSW01#show running-config
> In ShowConfig: JG-DSW01#show running-config
> jg-dsw01: End of run not found
> jg-dsw01: clean_run is false
> jg-dsw01: found_end is false
> JG-DSW01>exitConnection to jg-dsw01 closed.
> rancid@m5-server08:~$
>
>
> I'm new to rancid and I honeslty have no idea where to go from here.
>
> Does anyone have any pointers here? Any help greatly appreciated. Thanks.
>
>
> --
>
> Henrik
>
>
> Disclaimer
>
> This e-mail, its contents and any files transmitted with it are confidential and may be legally privileged. It is intended solely for the addressee(s) only. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance upon it. If you have received this e-mail in error, please notify us immediately and delete the material from your computer system. If you are an individual, you are hereby informed that Banijay companies as data controllers are, in accordance with the General Data Protection Regulation ("GDPR"), processing and disclosing your personal data in the carrying out of its business, including, where appropriate, transferring personal data outside the European Union/EEA-area and transferring personal data to other entities within the Banijay group for their own processing as data controllers. If you are an individual, you retain all of your rights under the GDPR and may send any GDPR-related inquiries to the respective Banijay company.

> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@www.shrubbery.net
> https://www.shrubbery.net/mailman/listinfo/rancid-discuss

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Dell N3048P, End of run not found. Regex issue? [ In reply to ]
Hello

Accidently missed the proper rancid-dicuss email in my first answer, sorry for that.

As seen in the following posts I got it to work. But I will post those details here if someone else has the same problem and runs into this thread. This is probably not the best solution nor good practice. But it works for us so I'll keep it like this, there are funnier things to do in life then mess with rancid configs. =)

In addition to the other posts with the solution to my problem this is how my config looks like:

/var/lib/rancid/observium/router.db
jg-dsw01;neo-dell;up

/var/lib/rancid/.cloginrc
add method jg-dsw01 ssh
add autoenable jg-dsw01 0
add user jg-dsw01 username
add password jg-dsw01 password

/etc/rancid/rancid.types.conf
neo-dell;script;neo-jgdsw01-trancid
neo-dell;login;clogin
neo-dell;module;nxos
neo-dell;inloop;nxos::inloop
neo-dell;command;nxos::ShowVersion;show version
neo-dell;command;nxos::WriteTerm;show running-config


And the changes I've done in neo-jgdsw01-trancid compared to vanilla trancid was described in previous post. Without those changed it will NOT work.

So, with all this it works. Probably not correct. But it works and life goes on. =)

cheers

--
Henrik


________________________________
From: heasley <heas@shrubbery.net>
Sent: 23 June 2021 21:30
To: Henrik Cednert (Filmlance) <henrik.cednert@filmlance.se>
Cc: rancid-discuss@shrubbery.net <rancid-discuss@shrubbery.net>
Subject: Re: [rancid] Dell N3048P, End of run not found. Regex issue?

Wed, Jun 23, 2021 at 08:34:25AM +0000, Henrik Cednert (Filmlance):
> Hi there
>
> trying to get Rancid to work with a Dell N3048P. I'm running into probably the very same issues as here.
> https://shrubbery.net/pipermail/rancid-discuss/2015-June/008426.html
>
> During troubleshooting I have followed the steps in the FAQ (https://shrubbery.net/rancid/FAQ).
>
> I have tried my best to get it to work and I've tried alot so I might miss a few things here in this post.
>
> I've concluded that tlogin works fine for the login procedure, I've landed in that since that one has the same WHILE as described in the post above. Making it somewhat easier for me to modify:
> bin/tlogin jg-dsw01
> jg-dsw01
> spawn ssh -x -l rancid jg-dsw01
> rancid@jg-dsw01's password:
>
> JG-DSW01>enable
>
> JG-DSW01#
> JG-DSW01#
>
>
> I think the problem boils down to the exit "procedure" here.
> JG-DSW01#exit
>
> JG-DSW01>exitConnection to jg-dsw01 closed.
>
>
> When looking at the hostname.raw it looks like this:
> eula-consent support-assist reject
> eula-consent hiveagent reject
> exit
>
> JG-DSW01#exit
>
> JG-DSW01>exitConnection to jg-dsw01 closed.^M
>
>
> So with that I thought that I need to modify the 'trandic' script, which I did. I copied it to a new name and modified the original 'if' line that would give a clean_run=1. Sadly, I'm horrible at regex but I've used a few online tools to verify the expression. I also added a PRINT line inside that scope so I would see if it went into it or not.

Hi. What device type are you using for this device in your router.db
configuration file? I am not familiar with the N3048, but it looks like
it is just a switch. So, I would expect it to be device type 'dell' or
'smc'. Could you try one of those?

> Original:
> if (/[>#]\s?exit$/) {
>
> Current:
> if (/[>#]\s?exit.*$/) {
>
> I've tried others more loose as well but nothing makes it go into that 'if' when I run it.
>
> rancid@m5-server08:~$ bin/neo-jgdsw01-trancid -d jg-dsw01
> executing tlogin -t 90 -c"show running-config" jg-dsw01
> PROMPT MATCH: #
> HIT COMMAND:JG-DSW01#show running-config
> In ShowConfig: JG-DSW01#show running-config
> jg-dsw01: End of run not found
> jg-dsw01: clean_run is false
> jg-dsw01: found_end is false
> JG-DSW01>exitConnection to jg-dsw01 closed.
> rancid@m5-server08:~$
>
>
> I'm new to rancid and I honeslty have no idea where to go from here.
>
> Does anyone have any pointers here? Any help greatly appreciated. Thanks.
>
>
> --
>
> Henrik
>
>
> Disclaimer
>
> This e-mail, its contents and any files transmitted with it are confidential and may be legally privileged. It is intended solely for the addressee(s) only. If you are not the intended recipient, you must not copy, distribute, or take any action in reliance upon it. If you have received this e-mail in error, please notify us immediately and delete the material from your computer system. If you are an individual, you are hereby informed that Banijay companies as data controllers are, in accordance with the General Data Protection Regulation ("GDPR"), processing and disclosing your personal data in the carrying out of its business, including, where appropriate, transferring personal data outside the European Union/EEA-area and transferring personal data to other entities within the Banijay group for their own processing as data controllers. If you are an individual, you retain all of your rights under the GDPR and may send any GDPR-related inquiries to the respective Banijay company.

> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@www.shrubbery.net
> https://www.shrubbery.net/mailman/listinfo/rancid-discuss