View Issue Details

IDProjectCategoryView StatusLast Update
0000083bareos-core[All Projects] installer / packagespublic2015-03-25 19:19
ReporterjoergsAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformLinuxOSanyOS Version3
Product Version12.4.1 
Fixed in Version 
Summary0000083: Bareos packages do not contain query.sql
Descriptioncurrently, the Bareos packages do not contain a query.sql file.

In the past, the sample-query.sql has been included.
The file is still referenced in /etc/bareos/bareos-dir.conf

How should be continue here?

The file src/dird/query.sql has following content:
#
# See the file <bareos-source>/examples/sample-query.sql
# for some sample queries.
#
# 1
:The default file is empty, see <bareos-source>/examples/sample-query.sql for samples
SELECT 'See <bareos-source>/examples/sample-query.sql for samples' AS Info;


It references to <bareos-source>/examples/sample-query.sql, but the examples directory does not exist.

Proposal:
- src/dird/query.sql
  - add a working example
  - remove references to examples/sample-query.sql
- install query.sql as config file to /etc/bareos/
- add query.sql to bareos-director package

@Marco: do you agree with this?
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

mvwieringen

mvwieringen

2013-02-21 13:34

developer   ~0000141

Yes I removed the examples on purpose as the contained very old stuff
which wasn't accurate anymore for the current version.

You can add some samples to the existing query.sql but keep in mind that
it only can be generic SQL queries that work on any database backend
(e.g. currently sqlite3, mysql, postgresql possibly more in the future.)
pstorz

pstorz

2013-02-23 08:01

administrator   ~0000148

I suggest the following:

We start by checking which queries already work on all databases (at least mysql and postgresql) and add them to the query file.

The queries that dont work can be added later.
joergs

joergs

2013-02-25 14:48

administrator   ~0000157

as I do not use queries, I assign this ticket to Erol.

@Erol: please provide some useful queries.

user12

2013-04-19 13:39

  ~0000357

I am through: all queries work well. Only query 17: "List Volumes Bacula thinks are eligible for the changer" might need adjustment. I will have to look deeper into it and report back.

user12

2013-05-07 14:52

  ~0000399

I will be able to check on 21th of May

user12

2013-06-05 16:33

  ~0000444

query 18 is somewhat misleading as it gives the sum of JobBytes - is that useful information?

 | 000074L5 | 200 | server | 2013-06-03 19:00:05 | 1,442
| 114234516459126 |

So we have in Volume 000074L5 around 108 TB

user12

2013-07-24 18:01

  ~0000541

query 18 should be this way (without the sum())
SELECT VolumeName, Job.JobId as JobID, Job.Name as JobName, Job.StartTime as
Start, JobFiles AS Files,ROUND(JobBytes/1024.0/1024.0/1024.0,3) AS GB
 FROM Job,JobMedia,Media
 WHERE JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, Jobbytes, Jobfiles, Job.StartTime
 ORDER by VolumeName;

user12

2013-07-24 18:05

  ~0000542

and so with query 19:
SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as
Start, JobFiles AS Files,ROUND(JobBytes/1024.0/1024.0/1024.0,3) AS GB
 FROM Job,JobMedia,Media
 WHERE JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, JobBytes, JobFiles, Job.StartTime
 ORDER by JobName, Start;

user12

2013-07-24 18:08

  ~0000543

and so with query 20:
SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as
Start, JobFiles AS Files,ROUND(JobBytes/1024.0/1024.0/1024.0,3) AS Bytes
 FROM Job,JobMedia,Media
 WHERE Job.Name='%1'
 AND JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, JobFiles, JobBytes, Job.StartTime
 ORDER by JobName, Start;

user12

2013-07-25 15:08

  ~0000544

Added RecycleCounts and changed the order in favor of VolError instead of Volstatus for query 16
:List Volumes likely to need replacement from age or errors
SELECT VolumeName AS Volume,VolErrors AS Errors, VolMounts AS Mounts,
         VolWrites AS Writes,RecycleCount,VolStatus AS Status
  FROM Media
  WHERE (VolErrors>0) OR (VolStatus='Error') OR (VolMounts>50) OR
         (VolStatus='Disabled') OR (VolWrites>3999999)
  ORDER BY VolErrors DESC, VolStatus, VolMounts,VolumeName DESC;

user12

2013-07-25 15:11

  ~0000545

added ROUND()
# 15
:List Volumes Bacula thinks are in changer

SELECT MediaId,VolumeName,ROUND(VolBytes/(1024.0*1024.0*1024.0),3) AS GB,Storage.Name
  AS Storage,Slot,Pool.Name AS Pool,MediaType,VolStatus
  FROM Media,Pool,Storage
  WHERE Media.PoolId=Pool.PoolId
  AND Slot>0 AND InChanger=1
  AND Media.StorageId=Storage.StorageId
  ORDER BY MediaType ASC, Slot ASC;

user12

2013-07-25 16:43

 

query.sql (9,350 bytes)

user12

2013-07-25 16:44

  ~0000549

Dear Jörg,

please integrate.

Thanks!

Best regards,

Erol
mvwieringen

mvwieringen

2013-07-27 17:11

developer   ~0000559

Fix committed to bareos master branch with changesetid 532.
mvwieringen adm

mvwieringen adm

2013-08-13 03:12

administrator   ~0000573

Fix committed to bareos master branch with changesetid 596.
mvwieringen

mvwieringen

2015-03-25 16:51

developer   ~0001491

Fix committed to bareos2015 bareos-14.2 branch with changesetid 5084.
joergs

joergs

2015-03-25 19:19

administrator   ~0001641

Due to the reimport of the Github repository to bugs.bareos.org, the status of some tickets have been changed. These tickets will be closed again.
Sorry for the noise.

Related Changesets

bareos: master aa9861c5

2013-07-26 15:21:35

joergs


Committer: mvwieringen adm

Ported: N/A

Details Diff
sample sql queries

provide sample sql queries, that can be used by the bconsole query command.

Fixes 0000083: Bareos packages do not contain query.sql

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Affected Issues
0000083
mod - src/dird/query.sql Diff File

bareos2015: bareos-14.2 e75cb33b

2013-07-26 17:21:35

joergs


Committer: mvwieringen

Ported: N/A

Details Diff
sample sql queries

provide sample sql queries, that can be used by the bconsole query command.

Fixes 0000083: Bareos packages do not contain query.sql

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Affected Issues
0000083
mod - src/dird/query.sql Diff File

Issue History

Date Modified Username Field Change
2013-02-21 11:48 joergs New Issue
2013-02-21 11:48 joergs Status new => assigned
2013-02-21 11:48 joergs Assigned To => mvwieringen
2013-02-21 13:34 mvwieringen Note Added: 0000141
2013-02-21 13:34 mvwieringen Assigned To mvwieringen => joergs
2013-02-23 08:01 pstorz Note Added: 0000148
2013-02-25 14:48 joergs Assigned To joergs => user12
2013-02-25 14:48 joergs Note Added: 0000157
2013-04-19 13:39 user12 Note Added: 0000357
2013-05-07 14:52 user12 Note Added: 0000399
2013-06-05 16:33 user12 Note Added: 0000444
2013-07-24 18:01 user12 Note Added: 0000541
2013-07-24 18:05 user12 Note Added: 0000542
2013-07-24 18:08 user12 Note Added: 0000543
2013-07-25 15:08 user12 Note Added: 0000544
2013-07-25 15:11 user12 Note Added: 0000545
2013-07-25 16:43 user12 File Added: query.sql
2013-07-25 16:44 user12 Assigned To user12 => joergs
2013-07-25 16:44 user12 Note Added: 0000549
2013-07-27 17:11 mvwieringen Changeset attached => bareos master 3279438d
2013-07-27 17:11 mvwieringen Note Added: 0000559
2013-07-27 17:11 mvwieringen Assigned To joergs => mvwieringen
2013-07-27 17:11 mvwieringen Status assigned => resolved
2013-07-27 17:11 mvwieringen Resolution open => fixed
2013-08-13 03:12 mvwieringen adm Changeset attached => bareos master aa9861c5
2013-08-13 03:12 mvwieringen adm Note Added: 0000573
2013-08-13 03:12 mvwieringen adm Assigned To mvwieringen => mvwieringen adm
2013-09-06 13:11 mvwieringen Status resolved => closed
2013-09-06 13:11 mvwieringen Assigned To mvwieringen adm =>
2015-03-25 16:51 mvwieringen Changeset attached => bareos2015 bareos-14.2 e75cb33b
2015-03-25 16:51 mvwieringen Note Added: 0001491
2015-03-25 16:51 mvwieringen Status closed => resolved
2015-03-25 19:19 joergs Note Added: 0001641
2015-03-25 19:19 joergs Status resolved => closed