[Rear-users] SMall patch for Bacula check

Gratien D'haese gratien.dhaese at it3.be
Tue Dec 14 13:12:32 CET 2010


Hi Dag,

Thank you for your suggestion - added it to the
trunk.

Br,
Gratien

On Fri, 10 Dec 2010 18:37:49 +0100 (CET), Dag Wieers
wrote:
> Hi,
> 
> Here is a small patch that checks for a client definition
in the bacula 
> configuration. Since it is not mandatory to use a FQDN,
checking with 
> hostname instead of hostname -s might fail. As it does on
my 
> infrastructure.
> 
> The below patch fixes it so it works for both
situations.
> 
> Index:
>
usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh
>
===================================================================
> ---
usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh
>
(revision 179)
> +++
usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh
>
(working copy)
> @@ -21,8 +21,8 @@
> # and that the director can connect to
the file daemon on this system.
> # "Connecting to Director
'director_name-fd:9101'"
> # "Connecting to Client 'bacula_client_name-fd
at FQDN:9102"
> -BACULA_CLIENT=`grep $(hostname) /etc/bacula/bacula-fd.conf
| grep "-fd"
> | awk '{print }' | cut -d"-" -f1`
> -[ -z "${BACULA_CLIENT}"
] && ProgressStopIfError 1 "Client $(hostname)
> not defined in
/etc/bacula/bacula-fd.conf"
> +BACULA_CLIENT=`grep $(hostname -s)
/etc/bacula/bacula-fd.conf | grep
> "-fd" | awk '{print }' | cut -d"-"
-f1`
> +[ -z "${BACULA_CLIENT}" ] && ProgressStopIfError 1 "Client
$(hostname -s)
> not defined in /etc/bacula/bacula-fd.conf"
> 
>
BACULA_RESULT=( `echo -e " status client=${BACULA_CLIENT}-fd" | bconsole
>
|grep Connect ` )
> 
> Thanks in advance,
> -- 
> -- dag wieers,
dag at wieers.com, http://dag.wieers.com/
> -- dagit linux solutions,
info at dagit.net, http://dagit.net/
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pikachu.3ti.be/pipermail/rear-users/attachments/20101214/4c53cc79/attachment.html 


More information about the rear-users mailing list