Discussion:
[rancid] Rancid 3.1 control_rancid errors when there are diffs
Tanner Lyle
2015-03-11 14:07:58 UTC
Permalink
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
***@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
***@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 ] ; then BLOCKSIZE=1024; export BLOCKSIZE tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"` unset BLOCKSIZE if [ $tmpk -lt $MAXSZ ] ; then MAXSZ=0 fi 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 else CDIR=`pwd` SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail error=`mkdir $SDIR` if [ $? -ne 0 ] ; then echo "Could not create $SDIR directory" >&2 echo $error >&2 else 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`; do n=`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" fi 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 $file ) | no -t $MAILOPTS LASTIDS="$LASTIDS $MSGID" if [ $n -lt $nfiles ]; then # this just tries to make the msgs order right in MUAs sleep 1 fi done cd $CDIR rm -rf $SDIR fi fifi
Tanner -
2015-03-11 14:20:02 UTC
Permalink
From: ***@hotmail.com
To: rancid-***@shrubbery.net
Date: Wed, 11 Mar 2015 14:07:58 +0000
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
***@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
***@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 ] ; then BLOCKSIZE=1024; export BLOCKSIZE tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"` unset BLOCKSIZE if [ $tmpk -lt $MAXSZ ] ; then MAXSZ=0 fi 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 else CDIR=`pwd` SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail error=`mkdir $SDIR` if [ $? -ne 0 ] ; then echo "Could not create $SDIR directory" >&2 echo $error >&2 else 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`; do n=`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" fi 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 $file ) | no -t $MAILOPTS LASTIDS="$LASTIDS $MSGID" if [ $n -lt $nfiles ]; then # this just tries to make the msgs order right in MUAs sleep 1 fi done cd $CDIR rm -rf $SDIR fi fifi
Lee Rian (CENSUS/TCO FED)
2015-03-11 14:58:12 UTC
Permalink
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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-***@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

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs

ending: Wed Mar 11 08:05:14 CDT 2015


rancid log when there are changes

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi
Daniel Shields
2015-03-11 15:29:18 UTC
Permalink
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 ***@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: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>

Sent: Wednesday, March 11, 2015 10:07 AM

To: rancid-***@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




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs



ending: Wed Mar 11 08:05:14 CDT 2015







rancid log when there are changes




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi
David Jones
2015-03-11 16:25:01 UTC
Permalink
I have Rancid 3.1 working with Postfix:

1. This removes the need to setup an alias in /etc/aliases for every single group

Postfix - /etc/postfix/main.cf

luser_relay = ***@example.com

mydomain = [valid DNS domain]

myorigin = $mydomain

relayhost = [valid internal mail relay if you have one]

2. Rancid config:

etc/rancid.conf

SENDMAIL="/bin/true"

#MAILOPTS="-f ..."; export MAILOPTS <- all variables starting with MAIL are commented out

​I get the diff reports and the config fetcher reports with the above configuration.

Dave

________________________________
From: Rancid-discuss <rancid-discuss-***@shrubbery.net> on behalf of Daniel Shields <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:29 AM
To: Lee Rian CENSUSTCO FED; Tanner Lyle; rancid-***@shrubbery.net
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs

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 ***@example.com"; export MAILOPTS


Trying to get all of the configs.
All routers sucessfully completed.

cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620
new revision: 1.30; previous revision: 1.29
/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found


Thanks!
________________________________
From: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-***@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

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs

ending: Wed Mar 11 08:05:14 CDT 2015


rancid log when there are changes

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi








_______________________________________________ Rancid-discuss mailing list Rancid-***@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Lee Rian (CENSUS/TCO FED)
2015-03-11 16:58:22 UTC
Permalink
You don't have a program called "-t" so yes, it's going to complain about " -t: not found"

I have no idea how postfix works -- maybe piping the output of all those echo commands to

postfix -t $MAILOPTS

will send you mail, in which case you need to change all the

)| -t $MAILOPTS

lines to

)| postfix -t $MAILOPTS


Regards,

Lee



________________________________
From: Daniel Shields <***@hotmail.com>
Sent: Wednesday, March 11, 2015 11:29 AM
To: Lee Rian (CENSUS/TCO FED); Tanner Lyle; rancid-***@shrubbery.net
Subject: RE: [rancid] Rancid 3.1 control_rancid errors when there are diffs

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 ***@example.com"; export MAILOPTS


Trying to get all of the configs.
All routers sucessfully completed.

cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620
new revision: 1.30; previous revision: 1.29
/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found


Thanks!
________________________________
From: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-***@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

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs

ending: Wed Mar 11 08:05:14 CDT 2015


rancid log when there are changes

***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi








_______________________________________________ Rancid-discuss mailing list Rancid-***@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Daniel Shields
2015-03-11 18:30:05 UTC
Permalink
Thanks Lee,
You're exactly right. I changed all of the
)| -t $MAILOPTSlines to )| sendmail -t $MAILOPTS
and mail is being sent. Just need to get my aliases straightened out so that they get sent to the right email address. Thanks!

From: ***@census.gov
To: ***@hotmail.com; ***@hotmail.com; rancid-***@shrubbery.net
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
Date: Wed, 11 Mar 2015 16:58:22 +0000








You don't have a program called "-t" so yes, it's going to complain about " -t: not found"



I have no idea how postfix works -- maybe piping the output of all those echo commands to

postfix -t $MAILOPTS

will send you mail, in which case you need to change all the

)| -t $MAILOPTS

lines to

)| postfix -t $MAILOPTS





Regards,

Lee













From: Daniel Shields <***@hotmail.com>

Sent: Wednesday, March 11, 2015 11:29 AM

To: Lee Rian (CENSUS/TCO FED); Tanner Lyle; rancid-***@shrubbery.net

Subject: RE: [rancid] Rancid 3.1 control_rancid errors when there are diffs



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 ***@example.com"; export MAILOPTS







Trying to get all of the configs.
All routers sucessfully completed.



cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620
new revision: 1.30; previous revision: 1.29
/home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found







Thanks!


From: ***@census.gov

To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>

Sent: Wednesday, March 11, 2015 10:07 AM

To: rancid-***@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




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs



ending: Wed Mar 11 08:05:14 CDT 2015







rancid log when there are changes




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi




























_______________________________________________ Rancid-discuss mailing list Rancid-***@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Tanner -
2015-03-11 18:29:46 UTC
Permalink
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: ***@hotmail.com
To: ***@census.gov; ***@hotmail.com; rancid-***@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 ***@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: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>

Sent: Wednesday, March 11, 2015 10:07 AM

To: rancid-***@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




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs



ending: Wed Mar 11 08:05:14 CDT 2015







rancid log when there are changes




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi
Tanner -
2015-03-11 19:26:28 UTC
Permalink
I got it fixed thanks to everyone for their contributions I had to change a fee things. Thanks Lee and David
control_rancid
no -t $MAILOPTStosendmail -t $MAILOPTS
in rancid.conf
PATH=/usr/local/rancid/bin:/usr/bin:.:/bin:/usr/local/bin:/usr/bin; export PATHto include /usr/sbinPATH=/usr/local/rancid/bin:/usr/bin:.:/bin:/usr/local/bin:/usr/bin:/usr/sbin; export PATH
#SENDMAIL="no"toSENDMAIL="sendmail"

From: ***@hotmail.com
To: rancid-***@shrubbery.net
Date: Wed, 11 Mar 2015 18:29:46 +0000
Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs





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: ***@hotmail.com
To: ***@census.gov; ***@hotmail.com; rancid-***@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 ***@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: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>

Sent: Wednesday, March 11, 2015 10:07 AM

To: rancid-***@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




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs



ending: Wed Mar 11 08:05:14 CDT 2015







rancid log when there are changes




***@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 configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
new 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 ] ; then
BLOCKSIZE=1024; export BLOCKSIZE
tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] / 1024);"`
unset BLOCKSIZE
if [ $tmpk -lt $MAXSZ ] ; then
MAXSZ=0
fi
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
else
CDIR=`pwd`
SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
error=`mkdir $SDIR`
if [ $? -ne 0 ] ; then
echo "Could not create $SDIR directory" >&2
echo $error >&2
else
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`; do
n=`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"
fi
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 $file
) | no -t $MAILOPTS
LASTIDS="$LASTIDS $MSGID"
if [ $n -lt $nfiles ]; then
# this just tries to make the msgs order right in MUAs
sleep 1
fi
done
cd $CDIR
rm -rf $SDIR
fi
fi
fi
Gerhard Mourani
2015-03-11 18:45:19 UTC
Permalink
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 - <***@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 configs
> cvs commit: Examining .
> cvs commit: Examining configs
> /usr/local/rancid/var/CVS/networking/configs/198.210.70.10,v <-- configs/198.210.70.10
> new 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: ***@hotmail.com <mailto:***@hotmail.com>
> To: ***@census.gov <mailto:***@census.gov>; ***@hotmail.com <mailto:***@hotmail.com>; rancid-***@shrubbery.net <mailto:rancid-***@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 ***@example.com <mailto:***@example.com>"; export MAILOPTS
>
>
> Trying to get all of the configs.
> All routers sucessfully completed.
>
> cvs diff: Diffing .
> cvs diff: Diffing configs
> cvs commit: Examining .
> cvs commit: Examining configs
> /home/rancid/var/rancid/CVS/demo-vpn/configs/imp_620,v <-- configs/imp_620
> new revision: 1.30; previous revision: 1.29
> /home/rancid/bin/control_rancid: 631: /home/rancid/bin/control_rancid: -t: not found
>
>
> Thanks!
> From: ***@census.gov <mailto:***@census.gov>
> To: ***@hotmail.com <mailto:***@hotmail.com>; rancid-***@shrubbery.net <mailto:rancid-***@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-***@shrubbery.net <mailto:rancid-discuss-***@shrubbery.net>> on behalf of Tanner Lyle <***@hotmail.com <mailto:***@hotmail.com>>
> Sent: Wednesday, March 11, 2015 10:07 AM
> To: rancid-***@shrubbery.net <mailto:rancid-***@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
>
> ***@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 configs
> cvs commit: Examining .
> cvs commit: Examining configs
>
> ending: Wed Mar 11 08:05:14 CDT 2015
>
>
> rancid log when there are changes
>
> ***@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 configs
> cvs commit: Examining .
> cvs commit: Examining configs
> /usr/local/rancid/var/CVS/networking/configs/foundryswitch,v <-- configs/foundryswitch
> new 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 ] ; then
> BLOCKSIZE=1024; export BLOCKSIZE
> tmpk=`perl -e "my(@S) = stat(\"$TMP.diff\"); print int(\\$S[7] <smb://$S[7]> / 1024);"`
> unset BLOCKSIZE
> if [ $tmpk -lt $MAXSZ ] ; then
> MAXSZ=0
> fi
> 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
> else
> CDIR=`pwd`
> SDIR=${TMPDIR:=/tmp}/rancid.$GROUP.$$.mail
> error=`mkdir $SDIR`
> if [ $? -ne 0 ] ; then
> echo "Could not create $SDIR directory" >&2
> echo $error >&2
> else
> 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`; do
> n=`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"
> fi
> 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 $file
> ) | no -t $MAILOPTS
> LASTIDS="$LASTIDS $MSGID"
> if [ $n -lt $nfiles ]; then
> # this just tries to make the msgs order right in MUAs
> sleep 1
> fi
> done
> cd $CDIR
> rm -rf $SDIR
> fi
> fi
> fi
>
>
>
>
>
>
>
>
> _______________________________________________ Rancid-discuss mailing list Rancid-***@shrubbery.net <mailto:Rancid-***@shrubbery.net> http://www.shrubbery.net/mailman/listinfo/rancid-discuss <http://www.shrubbery.net/mailman/listinfo/rancid-discuss>_______________________________________________
> Rancid-discuss mailing list
> Rancid-***@shrubbery.net <mailto:Rancid-***@shrubbery.net>
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss <http://www.shrubbery.net/mailman/listinfo/rancid-discuss>
Daniel Shields
2015-03-12 04:02:26 UTC
Permalink
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: ***@gmail.com
Date: Wed, 11 Mar 2015 14:45:19 -0400
To: ***@hotmail.com
CC: rancid-***@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 - <***@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: ***@hotmail.com
To: ***@census.gov; ***@hotmail.com; rancid-***@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 ***@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: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-***@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
***@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
***@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-***@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss_______________________________________________Rancid-discuss mailing listRancid-***@shrubbery.nethttp://www.shrubbery.net/mailman/listinfo/rancid-discuss
Daniel Shields
2015-03-12 04:04:52 UTC
Permalink
Have you set
# SENDMAIL locationSENDMAIL=${SENDMAIL:=sendmail};
in control_rancid? Took me a bit to figure that one out.
From: ***@gmail.com
Date: Wed, 11 Mar 2015 14:45:19 -0400
To: ***@hotmail.com
CC: rancid-***@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 - <***@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: ***@hotmail.com
To: ***@census.gov; ***@hotmail.com; rancid-***@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 ***@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: ***@census.gov
To: ***@hotmail.com; rancid-***@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-***@shrubbery.net> on behalf of Tanner Lyle <***@hotmail.com>
Sent: Wednesday, March 11, 2015 10:07 AM
To: rancid-***@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
***@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
***@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-***@shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss_______________________________________________Rancid-discuss mailing listRancid-***@shrubbery.nethttp://www.shrubbery.net/mailman/listinfo/rancid-discuss
heasley
2015-03-12 12:33:34 UTC
Permalink
try 3.1.99; i think the sendmail check in configure is fixed.

the thread became illegible, but there was a note about postfix that was
not correct. postfix provides a binary named sendmail for compatibility
with sendmail. if it doesnt exist, your installation is incomplete - not
that this is a postfix help list.
Daniel Shields
2015-03-12 18:07:11 UTC
Permalink
Agreed. I'm on 3.1.99 and all works well. The sendmail binary was installed with postfix, just had to edit rancid_control to send to my email as aliases aren't working. I'll post back if I find a better fix. Thanks!

> Date: Thu, 12 Mar 2015 12:33:34 +0000
> From: ***@shrubbery.net
> To: rancid-***@shrubbery.net
> Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
>
> try 3.1.99; i think the sendmail check in configure is fixed.
>
> the thread became illegible, but there was a note about postfix that was
> not correct. postfix provides a binary named sendmail for compatibility
> with sendmail. if it doesnt exist, your installation is incomplete - not
> that this is a postfix help list.
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-***@shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
heasley
2015-03-12 18:13:38 UTC
Permalink
Thu, Mar 12, 2015 at 02:07:11PM -0400, Daniel Shields:
> I'll post back if I find a better fix. Thanks!

i think this too could be handled in 3.1.99 (to be 3.2). see MAILDOMAIN.
also see that it now supports a per-group rancid.conf; group/rancid.conf.
Daniel Shields
2015-03-12 18:33:31 UTC
Permalink
Thanks Heasley. I saw the MAILDOMAIN option last night. The issue I had though is that RANCID composes the mail with the groupname in the To: line which is expected, but when the mail is sent to postfix, postfix doesn't change the username in the to: line before sending it. Therefore the mail was sent to the correct domain, but to a non-existent user. I made the tweak to rancid_control as a work-around until I'm able to get postfix to use the aliases. I'll definitely check out the per-group rancid.conf as well though. Thanks!

> Date: Thu, 12 Mar 2015 18:13:38 +0000
> From: ***@shrubbery.net
> To: ***@hotmail.com
> CC: ***@shrubbery.net; rancid-***@shrubbery.net
> Subject: Re: [rancid] Rancid 3.1 control_rancid errors when there are diffs
>
> Thu, Mar 12, 2015 at 02:07:11PM -0400, Daniel Shields:
> > I'll post back if I find a better fix. Thanks!
>
> i think this too could be handled in 3.1.99 (to be 3.2). see MAILDOMAIN.
> also see that it now supports a per-group rancid.conf; group/rancid.conf.
Loading...