Magnus Ringdahl | 23 Mar 09:55 2015
Picon

[rancid] Rancid 3.2 issue with perl/inet_pton

Hi,

I’m having issues with rancid since i upgraded (removed old and installed 3.2) rancid.

I’m getting no output from rancid-run, but I get the following from rancid –d.

 

"inet_pton" is not exported by the Socket module

Can't continue after import errors at /usr/local/rancid/lib/rancid/rancid.pm line 51

BEGIN failed--compilation aborted at /usr/local/rancid/lib/rancid/rancid.pm line 51.

Compilation failed in require at ./rancid line 61.

BEGIN failed--compilation aborted at ./rancid line 61.

 

 

Anyone seen this before, couldn’t find much about this issue.

I’m running this on Debian 2.6.32-5-686 with Perl 5.10.1-17squeeze2.

 

Med vänlig hälsning/Kind Regards,

 

Magnus Ringdahl
Lagmansgatan 4B

214 66 Malmö
M: 0766-34 88 86
T: 040-670 76 90

 

http://www.excellent-hosting.se

 

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Andrew S. Meyer | 22 Mar 20:25 2015

[rancid] Setting up Rancid on FreeBSD 10.1

Hi everyone,

I seem to be having some difficulty getting rancid to send emails on FBSD 10.1 using postfix or sendmail (built-in).  I have configured postfix to relay to another mail server in my setup but doesn’t seem to do it when I have the rancid cronjob setup to run.  Although if I run the following command uname -a | mail -s "`uname -n`: Test mail config" user <at> tld.com it works just fine.  I can run this command as any user and it works, but the automated emails do not for the rancid user.  Has anyone else run into this?  If so how do you fix it?  I’m almost done with my rancid setup.

 

Here is my postfix config

 

root <at> monitoring1:~ # postconf -n

postconf: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/local/sbin

config_directory = /usr/local/etc/postfix

daemon_directory = /usr/local/libexec/postfix

data_directory = /var/db/postfix

debug_peer_level = 2

debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5

html_directory = /usr/local/share/doc/postfix

inet_protocols = ipv4

mail_owner = postfix

mailq_path = /usr/local/bin/mailq

manpage_directory = /usr/local/man

mynetworks_style = host

newaliases_path = /usr/local/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/local/share/doc/postfix

relayhost = [192.168.220.56]

sample_directory = /usr/local/etc/postfix

sendmail_path = /usr/local/sbin/sendmail

setgid_group = maildrop

unknown_local_recipient_reject_code = 550

root <at> monitoring1:~ #

 

/var/log/maillog output

Mar 22 14:15:00 monitoring1 postfix/local[1513]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 14:15:00 monitoring1 postfix/local[1513]: warning: database /etc/mail/aliases.db is older than source file /etc/mail/aliases

Mar 22 14:15:00 monitoring1 postfix/local[1513]: 0E2DC7590B: to=<rancid <at> monitoring1.borg.priv>, orig_to=<rancid>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

Mar 22 14:15:00 monitoring1 postfix/qmgr[632]: 0E2DC7590B: removed

Mar 22 14:20:00 monitoring1 postfix/sendmail[1586]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 19:20:00 monitoring1 postfix/postdrop[1588]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 14:20:00 monitoring1 postfix/cleanup[1594]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 14:20:00 monitoring1 postfix/pickup[631]: 096427590B: uid=1002 from=<rancid>

Mar 22 14:20:00 monitoring1 postfix/trivial-rewrite[1595]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 14:20:00 monitoring1 postfix/cleanup[1594]: 096427590B: message-id=<20150322192000.096427590B <at> monitoring1.borg.priv>

Mar 22 14:20:00 monitoring1 postfix/qmgr[632]: 096427590B: from=<rancid <at> monitoring1.borg.priv>, size=622, nrcpt=1 (queue active)

Mar 22 14:20:00 monitoring1 postfix/local[1597]: warning: /usr/local/etc/postfix/main.cf, line 573: overriding earlier entry: alias_maps=dbm:/etc/mail/aliases

Mar 22 14:20:00 monitoring1 postfix/local[1597]: warning: database /etc/mail/aliases.db is older than source file /etc/mail/aliases

Mar 22 14:20:00 monitoring1 postfix/local[1597]: 096427590B: to=<rancid <at> monitoring1.borg.priv>, orig_to=<rancid>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

Mar 22 14:20:00 monitoring1 postfix/qmgr[632]: 096427590B: removed

root <at> monitoring1:~ #

 

 

As for rancid – here is what I have setup:

 

 

LIST_OF_GROUPS="NetworkDevices"

MAILDOMAIN=" <at> borg.local"; export MAILDOMAIN

 

I have run rancid-cvs to set it all up.

 

Here is the crontab for rancid.  I have it setup to check and email me so often to do some testing.  I DO plan to change this once completed:

 

[rancid <at> monitoring1 ~]$ crontab -l

1,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/rancid-run #hourly router dump

1,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/find /usr/local/var/rancid/logs -type -f -mtime +2 -exec rm -rf {} \;

[rancid <at> monitoring1 ~]$

 

Also,

Has anyone started using Rancid 3.0 yet?  If so how hard is it to setup?

 

 

Andrew

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
shouldbe q931 | 19 Mar 18:59 2015
Picon

[rancid] failure with downloading old versions

I tried to download an older version of rancid from
ftp://ftp.shrubbery.net/pub/rancid/.old/ but got an access denied
message.

I was wondering if the permissions had changed, they currently look like
-r--r-----  1 7053  rancid   372436 Feb 15  2011 rancid-2.3.6.tar.gz

Cheers
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Matthew Walster | 18 Mar 23:33 2015

[rancid] Merging rancid-git with mainline rancid

Hi,

For a few years now, I've been running a separate patch tree for the git work Jeff Ollie once did. I've accepted a few patches into it for different functionality, but ultimately I've been trying to get people to submit these patches to upstream (i.e. here). Very few (if any) actually did.

Now that we have git support in the mainline release, I'd like to try and re-integrate those patches back upstream... Except there's a big problem:

rancid-git currently does one repo per install.

rancid currently does one repo per group.

Clearly, the rancid (upstream) way is a consistent, proper way to do it. Therefore I'm planning on writing some kind of migration tool which will re-write a history. Would that be interesting to people?

Also, John Heasley -- there's a few patches in my branch that might be interesting to you (pfsense support, fixes for modern F5 etc), would you prefer patch sets of "one per feature" to be submitted, or just one big patch set? Feel free to reject anything you don't like.

Many thanks in advance,

Matthew Walster
aka "the git that was running a fork he barely maintained"
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Jason Humes | 17 Mar 20:07 2015
Picon

Re: [rancid] upgrade to rancid 3.2 from 3.1 and getting error "Use of uninitialized value $norder...."

Hi
Yes that patch fixed the errors.
Thanks

Jason 

-----Original Message-----
From: heasley [mailto:heas <at> shrubbery.net] 
Sent: Tuesday, March 17, 2015 2:55 PM
To: Jason Humes
Cc: heasley
Subject: Re: [rancid] upgrade to rancid 3.2 from 3.1 and getting error "Use of uninitialized value $norder...."

Tue, Mar 17, 2015 at 05:59:11PM +0000, Jason Humes:
> Hi
> It would be a device type of cisco.

does this patch fix it?

> Thanks
> 
> 
> Jason
> 
> 
> -----Original Message-----
> From: heasley [mailto:heas <at> shrubbery.net]
> Sent: Tuesday, March 17, 2015 11:25 AM
> To: Jason Humes
> Cc: rancid-discuss <at> shrubbery.net
> Subject: Re: [rancid] upgrade to rancid 3.2 from 3.1 and getting error "Use of uninitialized value $norder...."
> 
> Tue, Mar 17, 2015 at 03:19:19PM +0000, Jason Humes:
> > Hi
> > Just upgraded our rancid from 3.1 to 3.2 and now getting this error 
> > in the logs;
> > 
> > Use of uninitialized value $norder in unpack at /home/rancid/lib/rancid/rancid.pm line 378, <INPUT>
line 1971.
> 
> do you know what device type is generating the error?  i think its a bug in the script calling ipsort().

Index: lib/rancid.pm.in
===================================================================
--- lib/rancid.pm.in	(revision 3065)
+++ lib/rancid.pm.in	(working copy)
 <at>  <at>  -366,7 +366,9  <at>  <at> 
 	    $l = 128;
 	}
 	$norder = inet_pton(AF_INET6, $a);
-	return unpack("H*", $norder) . unpack("H*", pack("C", $l));
+	if (defined($norder)) {
+	    return unpack("H*", $norder) . unpack("H*", pack("C", $l));
+	}
     } else {
 	my($l);
 	if ($a =~ /\//) {
 <at>  <at>  -375,7 +377,9  <at>  <at> 
 	    $l = 32;
 	}
 	$norder = inet_pton(AF_INET, $a);
-	return(unpack("H*", $norder) . unpack("H*", pack("C", $l)));
+	if (defined($norder)) {
+	    return(unpack("H*", $norder) . unpack("H*", pack("C", $l)));
+	}
     }

     # otherwise return the original key value, so as not to sort on null

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Jason Humes | 17 Mar 16:19 2015
Picon

[rancid] upgrade to rancid 3.2 from 3.1 and getting error "Use of uninitialized value $norder...."

Hi
Just upgraded our rancid from 3.1 to 3.2 and now getting this error in the logs;

Use of uninitialized value $norder in unpack at /home/rancid/lib/rancid/rancid.pm line 378, <INPUT>
line 1971.

This is an Ubuntu system...any idea what this error is and how to correct?

Thanks

Jason 

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Josten, Michael | 16 Mar 09:28 2015
Picon

[rancid] switch timeout, empty config in SVN

Hello,

 

some older switches, like Enterasys matrix N7 don’t get processed by rancid reliably.
Sometimes it shows “Error: TIMEOUT reached” after some lines. Is there a variable
I can tweak for a polling rate or wait timer ? Those old switches have weak cpu power
and are easily stressed.

 

Best regards

Michael Josten

Mitarbeiter IT-Betrieb

Hochschule Niederrhein
KIS – Kommunikations und Informationssysteme Service
Niederrhein University of Applied Sciences
Communication and Informationsystems Service

Reinarzstr. 49
D – 47805 Krefeld
Telefon: +49 2151 822 3129
Fax: +49 2151 822 853123
Email: michael.josten <at> hs-niederrhein.de
www.hs-niederrhein.de

 

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
heasley | 13 Mar 21:43 2015
Picon

Re: [rancid] Mikrotik + ssh with cert + rancid + as rancid user = can not login ?

Fri, Mar 13, 2015 at 05:07:19PM +0000, Lukasz Sokol:
> On 13/03/15 16:56, Lukasz Sokol wrote:
> > On 13/03/15 14:40, heasley wrote:
> >> Fri, Mar 13, 2015 at 01:42:56PM +0000, Lukasz Sokol:
> >>> rancid <at> george:~$ bin/mtlogin myrouter
> >>> myrouter
> >>> spawn ssh -c 3des -x -l myuser+ct myrouter
> >>
> >> what is the full spawn line above?
> >>
> > [...]
> > 
> > so the joke is on ssh probably ?
> > 
> > Joke's definitively on ssh, duh.
> > 
> 
> Sorry, it's been a long day ;)
> 
> Actually
> 
> - it's mtlogin that does not seem to pass -i to ssh at all

indeed it doesnt; contributed code.

does this patch work?

Index: bin/mtlogin.in
===================================================================
--- bin/mtlogin.in	(revision 3056)
+++ bin/mtlogin.in	(working copy)
 <at>  <at>  -119,7 +119,10  <at>  <at> 
 	    set do_passwd 0
 	# ssh passphrase
 	} -r* {
-	    # ignore -r
+	    if {! [regexp .\[rR\](.+) $arg ignore passphrase]} {
+		incr i
+		set avpassphrase [lindex $argv $i]
+	    }
 	# Version string
 	} -V* {
 	    send_user "rancid 2.3.2a9\n"
 <at>  <at>  -290,7 +293,7  <at>  <at> 

 # Log into the router.
 # returns: 0 on success, 1 on failure
-proc login { router user userpswd passwd prompt cmethod cyphertype } {
+proc login { router user userpswd passwd prompt cmethod cyphertype identfile } {
     global spawn_id in_proc do_command do_script
     global u_prompt p_prompt sshcmd
     set in_proc 1
 <at>  <at>  -312,10 +315,20  <at>  <at> 
 		return 1
 	    }
 	} elseif ![string compare $prog "ssh"] {
-            if [ catch {spawn $sshcmd -c $cyphertype -x -l $user+ct $router} reason ] {
-                send_user "\nError: $sshcmd failed: $reason\n"
-                return 1
-            }
+	    # ssh to the router & try to login with or without an identfile.
+	    regexp {ssh(:([^[:space:]]+))*} $prog methcmd suffix port
+	    set cmd $sshcmd
+	    if {"$port" != ""} {
+		set cmd "$cmd -p $port"
+	    }
+	    if {"$identfile" != ""} {
+		set cmd "$cmd -i $identfile"
+	    }
+	    set retval [catch {eval spawn [split "$cmd -c $cyphertype -x -l $user+ct $router" { }]} reason]
+	    if { $retval } {
+		send_user "\nError: $cmd failed: $reason\n"
+		return 1
+	    }
 	} elseif ![string compare $prog "rsh"] {
 	    send_error "\nError: unsupported method: rsh\n"
 	    if { $progs == 0 } {
 <at>  <at>  -527,6 +540,19  <at>  <at> 
 	set p_prompt [join [lindex $p_prompt 0] ""]
     }

+    # Figure out identity file to use
+    set identfile [join [lindex [find identity $router] 0] ""]
+
+    # Figure out passphrase to use
+    if {[info exists avpassphrase]} {
+	set passphrase $avpassphrase
+    } else {
+	set passphrase [join [lindex [find passphrase $router] 0] ""]
+    }
+    if { ! [string length "$passphrase"]} {
+	set passphrase $passwd
+    }
+
     # Figure out cypher type
     if {[info exists cypher]} {
       # command line cypher type
 <at>  <at>  -545,7 +571,7  <at>  <at> 
     if { "$sshcmd" == "" } { set sshcmd {ssh} }

     # Login to the router
-    if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
+    if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype $identfile]} {
 	incr exitval
 	continue
     }

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Lukasz Sokol | 13 Mar 14:42 2015
Picon

[rancid] Mikrotik + ssh with cert + rancid + as rancid user = can not login ?

Hi,
my first post here, hopefully I can still be helped ;)

I'm on Rancid 2.3.8-3 and ssh 6.0p1-4+deb7u1 from Debian repos.

As myself (user lukasz), from command line, i can do

[myrouter is not yet in router.db, imagine an IP given here]
[myuser is configured in .cloginrc see way below]

lukasz <at> george:~$ ~rancid/bin/mtlogin myrouter
myrouter
spawn ssh -c 3des -x -l myuser+ct myrouter

[mikrotik router welcome and  prompt follow as normal]

and get into ssh prompt, no problem here.

(I've a certificate made by /me/ in .ssh and installed on the router,
and also router is in cached ssh fingerprints, so no problem here either)

Next then I copied & chown'd the .cloginrc and the certificate file
into relevant places in ~rancid, first doing ssh to myrouter to add it to fingerprint cache, 

then I'm trying to run mtlogin as rancid user and I get this:

lukasz <at> george:~$ sudo su - rancid
[sudo] password for lukasz: 
rancid <at> george:~$ cd
rancid <at> george:~$ pwd
/var/lib/rancid
rancid <at> george:~$ bin/mtlogin myrouter
myrouter
spawn ssh -c 3des -x -l myuser+ct myrouter
myuser+ct <at> myrouter's password: 
Permission denied, please try again.
myuser+ct <at> myrouter's password: y
Permission denied, please try again.
myuser+ct <at> myrouter's password: 
Permission denied (password).

Error: Check your passwd for myrouter
rancid <at> george:~$ 

So it seems to be somehow /not/ noticing there is a certificate to be used...?

...but :

> rancid <at> george:~$ ls -l .ssh/
total 12
-rw------- 1 rancid rancid  668 Dec 27  2013 id_ssa_for_mt_backup

...and :

> rancid <at> george:~$ ssh -i .ssh/id_ssa_for_mt_backup myuser <at> myrouter

gives me ssh to Mikrotik myrouter as normal...

~rancid/.cloginrc has

add user * myuser
add password * totallyboguspassword
add method * ssh
add identity * /var/lib/rancid/.ssh/id_ssa_for_mt_backup // this line on 'lukasz' user is without path

Any pointer / keyword / wave of hand would be appreciated.

Kind Regards

el es

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Jason Humes | 12 Mar 21:05 2015
Picon

[rancid] rancid finding changes that do not exist

Hi
We've got some devices that rancid thinks have changed but have not, for example;

Index: configs/acs_internetmonitoringfirewall
===================================================================
- -- configs/acs_internetmonitoringfirewall	(revision 3422)
 <at>  <at>  -344,13 +344,13  <at>  <at> 
  ip http secure-server
  ip http secure-port 4444
  !
+ ip nat inside source static tcp 142.46.14.24 21 interface 
+ FastEthernet0/0 21 ip nat inside source static tcp 142.46.14.172 443 
+ interface FastEthernet0/0 443 ip nat inside source static tcp 
+ 142.46.14.172 80 interface FastEthernet0/0 80
  ip nat inside source static udp 142.46.14.167 162 interface FastEthernet0/0 162
  ip nat inside source static udp 142.46.14.163 69 interface FastEthernet0/0 69
  ip nat inside source static udp 142.46.14.19 514 interface FastEthernet0/0 514
  ip nat inside source static udp 142.46.14.169 9996 interface FastEthernet0/0 9996
- ip nat inside source static tcp 142.46.14.24 21 interface FastEthernet0/0 21
- ip nat inside source static tcp 142.46.14.172 443 interface FastEthernet0/0 443
- ip nat inside source static tcp 142.46.14.172 80 interface FastEthernet0/0 80
  ip nat inside source route-map nat interface FastEthernet0/0 overload
  ip route 10.1.0.0 255.255.0.0 172.31.230.225
=================================================================

The line;

+ ip nat inside source static tcp 142.46.14.24 21 interface 
+ FastEthernet0/0 21

Is actually;
ip nat inside source static tcp 142.46.14.24 21 interface FastEthernet0/0 21

Which rancid says was remvoed (-ip nat inside source static tcp 142.46.14.24 21 interface
FastEthernet0/0 21)

Any idea why it is parsing the text like this?

Jason 

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Tanner - | 11 Mar 19:29 2015
Picon

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 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: 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

<!-- .ExternalClass .ecxhmmessage P { padding:0px; } .ExternalClass body.ecxhmmessage { font-size:12pt; font-family:Calibri; } -->
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 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: 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

.ExternalClass P { }
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 configs
cvs 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 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( <at> 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} <at> `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-discuss <at> shrubbery.net http://www.shrubbery.net/mailman/listinfo/rancid-discuss
<!-- .ExternalClass .ecxhmmessage P { padding:0px; } .ExternalClass body.ecxhmmessage { font-size:12pt; font-family:Calibri; } -->
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Gmane