Re: [Bacula-users] How to evaluate number of JobQueue-Entries?

2007-02-27 Thread Arno Lehmann
Hi,

On 2/27/2007 9:04 AM, Ralf Gross wrote:
> Jonas Wueste schrieb:
> 
>>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?
> 
> 
> Change the permissions, you don't have to run bconsole as root.
> 
> VU0EM005:/opt/bacula/sbin# su - bacula
> Kein Verzeichnis, Anmeldung mit HOME=/
> [EMAIL PROTECTED]:/$ bconsole
> Connecting to Director VU0EM005:9101
> 1000 OK: VU0EM005 Version: 2.0.2 (28 January 2007)
> Enter a period to cancel a command.

If you're worried about access to your Bacula by unauthorized users, you 
can also restrict the console connection to only allow the status 
command, by the way.

Arno

> Ralf
> 
> -
> 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

-- 
IT-Service Lehmann[EMAIL PROTECTED]
Arno Lehmann  http://www.its-lehmann.de

-
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


Re: [Bacula-users] How to evaluate number of JobQueue-Entries?

2007-02-27 Thread Ralf Gross
Jonas Wueste schrieb:
> 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?

Change the permissions, you don't have to run bconsole as root.

VU0EM005:/opt/bacula/sbin# su - bacula
Kein Verzeichnis, Anmeldung mit HOME=/
[EMAIL PROTECTED]:/$ bconsole
Connecting to Director VU0EM005:9101
1000 OK: VU0EM005 Version: 2.0.2 (28 January 2007)
Enter a period to cancel a command.

Ralf

-
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


Re: [Bacula-users] How to evaluate number of JobQueue-Entries?

2007-02-26 Thread Jonas Wueste
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 FullBackupCatalog.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


Re: [Bacula-users] How to evaluate number of JobQueue-Entries?

2007-02-26 Thread Arno Lehmann
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 FullBackupCatalog.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

-- 
IT-Service Lehmann[EMAIL PROTECTED]
Arno Lehmann  http://www.its-lehmann.de

-
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