Arno Lehmann schrieb:
> Hi,
>
> On 2/26/2007 3:32 PM, Jonas Wueste wrote:
>   
>> Hi,
>>
>> I want to evaluate the number of currently queued jobs. At first I 
>> wanted to do this with a mysql-query. (SELECT COUNT(*) from Job where 
>> JobStatus ='C')
>>     
>
> That's not the best solution, as the catalog doesn't necessarily 
> represent the state of the currently running DIR. You already know that :-)
>
>   
>> My Problem is that there are some old entries with the status "Created, 
>> not yet running", wich shouldn't be deleted.
>> Is there an other possibility to get the number of queued jobs?
>> Currently I'm running Bacula Version: 2.0.1
>>     
>
> Ask the DIR and count ;-)
>
> I'd use something like 'echo 'sta dir' | bconsole -c 
> /etc/bacula/bconsole.conf' and some awk magic which I can't easily 
> produce - I'm not really fluent in awk, but anyone with some experience 
> with it will easily suggest an awk script to count the lines matching 
> some RE. Example output from my system:
>
>    9025 Increme  DracheStd.2007-02-26_08.20.00 is running
>    9032 Increme  GoblinDB.2007-02-26_08.25.05 is waiting for higher 
> priority jobs to finish
>    9033 Differe  BackupMail.2007-02-26_08.30.01 is running
>    9034 Full    BackupCatalog.2007-02-26_08.34.02 is waiting execution
>    9035         Shutdown.2007-02-26_09.00.00 has been canceled
>
>
> So, to find what's currently queued, you need lines matching '^.*is 
> waiting.*$' hmm, no need for awk there (though that could make the query 
> more robust) but grep is sufficient:
>
> echo 'sta dir' | bconsole -c /etc/bacula/bconsole.conf | grep -ce '^.*is 
> waiting.*$'
> 2
>
> Try that and see if it works for you!
>
> Arno
>
>   
>> Greetings,
>> Jonas
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>     
Thanks so far.
The problem is that bconsole only can be run with root rights.
I want to transmit the querys result via nrpe to my nagios-server and 
the nrpe user on the local machine has no root privileges.
So, is there a possibility  to get the value without root privileges?

Jonas

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to