Discussion:
[rancid] Rancid 3.4.99 not sending "x machines have not been contacted within x hours" emails.
Remsik,Robert
2016-10-11 15:58:50 UTC
Permalink
Hello!


I'm running a 3.4.99 Rancid installation version and while rancid is grabbing the configs and diffs correctly it is not sending an email notification if a device has not been reached for more than 24 hours.


Looking at the code it appears as if this code block from $home/bin/control_rancid isn't being triggered. It also appears as if the echoes aren't going anywhere.


--- code block ---

# If any machines have not been reached within the last $OLDTIME
# hours, mail out a list of them.
cd $DIR/configs
rm -f $DIR/routers.failed
if [ "X$OLDTIME" = "X" ] ; then
OLDTIME=24
fi
perl -F; -ane "{\$t = (stat(\$F[0]))[9]; print \`ls -ld \$F[0]\`
if (time() - \$t >= $OLDTIME*60*60);}" $devlistfile | sort -u > $DIR/routers.failed
if [ -s $DIR/routers.failed ] ; then
(
echo "To: $adminmailrcpt"
echo "Subject: config fetcher problems - $GROUP"
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 ""
echo "The following routers have not been successfully contacted for"
echo "more than $OLDTIME hours."

cat $DIR/routers.failed
) | $SENDMAIL -t $MAILOPTS
fi
--- code block ---


Can anyone help? Thank you in advance,

Robert


Robert Remsik

ACNS

Desk Phone: 970 491 7120

***@colostate.edu
heasley
2016-10-11 21:11:36 UTC
Permalink
Tue, Oct 11, 2016 at 03:58:50PM +0000, Remsik,Robert:
> Hello!
>
>
> I'm running a 3.4.99 Rancid installation version and while rancid is grabbing the configs and diffs correctly it is not sending an email notification if a device has not been reached for more than 24 hours.
>
>
> Looking at the code it appears as if this code block from $home/bin/control_rancid isn't being triggered. It also appears as if the echoes aren't going anywhere.

look in the group's log for errors, such as sendmail not found. And, 3.4.99
would be an alpha version, somewhere along the line SENDMAIL was added to
rancid.conf; make sure you have it set. also, make sure that sendmail
actually works and that there isnt a ~rancid/dead.letter (meaning that
sendmail failed) or bounces in rancid's mailbox.
Remsik,Robert
2016-10-12 18:29:32 UTC
Permalink
That did it. The problem was with my aliases not being in the correct format.


Thank you




Robert Remsik

ACNS

Desk Phone: 970 491 7120

***@colostate.edu


________________________________
From: heasley <***@shrubbery.net>
Sent: Tuesday, October 11, 2016 3:11 PM
To: Remsik,Robert
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] Rancid 3.4.99 not sending "x machines have not been contacted within x hours" emails.

Tue, Oct 11, 2016 at 03:58:50PM +0000, Remsik,Robert:
> Hello!
>
>
> I'm running a 3.4.99 Rancid installation version and while rancid is grabbing the configs and diffs correctly it is not sending an email notification if a device has not been reached for more than 24 hours.
>
>
> Looking at the code it appears as if this code block from $home/bin/control_rancid isn't being triggered. It also appears as if the echoes aren't going anywhere.

look in the group's log for errors, such as sendmail not found. And, 3.4.99
would be an alpha version, somewhere along the line SENDMAIL was added to
rancid.conf; make sure you have it set. also, make sure that sendmail
actually works and that there isnt a ~rancid/dead.letter (meaning that
sendmail failed) or bounces in rancid's mailbox.
Loading...