Bacula-users

Re: [Bacula-users] Can you tell which are active clients from Bacula's database?

2010-11-05 11:54:29
Subject: Re: [Bacula-users] Can you tell which are active clients from Bacula's database?
From: Bob Hetzel <beh AT case DOT edu>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 05 Nov 2010 11:51:41 -0400

I've created a report that we use to e-mail us of when a system has repeated failures--the interval we chose was 10 days but it could easily be changed to suit your needs. I'm sure that a more complex query could be created but I simplified the task and split it into two queries...

First I query out stuff that's never had a successful backup, then I do a separate query looking at what I attempted to back up that day... Attached is the perl program... Hopefully this little perl script will be helpful to you or anybody else.

I can see that this won't exactly solve your concern of eliminating records from the resultset that aren't "current". However, once the no-longer-active clients' backups have fully expired and you run the bacula 'dbcheck' tool they will be purged from the client list in the db so should be eliminated from the report.

   Bob

From: Matthew Seaman <mseaman AT squiz.co DOT uk>

Hi there,

We have a variable population of client machines being backed up
by bacula.  What I'd like to do is build a query for the bacula DB
that will detect eg. if any clients haven't had a full backup within the
last week.  (Yes -- I know there are configuration options to
automatically promote incrementals etc. to fulls in that situation:
we're using them.)  We'll then hook this up to our Nagios so the Ops
team gets alerted.

So I have come up with this query:

SELECT clientid, name, max(endtime) FROM job
    WHERE level = 'F' AND type = 'B' AND jobstatus = 'T'
    GROUP BY clientid, name
    HAVING max(endtime) < now() - interval '7 day'
    ORDER BY name

(We're using Postgresql)

This does pretty much what I want, except that the output includes job
records from clients that have been decommissioned and removed from
bacula-dir.conf.  Now, for the life of me, I can't see anything in the
DB that indicates whether a client backup job is active or not.  Is it
just me being blind or am I going to have to parse that out of the
bacula config files?

        Cheers,

        Matthew

-- Matthew Seaman Systems Administrator E mseaman AT squiz.co DOT uk


Attachment: bacula-report-failures.pl
Description: Text document

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Bacula-users] Can you tell which are active clients from Bacula's database?, Bob Hetzel <=