On 27 Aug 2006 at 11:37, Arunav Mandal wrote: > In the previous version 1.36.3 I used to a simple sql query that will show > which tapes are in changer and which tapes are offsite location. It looked > like this below. > > inchanger slot VolumeName VolStatus percent_full lastwritten > 1 3 SDLT005 Purged 76.1 2006-07-21 > 23:57:55 > 1 6 SDLT019 Purged 97.1 2006-07-22 > 12:08:12 > 1 7 SDLT016 Purged 83.4 2006-07-24 > 01:24:20 > 1 5 SDLT017 Full 110.2 2006-07-25 > 05:50:59 > 0 6 SDLT008 Full 101.9 2006-08-01 > 03:23:32 > 0 5 SDLT001 Full 100.4 2006-08-02 > 03:13:17 > > > Since the database structure changed a lot this script won't work now. I > used the following query that is given below. > > > #!/bin/sh > > echo "Content-type: text/html" > echo > echo "<html>" > echo "<head>" > echo "<title>Bacula Tape Status</title>" > echo "</head>" > echo "<body>" > > avg_capacity=`mysql -NB -u bacula -h heptagram -e "select > sum(VolBytes)/count(VolBytes) from Media where VolStatus = 'Full'" bacula` > mysql -H -u bacula -h heptagram -e "select inchanger, slot, VolumeName, > VolStatus, round((100 * VolBytes / $avg_capacity), 1) as percent_full, > lastwritten from Media where poolid=3 and > VolStatus!='Error' order by lastwritten;" bacula > > echo "</body>" > echo "</html>" > > The first query worked fine but not the second one.
Have you tried remove "poolid = 3" from the second query? ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users