[rancid] Rancid 3.1 control_rancid errors when there are diffs
Daniel Shields
grungelizard9 at hotmail.com
Thu Mar 12 04:02:26 UTC 2015
Hello all,
Well, I tried everything I could find on the interwebs and here in the forums (thanks for the tips and suggestions), but had to modify control_rancid to get the alerts to go to my email. I don't think this has anything to do with RANCID. It sent the alerts to postfix like a champ with the group names that I have set up like the script was telling it to. Pretty sure this is a postfix issue. Anyways, hope this helps if anybody runs into the same. Thanks all.
# the receipient(s) of diffs & mail options#mailrcpt=${mailrcpt:-"rancid-${GROUP}${MAILDOMAIN}"}; export mailrcptmailrcpt=${mailrcpt:-"grungelizard9"}; export mailrcpt#adminmailrcpt=${adminmailrcpt:-"rancid-admin-${GROUP}${MAILDOMAIN}"};adminmailrcpt=${adminmailrcpt:-"grungelizard9"};
From: gmourani at gmail.com
Date: Wed, 11 Mar 2015 14:45:19 -0400
To: namelessjoe at hotmail.com
CC: rancid-discuss at shrubbery.net
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
Did you have a ‘sendmail’ symlink available under /usr/lib (32bits) or /usr/lib64 (64bits) ?ls -l /usr/lib64/sendmail
On Mar 11, 2015, at 2:29 PM, Tanner - <namelessjoe at hotmail.com> wrote:I have postfix installed and it has a sendmail clone function that works from the command line i changed the
no -t $MAILOPTS
to sendmail -t $MAILOPTS and i still get an error is it a path issue or what am i not understanding
Trying to get all of the configs.All routers sucessfully completed.
cvs diff: Diffing .cvs diff: Diffing configscvs commit: Examining .cvs commit: Examining configs/usr/local/rancid/var/CVS/networking/configs/198.210.70.10,v <-- configs/198.210.70.10new revision: 1.12; previous revision: 1.11/usr/local/rancid/bin/control_rancid: 483: /usr/local/rancid/bin/control_rancid: sendmail: not found
ending: Wed Mar 11 10:27:32 CDT 2015
From: grungelizard9 at hotmail.com
To: lee.e.rian at census.gov; namelessjoe at hotmail.com; rancid-discuss at shrubbery.net
Subject: RE: [rancid] Rancid 3.1 control_rancid errors when there are diffs
Date: Wed, 11 Mar 2015 11:29:18 -0400
I have a similar issue running 3.1.99, but using postfix. I get the error "/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found". I had the same issue before upgrading (was running 3.1). " ) | -t $MAILOPTS" is the line of the control_rancid where it hangs. Any help is greatly appreciated.
if [ $MAXSZ -eq 0 ] ; then ( echo "To: $mailrcpt" echo "Subject: $subject" echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}' echo "" cat $TMP.diff ) | -t $MAILOPTS
# Additional options for sendmail(8).#MAILOPTS="-f bounces.go.here at example.com"; export MAILOPTS
Trying to get all of the configs.All routers sucessfully completed.
cvs diff: Diffing .cvs diff: Diffing configscvs commit: Examining .cvs commit: Examining configs/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620new revision: 1.30; previous revision: 1.29/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found
Thanks!From: lee.e.rian at census.gov
To: namelessjoe at hotmail.com; rancid-discuss at shrubbery.net
Date: Wed, 11 Mar 2015 14:58:12 +0000
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
I had the same problem after building rancid on a machine that didn't have sendmail installed. Install sendmail and edit control_rancid to change all the
no -t $MAILOPTS
to
sendmail -t $MAILOPTS
Regards,
Lee
From: Rancid-discuss <rancid-discuss-bounces at shrubbery.net> on behalf of Tanner Lyle <namelessjoe at hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-discuss at shrubbery.net
Subject: [rancid] Rancid 3.1 control_rancid errors when there are diffs I have installed rancid 3.1 and have it working on a Ubuntu install. It works and collects diffs and shows them in the repository and i have the cvs web working, but i cannot get it to e-mail me the diffs and am getting an error in the var/logs only when there are diffs. it errors on the control_rancid portion of it i can send mail through postfix with both the sendmail and mail command. I installed postfix after sendmail fail as i thought it was my problem. Below is the log of both and the control_rancid, and yes i am a newbie
rancid log when there are no changes
rancid at lyle ~/var/logs $ tail -f networking.20150311.080400 starting: Wed Mar 11 08:04:00 CDT 2015
Trying to get all of the configs.All routers sucessfully completed.
cvs diff: Diffing .cvs diff: Diffing configscvs commit: Examining .cvs commit: Examining configs
ending: Wed Mar 11 08:05:14 CDT 2015
rancid log when there are changes
rancid at lyle ~/var/logs $ tail -f networking.20150311.083546 starting: Wed Mar 11 08:35:46 CDT 2015
Trying to get all of the configs.All routers sucessfully completed.
cvs diff: Diffing .cvs diff: Diffing configscvs commit: Examining .cvs commit: Examining configs/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitchnew revision: 1.11; previous revision: 1.10/usr/local/rancid/bin/control_rancid: 483: /usr/local/rancid/bin/control_rancid: no: not found
ending: Wed Mar 11 08:37:07 CDT 2015
control_rancid line 483 is the ) | no -t $MAILOPTS
# Mail out the diffs (if there are any).if [ -s $TMP.diff ] ; then MAXSZ=${MAILSPLIT:=0} if [ $MAXSZ -ne 0 ] ; thenBLOCKSIZE=1024; export BLOCKSIZEtmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`unset BLOCKSIZEif [ $tmpk -lt $MAXSZ ] ; then MAXSZ=0fi fi if [ $MAXSZ -eq 0 ] ; then( echo "To: $mailrcpt" echo "Subject: $subject" echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}' echo "" cat $TMP.diff) | no -t $MAILOPTS elseCDIR=`pwd`SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mailerror=`mkdir $SDIR`if [ $? -ne 0 ] ; then echo "Could not create $SDIR directory" >&2 echo $error >&2else cd $SDIR split -b${MAXSZ}k $TMP.diff nfiles=`ls | wc -l | sed -e 's/^ *//' |cut -d' ' -f1` n=0 dt=`perl -e 'print time();'` for file in `ls`; don=`expr $n + 1`MSGID="<$dt.RANCID$GROUP$$${nfiles}${n}@`hostname`>"(echo "To: $mailrcpt"echo "Subject: $n of ${nfiles}: $subject"echo "Message-Id: $MSGID"if [ $n -gt 1 ] ; then echo "References: $LASTIDS"fiecho "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'echo ""cat $file) | no -t $MAILOPTSLASTIDS="$LASTIDS $MSGID"if [ $n -lt $nfiles ]; then # this just tries to make the msgs order right in MUAs sleep 1fi done cd $CDIR rm -rf $SDIRfi fifi
_______________________________________________ Rancid-discuss mailing list Rancid-discuss at shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss_______________________________________________Rancid-discuss mailing listRancid-discuss at shrubbery.nethttp://www.shrubbery.net/mailman/listinfo/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20150312/9c3275d5/attachment.html>
More information about the Rancid-discuss
mailing list