iirc:
; is to seperate commands and wil execute the whole command string without 
checking the return value of the previous command
&& will do the same, but if previous command returns not null (you can check 
the return code of the previous command with "echo $?") it will end the command 
list.

the syntax is question "NOPIPE=yes" will set the environment variable NOPIPE 
but only for the context of the command that's executed.
appending ; between NOPIPE=yes & the command will _NOT_ do what you expect; it 
will execute and empty cmd with nopipe env set to yes, then execute your 
command with default envvars.


you can compare:

AHHA=aha env | grep -i aha
output -> AHHA=aha
AHHA=aha; env | grep -i aha
output -> nothing

export with set the envvar for your current session:
env  | grep -i nop
-> output nothing
export NOPIPE=yes
env  | grep -i nop
output ->NOPIPE=yes

all examples done in bash instead of my preferred zsh. if you use csh/tcsh or 
fish i would guess you know what you're doing and can adapt the config to work.

bottom line, this is correct for most bourne shell derivatives:
NOPIPE=yes rancid -d -t <type> <devicename>


here's the catch, if you run rancid from cron you will either need to uncomment 
the NOPIPE line in yr rancid.conf or add them to your crontab entry.


side note:
the next rancid version will most likely change this behaviour:
https://github.com/haussli/rancid/commit/94318333c8f0d746abdd22cf4430636a394def8f



// nick



From: Rancid-discuss [mailto:[email protected]] On Behalf Of 
Gauthier, Chris
Sent: Tuesday, June 18, 2019 00:10
To: Piegorsch, Weylin William <[email protected]>; Michael Newton 
<[email protected]>; Vacheslav Zouhairy <[email protected]>
Cc: [email protected]
Subject: Re: [rancid] Unable to figure out "end of run not found"

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<tel:(503)%20331-2704>

 |

[email protected]<mailto:[email protected]>



comscore.com<http://www.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" <[email protected]>
Date: Monday, June 17, 2019 at 2:05 PM
To: "Gauthier, Chris" <[email protected]>, Michael Newton 
<[email protected]>, Vacheslav Zouhairy <[email protected]>
Cc: "[email protected]" <[email protected]>
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 <[email protected]>
Sent: Monday, June 17, 2019 4:22:02 PM
To: Piegorsch, Weylin William; Michael Newton; Vacheslav Zouhairy
Cc: [email protected]
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<tel:(503)%20331-2704>

 |

[email protected]<mailto:[email protected]>



comscore.com<http://www.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 <[email protected]> on behalf of 
"Piegorsch, Weylin William" <[email protected]>
Date: Saturday, June 15, 2019 at 7:52 AM
To: Michael Newton <[email protected]>, Vacheslav Zouhairy <[email protected]>
Cc: "[email protected]" <[email protected]>
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 <type> <devicename>

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<command-set> <device>” was even working fine.

weylin

From: Michael Newton <[email protected]>
Date: Monday, June 10, 2019 at 11:25 AM
To: Vacheslav Zouhairy <[email protected]>
Cc: <[email protected]>
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<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.shrubbery.net%2fpipermail%2francid-discuss%2f2015-October%2f008742.html&c=E,1,ekhutmoeYC8nJjY5ygYIWeZtgfLUg9xzHFGeBIFHMUPKVuB2mZH94N3eF_QgXs0jXOsAB3OfrKr8A5kG_gIC11YP5eAWNrT_fRatYLjW22bodf8oDA,,&typo=1>
 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 
<[email protected]<mailto:[email protected]>> 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<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fswitchname.new&c=E,1,u3rpkaeqsecxvPWZllacfnG3P4NxiddLWnK7ixyuOtuFx2zmxUrFwYjeq9HWP2sZvfaFig4pKtv5uTsr3_jwUdFVXEsoBKXQM0w6j_Zu1A,,&typo=1>
>  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
> [email protected]<mailto:[email protected]>
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.shrubbery.net%2fmailman%2flistinfo%2francid-discuss&c=E,1,pXzlW6Eiv9FPWrAjQTLdnnQDc-z22dWuWuzv1eNITrMpNn240pK3uusnQWFUuualEk9HxmtECWaUnFm_DQ_QYNrjiTivOPA64ecFuTooFbrCBw,,&typo=1>


_______________________________________________
Rancid-discuss mailing list
[email protected]<mailto:[email protected]>
http://www.shrubbery.net/mailman/listinfo/rancid-discuss<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.shrubbery.net%2fmailman%2flistinfo%2francid-discuss&c=E,1,RAqfnKurrogi8cIpgX_RP3hEyuQNMMwNZuC6arzpf_WpfZd3ZssqYP2yNnRkw3jpCRAXqQQqHHLEJES9L06q3YOg8ex4DR1QWORVwyOZ4nb68fF_7ZkRr6_4jX0,&typo=1>

________________________________

Volg Aquafin op Facebook<https://www.facebook.com/AquafinNV> | 
Twitter<https://twitter.com/aquafinnv> | 
YouTube<http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> | 
LinkedIN<http://www.linkedin.com/company/aquafin/products> | 
Instagram<https://www.instagram.com/aquafin_nv/>

In het kader van de uitoefening van onze taken verzamelen we bij Aquafin 
persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de 
betrokkenen zijn, kan je nalezen in onze privacy 
policy<https://www.aquafin.be/nl-be/privacy-policy>.

  P Denk aan het milieu. Druk deze mail niet onnodig af.
_______________________________________________
Rancid-discuss mailing list
[email protected]
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Reply via email to