Jochen Hein <[email protected]> writes:

> I'm running bacula to backup some clients to a disk pool, and that pool
> was running out of space.  So, what client took up all that space?
> Here's the very simple script importing the data into ganglia:

That script helped in my situation, but was not entirely correct. It
still count data, where the retention time has already passed. Here is a
better script:

> ---------------------------------------------------------------
#!/bin/sh


sqlite3 -noheader -separator ' ' /var/lib/bacula/bacula.db \
        "select Client.Name, round(sum(JobBytes)/(1024*1024*1024.0),2)
        from ( select distinct Job.JobId, Job.ClientId as cid, Job.JobBytes 
from Job
                join JobMedia
                        on JobMedia.JobId = Job.JobId
                join Media
                        on Media.MediaId = JobMedia.MediaId
                        where datetime(Media.LastWritten,Media.VolRetention ||' 
seconds') > datetime('now') ) 
        join Client
                        on Client.ClientId = cid
                        group by Client.ClientId;" |
   while read client jobbytes; do
      gmetric --group=bacula --name="bacula-client-$client" --value=$jobbytes \
         --units=GB --desc="saved data for $client" --type=float \
         --title="saved data for $client"
   done

exit

> ---------------------------------------------------------------

Jochen

-- 
The only problem with troubleshooting is that the trouble shoots back.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Ganglia-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to