Re: [rancid] Unable to figure out "end of run not found"

2019-06-17 Thread Gauthier, Chris
Interesting.  I thought it would get mixed up into the value of the variable…. 
I’m not an expert programmer at all, but thought I needed to use the ; to 
separate the commands appropriately.  But, my expertise on shell variables is a 
tad (understatement, really) limited.  So, I shall defer! :)

Cheers,
Chris



Chris Gauthier Senior Network Engineer | Comscore
t +1 (503) 331-2704 |
cgauth...@comscore.com
comscore.com
​​​This e-mail (including any attachments) may contain information that is 
private, confidential, or protected by attorney-client or other privilege. If 
you received this e-mail in error, please delete it from your system and notify 
sender.
From: "Piegorsch, Weylin William" 
Date: Monday, June 17, 2019 at 2:05 PM
To: "Gauthier, Chris" , Michael Newton 
, Vacheslav Zouhairy 
Cc: "rancid-discuss@shrubbery.net" 
Subject: Re: [rancid] Unable to figure out "end of run not found"

I actually don't use the semicolon. Not sure if this is bash specific, sh 
specific, or posix general, but without the semicolon it sets the global 
environment variable only for the duration of that command following the 
variable definition, and unset it upon returning control to the cli. See also 
your "export" comment, which has correlating implications regarding environment 
vs namespace vs scope.
But I'm not an experienced programmer, and don't pretend to grok the various 
nuances, benefits, and pitfalls known by those who actually know what they're 
doing, so if using the semicolon is better I all ears.
weylin
Sent from Outlook on my 'Droid


From: Gauthier, Chris 
Sent: Monday, June 17, 2019 4:22:02 PM
To: Piegorsch, Weylin William; Michael Newton; Vacheslav Zouhairy
Cc: rancid-discuss@shrubbery.net
Subject: Re: [rancid] Unable to figure out "end of run not found"

Don’t forget the ; between the NOPIPE=yes and the rest of the command!  :-)

Some flavors of linux also want you to use the export command..

Chris​
Gauthier
 Senior Network Engineer
 |
Comscore
t +1 (503) 331-2704
 |
cgauth...@comscore.com
comscore.com
​​​This e-mail (including any attachments) may contain information that is 
private, confidential, or protected by attorney-client or other privilege. If 
you received this e-mail in error, please delete it from your system and notify 
sender.
From: Rancid-discuss  on behalf of 
"Piegorsch, Weylin William" 
Date: Saturday, June 15, 2019 at 7:52 AM
To: Michael Newton , Vacheslav Zouhairy 
Cc: "rancid-discuss@shrubbery.net" 
Subject: Re: [rancid] Unable to figure out "end of run not found"

> So this got me looking for how to do debug output per-host

If you’re using Linux, the command is:

NOPIPE=yes rancid -d -t  

This will generate two files:
.new
.raw

.new is the parsed output
.raw is pure log of the session (ie, it even captures non-printing characters). 
 I believe it’s only dumped if you set both NOPIPE and -d.

I’ve used the .raw output on many occasions.  At the moment I’m even 
troubleshooting a device CPU issue that rancid tripped on that I wouldn’t have 
found but for this; “clogin -c ” was even working fine.

weylin

From: Michael Newton 
Date: Monday, June 10, 2019 at 11:25 AM
To: Vacheslav Zouhairy 
Cc: 
Subject: Re: [rancid] Unable to figure out "end of run not found"

No, there is not. But I guess you're thinking maybe the login doesn't work 
because of heavy traffic.

So this got me looking for how to do debug output per-host. There doesn't seem 
to be, but that got me to this posting: 
https://www.shrubbery.net/pipermail/rancid-discuss/2015-October/008742.html
 And that made me notice that my router.db entry was corrupt (wrong device 
type.)

So, typical user error. Thanks for (indirectly) getting me in the right 
direction though!

Mike


On Mon, 10 Jun 2019 at 00:22, Vacheslav Zouhairy 
mailto:m_zouha...@skno.by>> wrote:
Is there any bandwidth hog on those switches by any chance?

On Fri, 2019-06-07 at 18:16 -0600, Michael Newton wrote:
> Hi all, we manage about 200-300 Brocade ICX switches across a number
> of locations. All but two are being successfully polled. The two in
> question (same firmware and a similar config to the others)
> consistently show "end of run not found" when run as part of the cron
> job. But, when run manually for troubleshooting, everything seems to
> work.
>
> `sudo -u rancid flogin switchname` works fine and logs me into the
> switch.
>
> `sudo -u rancid flogin -c 'show version;show clock' switchname`
> likewise works fine. Logs in, runs the commands, and logs out.
>
> `sudo -u rancid rancid -t foundry -d switchname` runs through
> everything perfectly. The 
> switchname.new

Re: [rancid] Unable to figure out "end of run not found"

2019-06-17 Thread Jean Benoit

On Mon, Jun 17, 2019 at 09:05:13PM +, Piegorsch, Weylin William wrote:

I actually don't use the semicolon.
Not sure if this is bash specific, sh specific, or posix general, but
without the semicolon it sets the global environment variable only for the
duration of that command following the variable definition, and unset it
upon returning control to the cli. See also your "export" comment, which
has correlating implications regarding environment vs namespace vs scope.
But I'm not an experienced programmer, and don't pretend to grok the
various nuances, benefits, and pitfalls known by those who actually know
what they're doing, so if using the semicolon is better I all ears.


You are right: ; is not necessary.

NOPIPE=yes rancid -d -t type devicename

is is a perfectly valid syntax according to POSIX Shell Grammar Rules.
It works with bash, dash, ksh, zsh and other shells.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02 
see "simple_command" syntax and rule 7, which defines "ASSIGNMENT_WORD".


simple_command   : cmd_prefix cmd_word cmd_suffix
| cmd_prefix cmd_word
| cmd_prefix
| cmd_name cmd_suffix
| cmd_name

cmd_prefix   :io_redirect
| cmd_prefix io_redirect
|ASSIGNMENT_WORD
| cmd_prefix ASSIGNMENT_WORD

You don't need the ; and you dont need export, and you can even put
redirects, as long as assignments are before the command.
Example :
XYZ=foo /tmp/y A=1 B=bar mycommand myarg

--
Jean

___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss


Re: [rancid] Unable to figure out "end of run not found"

2019-06-17 Thread Piegorsch, Weylin William
I actually don't use the semicolon. Not sure if this is bash specific, sh 
specific, or posix general, but without the semicolon it sets the global 
environment variable only for the duration of that command following the 
variable definition, and unset it upon returning control to the cli. See also 
your "export" comment, which has correlating implications regarding environment 
vs namespace vs scope.

But I'm not an experienced programmer, and don't pretend to grok the various 
nuances, benefits, and pitfalls known by those who actually know what they're 
doing, so if using the semicolon is better I all ears.

weylin

Sent from Outlook on my 'Droid


From: Gauthier, Chris 
Sent: Monday, June 17, 2019 4:22:02 PM
To: Piegorsch, Weylin William; Michael Newton; Vacheslav Zouhairy
Cc: rancid-discuss@shrubbery.net
Subject: Re: [rancid] Unable to figure out "end of run not found"

Don’t forget the ; between the NOPIPE=yes and the rest of the command!  :-)

Some flavors of linux also want you to use the export command..

Chris​  Gauthier Senior Network Engineer |  Comscore
t +1 (503) 331-2704|
cgauth...@comscore.com
comscore.com
​​​This e-mail (including any attachments) may contain information that is 
private, confidential, or protected by attorney-client or other privilege. If 
you received this e-mail in error, please delete it from your system and notify 
sender.
From: Rancid-discuss  on behalf of 
"Piegorsch, Weylin William" 
Date: Saturday, June 15, 2019 at 7:52 AM
To: Michael Newton , Vacheslav Zouhairy 
Cc: "rancid-discuss@shrubbery.net" 
Subject: Re: [rancid] Unable to figure out "end of run not found"

> So this got me looking for how to do debug output per-host

If you’re using Linux, the command is:

NOPIPE=yes rancid -d -t  

This will generate two files:
.new
.raw

.new is the parsed output
.raw is pure log of the session (ie, it even captures non-printing characters). 
 I believe it’s only dumped if you set both NOPIPE and -d.

I’ve used the .raw output on many occasions.  At the moment I’m even 
troubleshooting a device CPU issue that rancid tripped on that I wouldn’t have 
found but for this; “clogin -c ” was even working fine.

weylin

From: Michael Newton 
Date: Monday, June 10, 2019 at 11:25 AM
To: Vacheslav Zouhairy 
Cc: 
Subject: Re: [rancid] Unable to figure out "end of run not found"

No, there is not. But I guess you're thinking maybe the login doesn't work 
because of heavy traffic.

So this got me looking for how to do debug output per-host. There doesn't seem 
to be, but that got me to this posting: 
https://www.shrubbery.net/pipermail/rancid-discuss/2015-October/008742.html
 And that made me notice that my router.db entry was corrupt (wrong device 
type.)

So, typical user error. Thanks for (indirectly) getting me in the right 
direction though!

Mike


On Mon, 10 Jun 2019 at 00:22, Vacheslav Zouhairy 
mailto:m_zouha...@skno.by>> wrote:
Is there any bandwidth hog on those switches by any chance?

On Fri, 2019-06-07 at 18:16 -0600, Michael Newton wrote:
> Hi all, we manage about 200-300 Brocade ICX switches across a number
> of locations. All but two are being successfully polled. The two in
> question (same firmware and a similar config to the others)
> consistently show "end of run not found" when run as part of the cron
> job. But, when run manually for troubleshooting, everything seems to
> work.
>
> `sudo -u rancid flogin switchname` works fine and logs me into the
> switch.
>
> `sudo -u rancid flogin -c 'show version;show clock' switchname`
> likewise works fine. Logs in, runs the commands, and logs out.
>
> `sudo -u rancid rancid -t foundry -d switchname` runs through
> everything perfectly. The 
> switchname.new
>  file has the expected
> output.
>
> Yet the log for the automated process consistently shows this:
>
> switchname: End of run not found
> end
>
> Is there anything else I can do to troubleshoot this? Thanks in
> advance!
>
> Mike
> ___
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss


__

Re: [rancid] Unable to figure out "end of run not found"

2019-06-17 Thread Gauthier, Chris
Don’t forget the ; between the NOPIPE=yes and the rest of the command!  :-)

Some flavors of linux also want you to use the export command..


Chris Gauthier Senior Network Engineer | Comscore
t +1 (503) 331-2704 |
cgauth...@comscore.com
comscore.com
​​​This e-mail (including any attachments) may contain information that is 
private, confidential, or protected by attorney-client or other privilege. If 
you received this e-mail in error, please delete it from your system and notify 
sender.
From: Rancid-discuss  on behalf of 
"Piegorsch, Weylin William" 
Date: Saturday, June 15, 2019 at 7:52 AM
To: Michael Newton , Vacheslav Zouhairy 
Cc: "rancid-discuss@shrubbery.net" 
Subject: Re: [rancid] Unable to figure out "end of run not found"

> So this got me looking for how to do debug output per-host

If you’re using Linux, the command is:

NOPIPE=yes rancid -d -t  

This will generate two files:
.new
.raw

.new is the parsed output
.raw is pure log of the session (ie, it even captures non-printing characters). 
 I believe it’s only dumped if you set both NOPIPE and -d.

I’ve used the .raw output on many occasions.  At the moment I’m even 
troubleshooting a device CPU issue that rancid tripped on that I wouldn’t have 
found but for this; “clogin -c ” was even working fine.

weylin

From: Michael Newton 
Date: Monday, June 10, 2019 at 11:25 AM
To: Vacheslav Zouhairy 
Cc: 
Subject: Re: [rancid] Unable to figure out "end of run not found"

No, there is not. But I guess you're thinking maybe the login doesn't work 
because of heavy traffic.

So this got me looking for how to do debug output per-host. There doesn't seem 
to be, but that got me to this posting: 
https://www.shrubbery.net/pipermail/rancid-discuss/2015-October/008742.html
 And that made me notice that my router.db entry was corrupt (wrong device 
type.)

So, typical user error. Thanks for (indirectly) getting me in the right 
direction though!

Mike


On Mon, 10 Jun 2019 at 00:22, Vacheslav Zouhairy 
mailto:m_zouha...@skno.by>> wrote:
Is there any bandwidth hog on those switches by any chance?

On Fri, 2019-06-07 at 18:16 -0600, Michael Newton wrote:
> Hi all, we manage about 200-300 Brocade ICX switches across a number
> of locations. All but two are being successfully polled. The two in
> question (same firmware and a similar config to the others)
> consistently show "end of run not found" when run as part of the cron
> job. But, when run manually for troubleshooting, everything seems to
> work.
>
> `sudo -u rancid flogin switchname` works fine and logs me into the
> switch.
>
> `sudo -u rancid flogin -c 'show version;show clock' switchname`
> likewise works fine. Logs in, runs the commands, and logs out.
>
> `sudo -u rancid rancid -t foundry -d switchname` runs through
> everything perfectly. The 
> switchname.new
>  file has the expected
> output.
>
> Yet the log for the automated process consistently shows this:
>
> switchname: End of run not found
> end
>
> Is there anything else I can do to troubleshoot this? Thanks in
> advance!
>
> Mike
> ___
> Rancid-discuss mailing list
> Rancid-discuss@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss


___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
___
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss