From: Eric Bollengier Date: Mon, 23 Jun 2008 14:48:20 +0000 (+0000) Subject: ebl Fix nagios script for client and group X-Git-Tag: Release-3.0.0~1244 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e3479d255797ed1f10374a077e477cc837b2cfde;p=bacula%2Fbacula ebl Fix nagios script for client and group git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7221 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/script/check_bacula.pl b/gui/bweb/script/check_bacula.pl index c88dae3d41..e8210990c5 100644 --- a/gui/bweb/script/check_bacula.pl +++ b/gui/bweb/script/check_bacula.pl @@ -133,13 +133,26 @@ CGI::param(-name=> 'client_group', -value => \@group); my ($where, undef) = $bweb->get_param(qw/clients client_groups/); +my $c_filter =""; +my $g_filter = ""; + +if (@client) { + $c_filter = " JOIN Client USING (ClientId) "; +} + +if (@group) { + $g_filter = " JOIN client_group_member USING (ClientId) " . + " JOIN client_group USING (client_group_id) "; +} + ################################################################ # check if more than X jobs are running for too long (more than # 2 hours) since Y ago $query = " SELECT count(1) AS nb - FROM Job + FROM Job $c_filter $g_filter + WHERE JobStatus = 'R' AND Type = 'B' AND JobTDate > $since @@ -164,7 +177,8 @@ if ($res) { $query = " SELECT count(1) AS nb - FROM Job + FROM Job $c_filter $g_filter + WHERE JobStatus IN ('E','e','f','A') AND Type = 'B' AND JobTDate > $since