Discussion:
[rancid] jrancid excess revisions due to expect prompt mismatches?
Chuck Liggett
2013-05-31 00:01:31 UTC
Permalink
While querying a Juniper SRX 650 firewall cluster from a CentOS 6.4 box running Rancid 2.3.6 (rpm from Epel), Expect 5.44.1.15,
where Rancid is run out of /etc/cron.d/rancid and scheduled every quarter hour:

Several times a day, I get excess revisions where it looks as though a Juniper Rancid command appears in the body of the config as if more than one command is being sent in response to a prompt.

Every time I run it manually in expect debugging mode, it does not experience the issue.

Here's an illustration:



Index: configs/firewall

===================================================================

- -- configs/firewall (revision 619)

@@ -2,6 +2,7 @@

#

# ***@host.domain.com> show chassis clocks

# ***@host.domain.com> show chassis environment

+ # show chassis firmware

# node0:

# --------------------------------------------------------------------------

# Class Item Status

Sometimes, the commands are well within the body of other command output, like in this example:




Index: configs/firewall

===================================================================

- -- configs/firewall (revision 604)

@@ -4,6 +4,7 @@

# ***@host.domain.com> show chassis environment

# node0:

# --------------------------------------------------------------------------

+ # show chassis firmware

# Class Item Status

# Temp Routing Engine OK

# Routing Engine CPU OK

@@ -36,6 +37,7 @@

# FPC 0 O/S Version 11.4R6.6 by builder on 2013-01-05 1

# FPC 2 O/S Version 11.4R6.6 by builder on 2013-01-05 1

# FWDD O/S Version 11.4R6.6 by builder on 2013-01-05 1

+ # show chassis fpc detail

#

# node1:

# --------------------------------------------------------------------------

@@ -46,6 +48,7 @@

#

# {primary:node0}

# ***@host.domain.com> show chassis fpc detail

+ # show chassis hardware detail

# node0:

# --------------------------------------------------------------------------

# Slot 0 information:

Does anyone have any suggestions?

Thank you!

Chuck
heasley
2013-05-31 06:28:24 UTC
Permalink
Post by Chuck Liggett
While querying a Juniper SRX 650 firewall cluster from a CentOS 6.4 box running Rancid 2.3.6 (rpm from Epel), Expect 5.44.1.15,
Several times a day, I get excess revisions where it looks as though a Juniper Rancid command appears in the body of the config as if more than one command is being sent in response to a prompt.
Every time I run it manually in expect debugging mode, it does not experience the issue.
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 619)
@@ -2,6 +2,7 @@
#
+ # show chassis firmware
# --------------------------------------------------------------------------
# Class Item Status
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 604)
@@ -4,6 +4,7 @@
# --------------------------------------------------------------------------
+ # show chassis firmware
# Class Item Status
# Temp Routing Engine OK
# Routing Engine CPU OK
@@ -36,6 +37,7 @@
# FPC 0 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FPC 2 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FWDD O/S Version 11.4R6.6 by builder on 2013-01-05 1
+ # show chassis fpc detail
#
# --------------------------------------------------------------------------
@@ -46,6 +48,7 @@
#
# {primary:node0}
+ # show chassis hardware detail
# --------------------------------------------------------------------------
Does anyone have any suggestions?
is it, what oscillates, random or consistent?
Chuck Liggett
2013-05-31 11:45:03 UTC
Permalink
Post by heasley
Post by Chuck Liggett
While querying a Juniper SRX 650 firewall cluster from a CentOS 6.4
box running Rancid 2.3.6 (rpm from Epel), Expect 5.44.1.15,
Several times a day, I get excess revisions where it looks as though
a Juniper Rancid command appears in the body of the config as if more
than one command is being sent in response to a prompt.
Every time I run it manually in expect debugging mode, it does not
experience the issue.
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 619)
@@ -2,6 +2,7 @@
#
+ # show chassis firmware
# -----------------------------------------------------------------
# Class Item Status
Sometimes, the commands are well within the body of other command
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 604)
@@ -4,6 +4,7 @@
# -----------------------------------------------------------------
+ # show chassis firmware
# Class Item Status
# Temp Routing Engine OK
# Routing Engine CPU OK
@@ -36,6 +37,7 @@
# FPC 0 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FPC 2 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FWDD O/S Version 11.4R6.6 by builder on 2013-01-05 1
+ # show chassis fpc detail
#
# -----------------------------------------------------------------
@@ -46,6 +48,7 @@
#
# {primary:node0}
+ # show chassis hardware detail
# -----------------------------------------------------------------
Does anyone have any suggestions?
is it, what oscillates, random or consistent?
Its always involving commands, and usually starts at the "show chassis firmware".

It sometimes oscillates between the + and - of example one, and then randomly
starts with other commands and has multiple commands in the body at various points.
Gareth Hopkins
2013-06-03 09:00:50 UTC
Permalink
Off the top of my head, it could be either the shell or pager not being called correctly. When you run it manually you
will be in a specific shell, but when run from cron, it will be using root's default. Can you try exporting the shell in the
crontab ?

Cheers,
Gareth
Post by Chuck Liggett
While querying a Juniper SRX 650 firewall cluster from a CentOS 6.4 box running Rancid 2.3.6 (rpm from Epel), Expect 5.44.1.15,
Several times a day, I get excess revisions where it looks as though a Juniper Rancid command appears in the body of the config as if more than one command is being sent in response to a prompt.
Every time I run it manually in expect debugging mode, it does not experience the issue.
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 619)
@@ -2,6 +2,7 @@
#
+ # show chassis firmware
# --------------------------------------------------------------------------
# Class Item Status
Index: configs/firewall
===================================================================
- -- configs/firewall (revision 604)
@@ -4,6 +4,7 @@
# --------------------------------------------------------------------------
+ # show chassis firmware
# Class Item Status
# Temp Routing Engine OK
# Routing Engine CPU OK
@@ -36,6 +37,7 @@
# FPC 0 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FPC 2 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FWDD O/S Version 11.4R6.6 by builder on 2013-01-05 1
+ # show chassis fpc detail
#
# --------------------------------------------------------------------------
@@ -46,6 +48,7 @@
#
# {primary:node0}
+ # show chassis hardware detail
# --------------------------------------------------------------------------
Does anyone have any suggestions?
Thank you!
Chuck
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Chuck Liggett
2013-06-03 18:10:40 UTC
Permalink
Gareth:

Switching the shell from /bin/bash to /bin/sh appears to be looking promising. The spurious
commands in the body of the config have gone away the first run after the shell change.

--
Sincerely yours,
Chuck Liggett

From: Gareth Hopkins [mailto:***@gmail.com]
Sent: Monday, June 3, 2013 05:01
To: Chuck Liggett
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] jrancid excess revisions due to expect prompt mismatches?

Off the top of my head, it could be either the shell or pager not being called correctly. When you run it manually you
will be in a specific shell, but when run from cron, it will be using root's default. Can you try exporting the shell in the
crontab ?

Cheers,
Gareth

On 31 May 2013, at 2:01 AM, Chuck Liggett <***@mongoosemetrics.com<mailto:***@mongoosemetrics.com>> wrote:


While querying a Juniper SRX 650 firewall cluster from a CentOS 6.4 box running Rancid 2.3.6 (rpm from Epel), Expect 5.44.1.15,
where Rancid is run out of /etc/cron.d/rancid and scheduled every quarter hour:

Several times a day, I get excess revisions where it looks as though a Juniper Rancid command appears in the body of the config as if more than one command is being sent in response to a prompt.

Every time I run it manually in expect debugging mode, it does not experience the issue.

Here's an illustration:

Index: configs/firewall
===================================================================
- -- configs/firewall (revision 619)
@@ -2,6 +2,7 @@
#
# ***@host.domain.com<mailto:***@host.domain.com>> show chassis clocks
# ***@host.domain.com<mailto:***@host.domain.com>> show chassis environment
+ # show chassis firmware
# node0:
# --------------------------------------------------------------------------
# Class Item Status

Sometimes, the commands are well within the body of other command output, like in this example:


Index: configs/firewall
===================================================================
- -- configs/firewall (revision 604)
@@ -4,6 +4,7 @@
# ***@host.domain.com<mailto:***@host.domain.com>> show chassis environment
# node0:
# --------------------------------------------------------------------------
+ # show chassis firmware
# Class Item Status
# Temp Routing Engine OK
# Routing Engine CPU OK
@@ -36,6 +37,7 @@
# FPC 0 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FPC 2 O/S Version 11.4R6.6 by builder on 2013-01-05 1
# FWDD O/S Version 11.4R6.6 by builder on 2013-01-05 1
+ # show chassis fpc detail
#
# node1:
# --------------------------------------------------------------------------
@@ -46,6 +48,7 @@
#
# {primary:node0}
# ***@host.domain.com<mailto:***@host.domain.com>> show chassis fpc detail
+ # show chassis hardware detail
# node0:
# --------------------------------------------------------------------------
# Slot 0 information:

Does anyone have any suggestions?

Thank you!

Chuck

Loading...