Discussion:
[rancid] New device type
Rod Hendricks
2015-12-16 10:49:46 UTC
Permalink
Hi.

I am really struggling with getting a new device type up and running.

Rancid v3.2, installed into Centos 7 with yum from EPEL repo. I have an
installation that is currently working against a test Cisco router, so I
know the base install is all good.

I have created a login script hmlogin (based off complogin, with session
paginate commented out)
I have created a perl script hirschmann.pm (based on ciscowlc.om).

rancid.types.conf:
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config

I can run it directly with hmlogin -c"show running-config" 192.168.254.103
I get no errors running this, and I get the output expected.

However, when I run the following: rancid -d -thirschmann 192.168.254.103
I get:
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
PROMPT MATCH:
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
192.168.254.103: missed cmd(s): all commands
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!
-bash-4.2$

The .raw file has the full correct output of the show running-config.
The .new file only has:
!RANCID-CONTENT-TYPE: hirschmann
!

I feel oh so close to getting this running! Appreciate any help that can
be offered.

Cheers,
Rod.
Rod Hendricks
2015-12-16 14:50:12 UTC
Permalink
This post might be inappropriate. Click to display it.
Dan Anderson
2015-12-16 15:07:29 UTC
Permalink
ShowConfig in ciscowlc.pm uses the line counting method.

while (<$INPUT>) {
<---SNIP--->

$linecnt++;
<---SNIP--->

# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);


WriteTerm in ios.pm looks for the "end" keyword.

On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks <
Post by Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally defines this
delimiter? I would be happy to settle for the moment in just
short-circuiting this delimiter check so I can I can get the job running.
Have included device config below. Don't worry about the passwords - its a
test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays all options
that are valid for the 'normal' command forms of that particular mode.
For a list of valid 'no' command forms for that mode, enter the help
command 'no ?'. For the syntax of a particular command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !, ", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by foreign host.
-bash-4.2$
Cheers,
Rod.
It sounds like it's not finding an end-of-configuration delimiter. I'm
not familiar with the device type, but for Cisco devices, it usually looks
for the keyword "end" by itself at the end of "show run" to determine
whether or not it has successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of config, etc. Without knowing
more about the configuration file format, I can't say which method (if
either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks <
Post by Rod Hendricks
Hi.
I am really struggling with getting a new device type up and running.
Rancid v3.2, installed into Centos 7 with yum from EPEL repo. I have an
installation that is currently working against a test Cisco router, so I
know the base install is all good.
I have created a login script hmlogin (based off complogin, with session
paginate commented out)
I have created a perl script hirschmann.pm (based on ciscowlc.om).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config
I can run it directly with hmlogin -c"show running-config"
192.168.254.103
I get no errors running this, and I get the output expected.
However, when I run the following: rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
192.168.254.103: missed cmd(s): all commands
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!
-bash-4.2$
The .raw file has the full correct output of the show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running! Appreciate any help that
can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
Rod Hendricks
2015-12-16 15:26:11 UTC
Permalink
I don't fully understand the purpose of WriteTerm. But from what you are
saying above, is my rancid.types.conf in my original post wrong? Should

hirschmann;command;hirschmann::WriteTerm;show running-config

in fact look like

hirschmann;command;hirschmann::ShowConfig;show running-config

?
If so, I guess I've messed that up by not understanding the significance of
that keyword. Rancid server is on my work dev box - will try this out in
12hrs when i get back to the office.

Thanks again.

Cheers,
Rod.
Post by Dan Anderson
ShowConfig in ciscowlc.pm uses the line counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm looks for the "end" keyword.
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks <
Post by Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally defines this
delimiter? I would be happy to settle for the moment in just
short-circuiting this delimiter check so I can I can get the job running.
Have included device config below. Don't worry about the passwords - its a
test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays all options
that are valid for the 'normal' command forms of that particular mode.
For a list of valid 'no' command forms for that mode, enter the help
command 'no ?'. For the syntax of a particular command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !, ", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by foreign host.
-bash-4.2$
Cheers,
Rod.
It sounds like it's not finding an end-of-configuration delimiter. I'm
not familiar with the device type, but for Cisco devices, it usually looks
for the keyword "end" by itself at the end of "show run" to determine
whether or not it has successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of config, etc. Without knowing
more about the configuration file format, I can't say which method (if
either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks <
Post by Rod Hendricks
Hi.
I am really struggling with getting a new device type up and running.
Rancid v3.2, installed into Centos 7 with yum from EPEL repo. I have
an installation that is currently working against a test Cisco router, so I
know the base install is all good.
I have created a login script hmlogin (based off complogin, with
session paginate commented out)
I have created a perl script hirschmann.pm (based on ciscowlc.om).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config
I can run it directly with hmlogin -c"show running-config"
192.168.254.103
I get no errors running this, and I get the output expected.
However, when I run the following: rancid -d -thirschmann
192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
192.168.254.103: missed cmd(s): all commands
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!
-bash-4.2$
The .raw file has the full correct output of the show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running! Appreciate any help that
can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
Dan Anderson
2015-12-16 15:57:40 UTC
Permalink
That field is basically a call to a subroutine within the module so if you
copied ciscowlc.pm, you'd need to use ShowConfig as WriteTerm doesn't exist
in that module.

On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks <
Post by Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from what you are
saying above, is my rancid.types.conf in my original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
?
If so, I guess I've messed that up by not understanding the significance
of that keyword. Rancid server is on my work dev box - will try this out
in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
Post by Dan Anderson
ShowConfig in ciscowlc.pm uses the line counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm looks for the "end" keyword.
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks <
Post by Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally defines this
delimiter? I would be happy to settle for the moment in just
short-circuiting this delimiter check so I can I can get the job running.
Have included device config below. Don't worry about the passwords - its a
test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays all options
that are valid for the 'normal' command forms of that particular mode.
For a list of valid 'no' command forms for that mode, enter the help
command 'no ?'. For the syntax of a particular command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !, ", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by foreign host.
-bash-4.2$
Cheers,
Rod.
It sounds like it's not finding an end-of-configuration delimiter. I'm
not familiar with the device type, but for Cisco devices, it usually looks
for the keyword "end" by itself at the end of "show run" to determine
whether or not it has successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of config, etc. Without knowing
more about the configuration file format, I can't say which method (if
either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks <
Post by Rod Hendricks
Hi.
I am really struggling with getting a new device type up and running.
Rancid v3.2, installed into Centos 7 with yum from EPEL repo. I have
an installation that is currently working against a test Cisco router, so I
know the base install is all good.
I have created a login script hmlogin (based off complogin, with
session paginate commented out)
I have created a perl script hirschmann.pm (based on ciscowlc.om).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config
I can run it directly with hmlogin -c"show running-config"
192.168.254.103
I get no errors running this, and I get the output expected.
However, when I run the following: rancid -d -thirschmann
192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
192.168.254.103: missed cmd(s): all commands
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!
-bash-4.2$
The .raw file has the full correct output of the show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running! Appreciate any help that
can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
Rod Hendricks
2015-12-17 06:01:40 UTC
Permalink
I'm getting closer.

rancid.types.conf now looks like this:-
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::ShowConfig;show running-config

Output now looks like this:-
-bash-4.2$ rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
PROMPT MATCH:
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
In ShowConfig: (Hirschmann Railswitch) #show running-config
Exiting ShowConfig:
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!--WLC End Config Data--!
-bash-4.2$

.raw file still looks correct.

.new file looks like:-
!RANCID-CONTENT-TYPE: hirschmann
!

!--WLC Begin Config Data--!

!--WLC End Config Data--!

Ideas?

Cheers,
Rod.
Post by Dan Anderson
That field is basically a call to a subroutine within the module so if you
copied ciscowlc.pm, you'd need to use ShowConfig as WriteTerm doesn't
exist in that module.
On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks <
Post by Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from what you are
saying above, is my rancid.types.conf in my original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
?
If so, I guess I've messed that up by not understanding the significance
of that keyword. Rancid server is on my work dev box - will try this out
in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
Post by Dan Anderson
ShowConfig in ciscowlc.pm uses the line counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm looks for the "end" keyword.
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks <
Post by Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally defines this
delimiter? I would be happy to settle for the moment in just
short-circuiting this delimiter check so I can I can get the job running.
Have included device config below. Don't worry about the passwords - its a
test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays all options
that are valid for the 'normal' command forms of that particular mode.
For a list of valid 'no' command forms for that mode, enter the help
command 'no ?'. For the syntax of a particular command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !, ", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by foreign host.
-bash-4.2$
Cheers,
Rod.
On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson <
It sounds like it's not finding an end-of-configuration delimiter. I'm
not familiar with the device type, but for Cisco devices, it usually looks
for the keyword "end" by itself at the end of "show run" to determine
whether or not it has successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of config, etc. Without knowing
more about the configuration file format, I can't say which method (if
either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks <
Post by Rod Hendricks
Hi.
I am really struggling with getting a new device type up and running.
Rancid v3.2, installed into Centos 7 with yum from EPEL repo. I have
an installation that is currently working against a test Cisco router, so I
know the base install is all good.
I have created a login script hmlogin (based off complogin, with
session paginate commented out)
I have created a perl script hirschmann.pm (based on ciscowlc.om).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config
I can run it directly with hmlogin -c"show running-config" 192.168.254.103
I get no errors running this, and I get the output expected.
However, when I run the following: rancid -d -thirschmann
192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
192.168.254.103: missed cmd(s): all commands
192.168.254.103: End of run not found
192.168.254.103: End of run not found
!
-bash-4.2$
The .raw file has the full correct output of the show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running! Appreciate any help that
can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
Alan McKinnon
2015-12-17 06:16:27 UTC
Permalink
That's a fairly common error, but it never has a common solution.

Basically, your script read the raw file, detected the start of "show
running-config" and started to process it in sub ShowConfig()

However, the script didn't find the end of that output for whatever
reason and processing fell all the way through to the very end with the
error "End of run not found". You will have to dig into the script and
find what it uses for that. There's a main loop in ShowConfig() and it
will have a regex exit condition (possibly "end" followed by a prompt or
something similar).

Carefully examine the raw file to see what your device put out, and make
ShowConfig() match.
Post by Rod Hendricks
I'm getting closer.
rancid.types.conf now looks like this:-
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::ShowConfig;show running-config
Output now looks like this:-
-bash-4.2$ rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
In ShowConfig: (Hirschmann Railswitch) #show running-config
192.168.254.103 <http://192.168.254.103>: End of run not found
192.168.254.103 <http://192.168.254.103>: End of run not found
!--WLC End Config Data--!
-bash-4.2$
.raw file still looks correct.
.new file looks like:-
!RANCID-CONTENT-TYPE: hirschmann
!
!--WLC Begin Config Data--!
!--WLC End Config Data--!
Ideas?
Cheers,
Rod.
That field is basically a call to a subroutine within the module so
if you copied ciscowlc.pm <http://ciscowlc.pm>, you'd need to use
ShowConfig as WriteTerm doesn't exist in that module.
On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from
what you are saying above, is my rancid.types.conf in my
original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
?
If so, I guess I've messed that up by not understanding the
significance of that keyword. Rancid server is on my work dev
box - will try this out in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
On Wed, Dec 16, 2015 at 11:07 PM, Dan Anderson
ShowConfig in ciscowlc.pm <http://ciscowlc.pm> uses the line
counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm <http://ios.pm> looks for the "end" keyword.
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally
defines this delimiter? I would be happy to settle for
the moment in just short-circuiting this delimiter check
so I can I can get the job running. Have included
device config below. Don't worry about the passwords -
its a test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation
and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays
all options
that are valid for the 'normal' command forms of
that particular mode.
For a list of valid 'no' command forms for that
mode, enter the help
command 'no ?'. For the syntax of a particular
command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !,
", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of
configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by
foreign host.
-bash-4.2$
Cheers,
Rod.
On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson
It sounds like it's not finding an
end-of-configuration delimiter. I'm not familiar
with the device type, but for Cisco devices, it
usually looks for the keyword "end" by itself at the
end of "show run" to determine whether or not it has
successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of
config, etc. Without knowing more about the
configuration file format, I can't say which method
(if either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks
Hi.
I am really struggling with getting a new device
type up and running.
Rancid v3.2, installed into Centos 7 with yum
from EPEL repo. I have an installation that is
currently working against a test Cisco router,
so I know the base install is all good.
I have created a login script hmlogin (based off
complogin, with session paginate commented out)
I have created a perl script hirschmann.pm
<http://hirschmann.pm> (based on ciscowlc.om
<http://ciscowlc.om>).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show
running-config
I can run it directly with hmlogin -c"show
running-config" 192.168.254.103
I get no errors running this, and I get the
output expected.
However, when I run the following: rancid -d
-thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config"
192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
192.168.254.103 <http://192.168.254.103>: missed
cmd(s): all commands
192.168.254.103 <http://192.168.254.103>: End of
run not found
192.168.254.103 <http://192.168.254.103>: End of
run not found
!
-bash-4.2$
The .raw file has the full correct output of the
show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running!
Appreciate any help that can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
***@gmail.com
Rod Hendricks
2015-12-17 08:06:13 UTC
Permalink
Thanks for the help Alan.

My perl module is based on the builtin ciscowlc module.

The exit condition (if I've understood you correctly) is this:-

ProcessHistory("","","","\n!--WLC End Config Data--!\n");
print STDERR " Exiting ShowConfig: $_" if ($debug);
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {

$found_end = 1;
return(1);
}

It seems like the perl module is telling me the file is short, but the raw
file is definitely the full show running-config output.

I'm kinda lost now :/

Cheers,
Rod.
Post by Alan McKinnon
That's a fairly common error, but it never has a common solution.
Basically, your script read the raw file, detected the start of "show
running-config" and started to process it in sub ShowConfig()
However, the script didn't find the end of that output for whatever
reason and processing fell all the way through to the very end with the
error "End of run not found". You will have to dig into the script and
find what it uses for that. There's a main loop in ShowConfig() and it
will have a regex exit condition (possibly "end" followed by a prompt or
something similar).
Carefully examine the raw file to see what your device put out, and make
ShowConfig() match.
Post by Rod Hendricks
I'm getting closer.
rancid.types.conf now looks like this:-
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::ShowConfig;show running-config
Output now looks like this:-
-bash-4.2$ rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
In ShowConfig: (Hirschmann Railswitch) #show running-config
192.168.254.103 <http://192.168.254.103>: End of run not found
192.168.254.103 <http://192.168.254.103>: End of run not found
!--WLC End Config Data--!
-bash-4.2$
.raw file still looks correct.
.new file looks like:-
!RANCID-CONTENT-TYPE: hirschmann
!
!--WLC Begin Config Data--!
!--WLC End Config Data--!
Ideas?
Cheers,
Rod.
That field is basically a call to a subroutine within the module so
if you copied ciscowlc.pm <http://ciscowlc.pm>, you'd need to use
ShowConfig as WriteTerm doesn't exist in that module.
On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from
what you are saying above, is my rancid.types.conf in my
original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
?
If so, I guess I've messed that up by not understanding the
significance of that keyword. Rancid server is on my work dev
box - will try this out in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
On Wed, Dec 16, 2015 at 11:07 PM, Dan Anderson
ShowConfig in ciscowlc.pm <http://ciscowlc.pm> uses the line
counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm <http://ios.pm> looks for the "end"
keyword.
Post by Rod Hendricks
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally
defines this delimiter? I would be happy to settle for
the moment in just short-circuiting this delimiter check
so I can I can get the job running. Have included
device config below. Don't worry about the passwords -
its a test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation
and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays
all options
that are valid for the 'normal' command forms of
that particular mode.
For a list of valid 'no' command forms for that
mode, enter the help
command 'no ?'. For the syntax of a particular
command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !,
", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of
configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by
foreign host.
-bash-4.2$
Cheers,
Rod.
On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson
It sounds like it's not finding an
end-of-configuration delimiter. I'm not familiar
with the device type, but for Cisco devices, it
usually looks for the keyword "end" by itself at the
end of "show run" to determine whether or not it has
successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of
config, etc. Without knowing more about the
configuration file format, I can't say which method
(if either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks
Hi.
I am really struggling with getting a new device
type up and running.
Rancid v3.2, installed into Centos 7 with yum
from EPEL repo. I have an installation that is
currently working against a test Cisco router,
so I know the base install is all good.
I have created a login script hmlogin (based off
complogin, with session paginate commented out)
I have created a perl script hirschmann.pm
<http://hirschmann.pm> (based on ciscowlc.om
<http://ciscowlc.om>).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show
running-config
I can run it directly with hmlogin -c"show
running-config" 192.168.254.103
I get no errors running this, and I get the
output expected.
However, when I run the following: rancid -d
-thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config"
192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
192.168.254.103 <http://192.168.254.103>: missed
cmd(s): all commands
192.168.254.103 <http://192.168.254.103>: End of
run not found
192.168.254.103 <http://192.168.254.103>: End of
run not found
!
-bash-4.2$
The .raw file has the full correct output of the
show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running!
Appreciate any help that can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Post by Rod Hendricks
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Alan McKinnon
2015-12-17 09:32:00 UTC
Permalink
Post by Rod Hendricks
Thanks for the help Alan.
My perl module is based on the builtin ciscowlc module.
The exit condition (if I've understood you correctly) is this:-
ProcessHistory("","","","\n!--WLC End Config Data--!\n");
print STDERR " Exiting ShowConfig: $_" if ($debug);
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
It seems like the perl module is telling me the file is short, but the
raw file is definitely the full show running-config output.
I'm kinda lost now :/
No need to be lost. The comment that the WLC lacks an end of config
marker is the clue - whatever code detects the end is not correct.

Can you do the following please:

- post the full script you are using
- a copy-paste of show run on a real device. The first and last 5 lines
ought to be enough,
plus the prompt after the end. One of the things I want to see is if the
device issues a
proper EOL at the end of show run. redact anything private from the
output first of course
Post by Rod Hendricks
Cheers,
Rod.
That's a fairly common error, but it never has a common solution.
Basically, your script read the raw file, detected the start of "show
running-config" and started to process it in sub ShowConfig()
However, the script didn't find the end of that output for whatever
reason and processing fell all the way through to the very end with the
error "End of run not found". You will have to dig into the script and
find what it uses for that. There's a main loop in ShowConfig() and it
will have a regex exit condition (possibly "end" followed by a prompt or
something similar).
Carefully examine the raw file to see what your device put out, and make
ShowConfig() match.
Post by Rod Hendricks
I'm getting closer.
rancid.types.conf now looks like this:-
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::ShowConfig;show running-config
Output now looks like this:-
-bash-4.2$ rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in /etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
In ShowConfig: (Hirschmann Railswitch) #show running-config
192.168.254.103 <http://192.168.254.103>: End of run not found
192.168.254.103 <http://192.168.254.103>: End of run not found
!--WLC End Config Data--!
-bash-4.2$
.raw file still looks correct.
.new file looks like:-
!RANCID-CONTENT-TYPE: hirschmann
!
!--WLC Begin Config Data--!
!--WLC End Config Data--!
Ideas?
Cheers,
Rod.
That field is basically a call to a subroutine within the module so
if you copied ciscowlc.pm <http://ciscowlc.pm>
<http://ciscowlc.pm>, you'd need to use
Post by Rod Hendricks
ShowConfig as WriteTerm doesn't exist in that module.
On Wed, Dec 16, 2015 at 10:26 AM, Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from
what you are saying above, is my rancid.types.conf in my
original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
?
If so, I guess I've messed that up by not understanding the
significance of that keyword. Rancid server is on my work dev
box - will try this out in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
On Wed, Dec 16, 2015 at 11:07 PM, Dan Anderson
ShowConfig in ciscowlc.pm <http://ciscowlc.pm>
<http://ciscowlc.pm> uses the line
Post by Rod Hendricks
counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm <http://ios.pm> <http://ios.pm>
looks for the "end" keyword.
Post by Rod Hendricks
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally
defines this delimiter? I would be happy to
settle for
Post by Rod Hendricks
the moment in just short-circuiting this
delimiter check
Post by Rod Hendricks
so I can I can get the job running. Have included
device config below. Don't worry about the
passwords -
Post by Rod Hendricks
its a test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann
Automation
Post by Rod Hendricks
and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
00:80:63:F6:02:F7
Post by Rod Hendricks
System Time: 2015-01-02
10:11:52
Post by Rod Hendricks
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help
displays
Post by Rod Hendricks
all options
that are valid for the 'normal' command
forms of
Post by Rod Hendricks
that particular mode.
For a list of valid 'no' command forms for that
mode, enter the help
command 'no ?'. For the syntax of a particular
command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
\, !,
Post by Rod Hendricks
", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of
configuration determined by
! DIP switch (cannot be overridden by
management)
Post by Rod Hendricks
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by
foreign host.
-bash-4.2$
Cheers,
Rod.
On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson
It sounds like it's not finding an
end-of-configuration delimiter. I'm not familiar
with the device type, but for Cisco devices, it
usually looks for the keyword "end" by itself at the
end of "show run" to determine whether or not it has
successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of
config, etc. Without knowing more about the
configuration file format, I can't say which method
(if either) would work for your situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks
Hi.
I am really struggling with getting a new device
type up and running.
Rancid v3.2, installed into Centos 7 with yum
from EPEL repo. I have an installation that is
currently working against a test Cisco router,
so I know the base install is all good.
I have created a login script hmlogin (based off
complogin, with session paginate commented out)
I have created a perl scripthirschmann.pm <http://hirschmann.pm>
<http://hirschmann.pm> (based on ciscowlc.om <http://ciscowlc.om>
<http://ciscowlc.om>).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show
running-config
I can run it directly with hmlogin -c"show
running-config" 192.168.254.103
I get no errors running this, and I get the
output expected.
However, when I run the following: rancid -d
-thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config"
192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
HIT COMMAND:(Hirschmann Railswitch) #show
running-config
missed
Post by Rod Hendricks
cmd(s): all commands
End of
Post by Rod Hendricks
run not found
End of
Post by Rod Hendricks
run not found
!
-bash-4.2$
The .raw file has the full correct output of the
show running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running!
Appreciate any help that can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Rod Hendricks
2015-12-18 03:20:06 UTC
Permalink
Thanks again to all who are helping with this.

I've culled some of the history as its getting a bit long.

Also not sure well attachments go in this list but I'm going to try. The
scripts are 99% based on existing, so there is lots of excess code in them
unfortunately. I'm just not proficient enough to remove the unnecessary
code.

The config I've posted before (see below)

Cheers,
Rod.
No need to be lost. The comment that the WLC lacks an end of config marker
is the clue - whatever code detects the end is not correct.
- post the full script you are using
- a copy-paste of show run on a real device. The first and last 5 lines
ought to be enough,
plus the prompt after the end. One of the things I want to see is if the
device issues a
proper EOL at the end of show run. redact anything private from the output
first of course
Post by Rod Hendricks
Post by Rod Hendricks
I'm getting closer.
rancid.types.conf now looks like this:-
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::ShowConfig;show running-config
Output now looks like this:-
-bash-4.2$ rancid -d -thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
Post by Rod Hendricks
executing hmlogin -t 90 -c"show running-config" 192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
In ShowConfig: (Hirschmann Railswitch) #show running-config
192.168.254.103 <http://192.168.254.103>: End of run not found
192.168.254.103 <http://192.168.254.103>: End of run not found
!--WLC End Config Data--!
-bash-4.2$
.raw file still looks correct.
.new file looks like:-
!RANCID-CONTENT-TYPE: hirschmann
!
!--WLC Begin Config Data--!
!--WLC End Config Data--!
Ideas?
Cheers,
Rod.
Don't worry about the
Post by Rod Hendricks
passwords -
Post by Rod Hendricks
its a test unit with factory default config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann
Automation
Post by Rod Hendricks
and Control GmbH
All rights reserved
Railswitch Release
L2E-08.0.09
Post by Rod Hendricks
(Build date 2015-04-06
21:32)
Post by Rod Hendricks
System Name: RS-F602F7
192.168.254.103
00:80:63:F6:02:F7
Post by Rod Hendricks
System Time: 2015-01-02
10:11:52
Post by Rod Hendricks
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help
displays
Post by Rod Hendricks
all options
that are valid for the 'normal' command
forms of
Post by Rod Hendricks
that particular mode.
For a list of valid 'no' command forms for
that
Post by Rod Hendricks
mode, enter the help
command 'no ?'. For the syntax of a
particular
Post by Rod Hendricks
command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
\, !,
Post by Rod Hendricks
", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE
1588)
Post by Rod Hendricks
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of
configuration determined by
! DIP switch (cannot be overridden by
management)
Post by Rod Hendricks
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by
foreign host.
-bash-4.2$
Cheers,
Rod.
Alan McKinnon
2015-12-16 16:28:00 UTC
Permalink
Post by Rod Hendricks
I don't fully understand the purpose of WriteTerm. But from what you
are saying above, is my rancid.types.conf in my original post wrong? Should
hirschmann;command;hirschmann::WriteTerm;show running-config
in fact look like
hirschmann;command;hirschmann::ShowConfig;show running-config
In ancient times, Cisco stuff had a command "write term" which, I
believe, outputted the config. A bizarre name, but that's what it was.
The name persists to this day and you'll still find rancid scripts that
run write term and/or show run. And you will find perl subs called
WriteTerm() used by both commands for processing.

The name of the sub can be changed if you also change all of it's
callers. Cisco kit made anytime this millenium likely uses show run to
dump the config, so use the command that is valid for your equipment.
Post by Rod Hendricks
?
If so, I guess I've messed that up by not understanding the significance
of that keyword. Rancid server is on my work dev box - will try this
out in 12hrs when i get back to the office.
Thanks again.
Cheers,
Rod.
ShowConfig in ciscowlc.pm <http://ciscowlc.pm> uses the line
counting method.
while (<$INPUT>) {
<---SNIP--->
$linecnt++;
<---SNIP--->
# WLC lacks a definitive "end of config" marker.
if ($linecnt > 5) {
$found_end = 1;
return(1);
}
return(0);
WriteTerm in ios.pm <http://ios.pm> looks for the "end" keyword.
On Wed, Dec 16, 2015 at 9:50 AM, Rod Hendricks
Thanks Dan.
Your explanation makes sense. Which script normally defines
this delimiter? I would be happy to settle for the moment in
just short-circuiting this delimiter check so I can I can get
the job running. Have included device config below. Don't
worry about the passwords - its a test unit with factory default
config.
Escape character is '^]'.
Copyright (c) 2004-2015 Hirschmann Automation and Control GmbH
All rights reserved
Railswitch Release L2E-08.0.09
(Build date 2015-04-06 21:32)
System Name: RS-F602F7
Mgmt-IP : 192.168.254.103
Base-MAC : 00:80:63:F6:02:F7
System Time: 2015-01-02 10:11:52
(Hirschmann Railswitch)
User:admin
Password:*******
NOTE: Enter '?' for Command Help. Command help displays all options
that are valid for the 'normal' command forms of that
particular mode.
For a list of valid 'no' command forms for that mode, enter the help
command 'no ?'. For the syntax of a particular command form, please
consult the documentation.
(Hirschmann Railswitch) >enable
(Hirschmann Railswitch) #
(Hirschmann Railswitch) #show running-config
!
!Parameter string escape handling \, 1
!Characters to be preceded with escape char (\): \, !, ", ', ?
!System Description "Hirschmann Railswitch"
!System Version L2E-08.0.09 Build: 2015-04-06 21:32
vlan database
exit
configure
!
interface 1/1
no auto-negotiate
exit
interface 1/2
no auto-negotiate
exit
interface 1/3
exit
interface 1/4
exit
interface 1/5
exit
interface 1/6
exit
interface 1/7
exit
interface 1/8
exit
!Address Conflict Detection
!Bridge Address Learning
!Bridge Fast Link Detection
!Maximum size of frame (packet size)
!Bridge Address Relearn Detection
!Bridge Address Relearn Threshold
!Bridge Duplex Mismatch Detection
!Bridge Hash Optimizing
!Service Mode
!VLAN Learning
!Hirschmann DHCP Relay
!Hirschmann Device Status
!DIP Switch Admin State
!Ethernet/IP
!Power over Ethernet (IEEE 802.3af)
!Selftest
!Skip ACA on boot
!Hirschmann HIPER Ring
! configuration determined by DIP switch
hiper-ring mode ring-switch
hiper-ring port primary 1/1
hiper-ring port secondary 1/2
!LLDP (IEEE802.1AB Link Layer Discovery Protocol)
!Media Redundancy Protocol (IEC 62439-2/Ed1.0, MRP)
!No MRP domains exist.
!MAC/IP Based Port Security
!ProfinetIO
!Hirschmann Precision Time Protocol (PTP, IEEE 1588)
!Hirschmann Ring Coupling
!Note: master/slave (also for single) part of configuration determined by
! DIP switch (cannot be overridden by management)
ring-coupling operation on
!Hirschmann Signal Contacts
!Hirschmann SNMP Access Control
!SNTP
!Hirschmann Broadcast Limiter
!Hirschmann Temperature Limit Settings
users passwd admin
users snmpv3 authentication admin md5
users passwd user
users snmpv3 authentication user md5
lineconfig
exit
no spanning-tree
!IGMP Snooping
exit
(Hirschmann Railswitch) #logoutConnection closed by foreign host.
-bash-4.2$
Cheers,
Rod.
On Wed, Dec 16, 2015 at 10:21 PM, Dan Anderson
It sounds like it's not finding an end-of-configuration
delimiter. I'm not familiar with the device type, but for
Cisco devices, it usually looks for the keyword "end" by
itself at the end of "show run" to determine whether or not
it has successfully pulled the configuration. Other device
types sometimes look for more than 5 lines of config, etc.
Without knowing more about the configuration file format, I
can't say which method (if either) would work for your
situation.
On Wed, Dec 16, 2015 at 5:49 AM, Rod Hendricks
Hi.
I am really struggling with getting a new device type up
and running.
Rancid v3.2, installed into Centos 7 with yum from EPEL
repo. I have an installation that is currently working
against a test Cisco router, so I know the base install
is all good.
I have created a login script hmlogin (based off
complogin, with session paginate commented out)
I have created a perl script hirschmann.pm
<http://hirschmann.pm> (based on ciscowlc.om
<http://ciscowlc.om>).
hirschmann;script;rancid -t hirschmann
hirschmann;login;hmlogin
hirschmann;module;hirschmann
hirschmann;inloop;hirschmann::inloop
hirschmann;command;hirschmann::WriteTerm;show running-config
I can run it directly with hmlogin -c"show
running-config" 192.168.254.103
I get no errors running this, and I get the output expected.
However, when I run the following: rancid -d
-thirschmann 192.168.254.103
loadtype: device type hirschmann
loadtype: found device type hirschmann in
/etc/rancid/rancid.types.conf
executing hmlogin -t 90 -c"show running-config"
192.168.254.103
HIT COMMAND:(Hirschmann Railswitch) #show running-config
HIT COMMAND:(Hirschmann Railswitch) #show running-config
all commands
192.168.254.103 <http://192.168.254.103>: End of run not
found
192.168.254.103 <http://192.168.254.103>: End of run not
found
!
-bash-4.2$
The .raw file has the full correct output of the show
running-config.
!RANCID-CONTENT-TYPE: hirschmann
!
I feel oh so close to getting this running! Appreciate
any help that can be offered.
Cheers,
Rod.
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Dan
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
***@gmail.com
Loading...