Bacula-users

Re: [Bacula-users] Looking for a way to get the number of running jobs as a single number

2013-06-11 17:29:13
Subject: Re: [Bacula-users] Looking for a way to get the number of running jobs as a single number
From: Marcin Haba <ganiuszka AT gmail DOT com>
To: "Bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Tue, 11 Jun 2013 23:26:06 +0200
Dnia 2013-06-11, wto o godzinie 16:27 -0400, Jonathan Bayer pisze:
> I would like to be able to monitor the number of running jobs with our 
> monitoring system (Zabbix).  To do this I need a script which will 
> return the number without any additional text.
> 
> Is this available anywhere?  I don't see an easy way to do this.

Hi,

>>From what level want you get information about running jobs? (bconsole,
database).

I think that there is easy way to do this from database level. You may
run below SQL query:

SELECT COUNT(job.name) FROM job WHERE job.jobstatus IN ('C','R');

Above SQL query may be called from bconsole level as well. For example
by using "sql" bconsole command. It allows to call SQL queries from
bconsole level but then you will need to use additional tools for
strings operations (sed, awk, etc.).

For writing script purpose here you are examples usage bconsole requests
in shell scripts:

http://bacula.org/5.2.x-manuals/en/console/console/Bacula_Console.html#SECTION00280000000000000000

Regards.
Marcin Haba (gani)


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users