Discussion:
[rancid] Email notifications
Steve Ousley
2008-06-26 09:01:23 UTC
Permalink
Hi



We have just noticed that our rancid cron job was not running, and therefore
the devices were not being backed up. Does anyone know of a way that you
could get this to email when rancid has run, wether it changed anything or
not, so that we at least get a notification that this has run.



Hopefully with this being the case, we should be able to notice if it's not
working again, and sort it a lot sooner than the month or so that it took to
notice it this time.



Alternatively, if anyone knows of a way to get the cron job to mail a
successful/unsuccessful run of rancid-run, then this would also be useful.



Thanks in advance.



Steve Ousley - SO620-RIPE

Nuco Technologies Ltd

<mailto:***@host-it.co.uk> ***@host-it.co.uk

<http://www.nucotechnologies.com/> www.nucotechnologies.com

Tel. 0870 165 1300



Nuco Technologies Ltd is a company registered in England and Wales
with company number 04470751
Steve Ousley
2008-06-26 12:27:39 UTC
Permalink
OK, upon further investigation, it wasn't in fact cron that was failing.
The cron was running the script no problems, however having implemented a
new script that also backs the configs up, we hadn't added the "rancid-run"
command to this (it takes a little while to run, and wanted to know it would
copy the files ok).

I think your solution (with this in mind) is the best way to go about it.
Since that will also report if cron fails, OR if rancid-run fails.

Is there a file that gets updated every time rancid runs? Or is it best to
simply add in something like:

echo "" >> /path/to/rancid/did.it.run

so that when it runs, it will update that file, and therefore the
modification time on that file.

You think this would be the best way?

Steve Ousley - SO620-RIPE

-----Original Message-----
From: Burton Windle [mailto:***@fint.org]
Sent: 26 June 2008 13:21
To: Steve Ousley
Subject: Re: [rancid] Email notifications

Perhaps something that monitors the RANCID log directory, and takes note
when no files have been added recently?

What was causing cron to fail?
--
Post by Steve Ousley
Hi
 
We have just noticed that our rancid cron job was not running, and
therefore the devices were not being backed up.  Does anyone know of a
Post by Steve Ousley
way that you could get this to email when rancid has run, wether it
changed anything or not, so that we at least get a notification that
Post by Steve Ousley
this has run.
 
Hopefully with this being the case, we should be able to notice if it?s
not working again, and sort it a lot sooner than the month or so
Post by Steve Ousley
that it took to notice it this time.
 
Alternatively, if anyone knows of a way to get the cron job to mail a
successful/unsuccessful run of rancid-run, then this would also be
Post by Steve Ousley
useful.
 
Thanks in advance.
 
Steve Ousley - SO620-RIPE
Steve Ousley
2008-06-26 13:00:27 UTC
Permalink
That should work :)

I actually have a script that runs that runs rancid-run and then the file
backup anyway, so I might just add a bit to the end of that that mails us on
successful completion of that, and then use this method in cron to mail if
it failed.

Thanks Tom :)

Steve Ousley - SO620-RIPE

-----Original Message-----
From: Thomas C. Knoeller [mailto:***@pretend.net]
Sent: 26 June 2008 13:57
To: Steve Ousley
Subject: Re: [rancid] Re: Email notifications

How about something in cron like this?

rancid-run && backup-files || mail -s 'rancid or backup of rancid
failed' ***@my.domain </dev/null

Runs rancid, if successful, runs the backup script.
If either fail it sends the email.

-Tom
Steve Ousley
2008-06-26 21:10:13 UTC
Permalink
Of Course! I forgot about the rancid log locations :D

Steve Ousley - SO620-RIPE
Nuco Technologies Ltd
***@host-it.co.uk
www.nucotechnologies.com
Tel. 0870 165 1300

Nuco Technologies Ltd is a company registered in England and Wales
with company number 04470751


-----Original Message-----
From: Bill Jacqmein [mailto:***@gmail.com]
Sent: 26 June 2008 18:38
To: Steve Ousley
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] Email notifications

Steve,

Files should be created under the log directory (default:
/home/rancid/var/logs)
RouterLocation.YYYYMMDD.HHMMSS
They might be more useful then creating another file.

Enjoy,

Bill
Post by Steve Ousley
Hi
We have just noticed that our rancid cron job was not running, and therefore
the devices were not being backed up. Does anyone know of a way that you
could get this to email when rancid has run, wether it changed anything or
not, so that we at least get a notification that this has run.
Hopefully with this being the case, we should be able to notice if it's not
working again, and sort it a lot sooner than the month or so that it took to
notice it this time.
Alternatively, if anyone knows of a way to get the cron job to mail a
successful/unsuccessful run of rancid-run, then this would also be useful.
Thanks in advance.
Steve Ousley - SO620-RIPE
Nuco Technologies Ltd
www.nucotechnologies.com
Tel. 0870 165 1300
Nuco Technologies Ltd is a company registered in England and Wales
with company number 04470751
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Bill Jacqmein
2008-06-26 17:37:51 UTC
Permalink
Steve,

Files should be created under the log directory (default:
/home/rancid/var/logs)
RouterLocation.YYYYMMDD.HHMMSS
They might be more useful then creating another file.

Enjoy,

Bill
Post by Steve Ousley
Hi
We have just noticed that our rancid cron job was not running, and therefore
the devices were not being backed up. Does anyone know of a way that you
could get this to email when rancid has run, wether it changed anything or
not, so that we at least get a notification that this has run.
Hopefully with this being the case, we should be able to notice if it's not
working again, and sort it a lot sooner than the month or so that it took to
notice it this time.
Alternatively, if anyone knows of a way to get the cron job to mail a
successful/unsuccessful run of rancid-run, then this would also be useful.
Thanks in advance.
Steve Ousley - SO620-RIPE
Nuco Technologies Ltd
www.nucotechnologies.com
Tel. 0870 165 1300
Nuco Technologies Ltd is a company registered in England and Wales
with company number 04470751
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...