]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix broken Jmsg in find_one.c
authorKern Sibbald <kern@sibbald.com>
Tue, 9 Mar 2004 10:24:18 +0000 (10:24 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 9 Mar 2004 10:24:18 +0000 (10:24 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1119 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/configure
bacula/examples/nagios.txt [new file with mode: 0644]
bacula/kernstodo
bacula/src/findlib/find_one.c
bacula/src/version.h

index 9ead700267b6ea1511abdd1a7e195162bdc614d8..d1513edbf22cf191719c0f1514e9feeeca3b348d 100755 (executable)
@@ -897,17 +897,14 @@ Optional Packages:
   --with-postgresql=DIR      Include PostgreSQL support.  DIR is the PostgreSQL
                           base install directory, defaults to /usr/local/pgsql
 
-Which DBMS do you want to use (please select only one):
   --with-mysql=DIR      Include MySQL support.  DIR is the MySQL base
                           install directory, default is to search through
                           a number of common places for the MySQL files.
 
-Which DBMS do you want to use (please select only one):
   --with-embedded-mysql=DIR Include MySQL support.  DIR is the MySQL base
                           install directory, default is to search through
                           a number of common places for the MySQL files.
 
-Which DBMS do you want to use (please select only one):
   --with-sqlite=DIR     Include SQLite support.  DIR is the SQLite base
                           install directory, default is to search through
                           a number of common places for the SQLite files.
diff --git a/bacula/examples/nagios.txt b/bacula/examples/nagios.txt
new file mode 100644 (file)
index 0000000..f26fec3
--- /dev/null
@@ -0,0 +1,267 @@
+From bacula-users-admin@lists.sourceforge.net Wed Mar  3 22:08:24 2004
+Return-Path: <bacula-users-admin@lists.sourceforge.net>
+Received: from sc8-sf-list2.sourceforge.net (lists.sourceforge.net
+       [66.35.250.206]) by matou.sibbald.com (8.12.10/8.12.10) with ESMTP id
+       i23L8Nb7003158 for <kern@sibbald.com>; Wed, 3 Mar 2004 22:08:24 +0100
+Received: from localhost ([127.0.0.1] helo=projects.sourceforge.net) by
+       sc8-sf-list2.sourceforge.net with esmtp (Exim 4.30) id 1Ayddz-0005F7-EZ;
+       Wed, 03 Mar 2004 13:11:07 -0800
+Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11]
+       helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp
+       (Exim 4.30) id 1AyddU-00058Y-25 for bacula-users@lists.sourceforge.net;
+       Wed, 03 Mar 2004 13:10:36 -0800
+Received: from zola.netways.de ([213.95.25.82]
+       helo=net-sql2.int.netways.de) by sc8-sf-mx1.sourceforge.net with esmtp
+       (Exim 4.30) id 1AydXy-0008Im-KW for bacula-users@lists.sourceforge.net;
+       Wed, 03 Mar 2004 13:04:54 -0800
+Content-class: urn:content-classes:message
+MIME-Version: 1.0
+Content-Type: text/plain; charset="iso-8859-1"
+Subject: RE: [Bacula-users] monitoring bacula with Nagios
+X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
+Message-ID: <2F6750F2110CAD41BE0BC33BB428B568FB9F@net-sql2.int.netways.de>
+X-MS-Has-Attach: 
+X-MS-TNEF-Correlator: 
+Thread-Topic: [Bacula-users] monitoring bacula with Nagios
+Thread-Index: AcPflloclgso3C9CREycI4VSOMnJBghyXnSwAACsf0A=
+From: "Julian Hein" <jhein@netways.de>
+To: <bacula-users@lists.sourceforge.net>
+X-Spam-Score: 0.0 (/)
+X-Spam-Report: Spam Filtering performed by sourceforge.net. See
+       http://spamassassin.org/tag/ for more details. Report problems to
+       http://sf.net/tracker/?func=add&group_id=1&atid=200001
+Sender: bacula-users-admin@lists.sourceforge.net
+Errors-To: bacula-users-admin@lists.sourceforge.net
+X-BeenThere: bacula-users@lists.sourceforge.net
+X-Mailman-Version: 2.0.9-sf.net
+Precedence: bulk
+List-Unsubscribe:
+       <https://lists.sourceforge.net/lists/listinfo/bacula-users>,
+       <mailto:bacula-users-request@lists.sourceforge.net?subject=unsubscribe>
+List-Id: Bacula user's email list for support and discussions
+       <bacula-users.lists.sourceforge.net>
+List-Post: <mailto:bacula-users@lists.sourceforge.net>
+List-Help: <mailto:bacula-users-request@lists.sourceforge.net?subject=help>
+List-Subscribe:
+       <https://lists.sourceforge.net/lists/listinfo/bacula-users>,
+       <mailto:bacula-users-request@lists.sourceforge.net?subject=subscribe>
+List-Archive:
+       <http://sourceforge.net/mailarchive/forum.php?forum=bacula-users>
+Date: Wed, 3 Mar 2004 22:04:49 +0100
+X-MIME-Autoconverted: from quoted-printable to 8bit by matou.sibbald.com id
+       i23L8Nb7003158
+Content-Transfer-Encoding: 8bit
+
+Hi,
+
+> Anyway: I would really like to write such a check_bacula 
+> plugin. I just 
+> don't know what I need to implement to achive a successful 
+> authentication. And maybe to get some infos out. Like current 
+> number of 
+> jobs, runtime or so.
+
+We are checking bacula with Nagios in two ways: First we check all servers if the neccessary services are running, like the fd on all bacula clients (windows & linux), directors, sd, etc. And the second check is to look in baculas mysql database if there is a successful job for every host within the last 24 hours:
+
+
+1. Check if the fd is running
+=============================
+
+Services:
+---------
+
+# bacula-fd linux
+check_command                   check_spezial_procs_by_ssh!2:!1:!bacula-fd
+
+# bacula-sd
+check_command                   check_spezial_procs_by_ssh!2:!1:!bacula-sd
+
+# bacula-dir
+check_command                   check_spezial_procs_by_ssh!2:!1:!bacula-dir
+
+# bacula-fd windows
+check_command                   check_nt_service!bacula
+
+Commands:
+---------
+
+# check for services by name with ssh
+define command {
+  command_name  check_spezial_procs_by_ssh
+  command_line  $USER1$/check_by_ssh -t 60 -H $HOSTADDRESS$ -C "/opt/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$"
+}
+
+# check for the bacula-fd on windows with nsclient
+define command {
+  command_name  check_nt_service
+  command_line  $USER1$/check_nt -H $HOSTADDRESS$ -p portno. -s password -v SERVICESTATE -l $ARG1$
+}
+
+2. Is there a successful job in the database
+============================================
+
+Services:
+---------
+
+# bacula jobs
+check_command    check_bacula_by_ssh!27!1!1
+
+Commands:
+---------
+The name of our backup jobs have to match the hostname in Nagios. So we can check on the backup server, for a job called $HOSTNAME$:
+
+define command {
+  command_name    check_bacula_by_ssh
+  command_line    $USER1$/check_by_ssh  -t 60 -H my.backup.server -C "/opt/nagios/libexec/check_bacula.pl -H $ARG1$ -w $
+ARG2$ -c $ARG3$ -j $HOSTNAME$"
+}
+
+check_bacula.pl:
+----------------
+
+#!/usr/bin/perl -w
+use strict;
+use POSIX;
+use File::Basename;
+use DBI;
+use Getopt::Long;
+use vars qw(
+       $opt_help
+          $opt_job
+          $opt_critical
+          $opt_warning
+          $opt_hours
+          $opt_usage
+          $opt_version
+          $out
+          $sql
+          $date_start
+          $date_stop
+          $state
+          $count
+          );
+          
+sub print_help();
+sub print_usage();
+sub get_now();
+sub get_date;
+
+my $progname = basename($0);
+
+my %ERRORS = ( 'UNKNOWN'       =>      '-1',
+               'OK'            =>      '0',
+               'WARNING'       =>      '1',
+               'CRITICAL'      =>      '2');
+
+Getopt::Long::Configure('bundling');
+GetOptions
+       (
+       "c=s"   =>      \$opt_critical, "critical=s"    =>      \$opt_critical,
+       "w=s"   =>      \$opt_warning,  "warning=s"     =>      \$opt_warning,
+       "H=s"   =>      \$opt_hours,    "hours=s"       =>      \$opt_hours,
+       "j=s"   =>      \$opt_job,      "job=s"         =>      \$opt_job,
+       "h"     =>      \$opt_help,     "help"          =>      \$opt_help,
+                                       "usage"         =>      \$opt_usage,
+       "V"     =>      \$opt_version,  "version"       =>      \$opt_version
+       ) || die "Try '$progname --help' for more information.\n";
+
+sub print_help() {
+print "\n";
+print "PRINT HELP...\n";
+print "\n";
+}
+
+sub print_usage() {
+ print "PRINT USAGE...\n";
+ print "\n";
+}
+
+sub get_now() {
+ my $now  = defined $_[0] ? $_[0] : time;
+ my $out = strftime("%Y-%m-%d %X", localtime($now));
+ return($out);
+}
+
+sub get_date {
+ my $day = shift;
+ my $now  = defined $_[0] ? $_[0] : time;
+ my $new = $now - ((60*60*1) * $day);
+ my $out = strftime("%Y-%m-%d %X", localtime($new));
+ return ($out);
+}
+
+if ($opt_help) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_usage) {
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_version) {
+ print "$progname 0.0.1\n";
+ exit $ERRORS{'UNKNOWN'};
+}
+
+
+if ($opt_job && $opt_warning && $opt_critical) {
+ my $dsn = "DBI:mysql:database=bacula;host=localhost";
+ my $dbh = DBI->connect( $dsn,'root','' ) or die "Error connecting to: '$dsn': $DBI::errstr\n";
+ if ($opt_hours)
+ {
+  $date_stop = get_date($opt_hours);
+ }
+  else
+  {
+   $date_stop = '1970-01-01 01:00:00';
+  }
+ $date_start = get_now();
+ $sql = "SELECT count(*) as 'count' from Job where (Name='$opt_job') and (JobStatus='T') and (EndTime <> '') and ((EndTime <= '$date_start') and (EndTime >= '$date_stop'));";
+
+ my $sth = $dbh->prepare($sql) or die "Error preparing statemment",$dbh->errstr;
+ $sth->execute;
+ while (my @row = $sth->fetchrow_array()) {
+  ($count) = @row;
+ }
+$state = 'OK';
+if ($count<$opt_warning) { $state='WARNING' }
+if ($count<$opt_critical) { $state='CRITICAL' }
+
+print "Bacula $state: Found $count successfull jobs\n";
+exit $ERRORS{$state};
+ $dbh->disconnect();
+}
+ else {
+  print_usage();
+ }
+
+Well, this script is not really finished, but it works for us. Maybe it is helpful for you. If somebody makes enhancements, I would be happy to recieve a copy.
+
+cu,
+Julian
+
+-- 
+Julian Hein                   NETWAYS GmbH
+Managing Director             Deutschherrnstr. 47a
+Fon.0911/92885-0              D-90429 Nürnberg
+Fax.0911/92885-31                                        
+jhein@netways.de              www.netways.de     
+
+
+
+
+-------------------------------------------------------
+This SF.Net email is sponsored by: IBM Linux Tutorials
+Free Linux tutorial presented by Daniel Robbins, President and CEO of
+GenToo technologies. Learn everything from fundamentals to system
+administration.http://ads.osdn.com/?ad_id\1470&alloc_id638&opÌk
+_______________________________________________
+Bacula-users mailing list
+Bacula-users@lists.sourceforge.net
+https://lists.sourceforge.net/lists/listinfo/bacula-users
index 29290c4bc8af7e56f27df0fd44a6bf5a6f89ded0..613c90c10f51df070868276f7ebdfc0c510dcc22 100644 (file)
@@ -37,11 +37,7 @@ Testing to do: (painful)
 - Test cancel at EOM.       
 
 For 1.33 Testing/Documentation:
-- Newly labeled tapes are chosen before ones already in use.
-- Document new alias records in Director. SDAddress SDDeviceName, SDPassword.
-  FDPassword, FDAddress, DBAddress, DBPort, DBPassword.
 - Document new Include/Exclude ...
-- Add test of exclusion, test multiple Include {} statements.
 - Add counter variable test.
 - Document ln -sf /usr/lib/libncurses.so /usr/lib/libtermcap.so
   and install the esound-dev  package for compiling Console on SuSE.
@@ -85,7 +81,6 @@ For 1.33
 - Allow "delete job jobid=xx jobid=xxx".   
 - Allow "delete job jobid=xxx,yyy,aaa-bbb" i.e. list + ranges.
 - Implement multiple Volume in "purge jobs volume=".
-- Rescue builds incorrect script files on Rufus.  
 - Fix option 2 of restore -- list where file is backed up -- require Client,
   then list last 20 backups.
 - Allow browsing the catalog to see all versions of a file (with 
@@ -95,7 +90,6 @@ For 1.33
 - Symbolic link a directory to another one, then backup the symbolic link.
 - Check and possibly fix problems with hard links.
 - Fix "llist jobid=xx" where no fileset or client exists.
-- Release SQLite 2.8.9
 - Add all pools in Dir conf to DB also update them to catch changed
   LabelFormats and such.
 - Build console in client-only build.
@@ -1413,3 +1407,6 @@ Block Position: 0
 - Make column listing for running jobs JobId Level Type Started Name  Status
 - Why does Bacula need the drive open to do "autochanger list" ?
 - Add data compare on write/read in btape "test". 
+- Rescue builds incorrect script files on Rufus.  
+- Release SQLite 2.8.9
+
index 226bc89e44ec2049ac2329e023bace69fc67b54d..cbd48f07245cc55153a53994001803f521e600b1 100755 (executable)
@@ -135,7 +135,8 @@ find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt),
         if (lp->ino == ff_pkt->statp.st_ino && lp->dev == ff_pkt->statp.st_dev) {
              /* If we have already backed up the hard linked file don't do it again */
             if (strcmp(lp->name, fname) == 0) {
-                Jmsg0(jcr, M_WARNING, 0, _("Attempt to backup hard linked file %s twice ignored.\n"));
+                Jmsg1(jcr, M_WARNING, 0, _("Attempt to backup hard linked file %s twice ignored.\n"),
+                  fname);
                return 1;             /* ignore */
             }
             ff_pkt->link = lp->name;
index 16ccc164b13154a228e99e4c72812f86623d4fcc..0f407c0dd23655ae8693cf60cf77c59133f06aa0 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.33.4"
 #define VSTRING "1"
-#define BDATE   "08 Mar 2004"
-#define LSMDATE "08Mar04"
+#define BDATE   "09 Mar 2004"
+#define LSMDATE "09Mar04"
 
 /* Debug flags */
 #undef  DEBUG