updatedb/update_mysql_tables_10_to_11 \
updatedb/update_sqlite3_tables_10_to_11 \
updatedb/update_postgresql_tables_10_to_11 \
+ examples/nagios/check_bacula/Makefile.in \
$PFILES ],
[ ]
)
--- /dev/null
+#
+# Version $Id: Makefile.in,v 1.4 2004/09/25 10:19:59 nboichat Exp $
+#
+@MCOMMON@
+
+srcdir = .
+VPATH = .
+.PATH: .
+
+# one up
+basedir = ../../../src
+# top dir
+topdir = ../../..
+# this dir relative to top dir
+thisdir = ../examples/nagios/check_bacula
+
+DEBUG=@DEBUG@
+
+first_rule: all
+dummy:
+
+#
+CHECKSRCS = check_bacula.c authenticate.c
+CHECKOBJS = check_bacula.o authenticate.o
+
+# these are the objects that are changed by the .configure process
+EXTRAOBJS = @OBJLIST@
+
+CHECK_CPPFLAGS=
+CHECK_LDFLAGS=
+
+.SUFFIXES: .c .o
+.PHONY:
+.DONTCARE:
+
+# inference rules
+.c.o:
+ @echo "Compiling $<"
+ $(NO_ECHO) $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CHECK_CPPFLAGS) \
+ -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+#-------------------------------------------------------------------------
+all: Makefile check_bacula
+ @echo "==== Make of check_bacula is good ===="
+ @echo " "
+
+check_bacula: Makefile $(CHECKOBJS) $(basedir)/lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(CHECK_LDFLAGS) -L$(basedir)/lib -o $@ \
+ $(CHECKOBJS) $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
+
+
+Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ cd $(topdir) \
+ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+libtool-clean:
+ $(RMF) -r .libs _libs
+
+clean:
+ @$(RMF) check_bacula core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
+
+realclean: clean
+ @$(RMF) tags
+
+distclean: realclean
+ if test $(srcdir) = .; then $(MAKE) realclean; fi
+ (cd $(srcdir); $(RMF) Makefile)
+
+devclean: realclean
+ if test $(srcdir) = .; then $(MAKE) realclean; fi
+ (cd $(srcdir); $(RMF) Makefile)
+
+install: all
+ $(INSTALL_PROGRAM) check_bacula $(DESTDIR)$(sbindir)/check_bacula
+
+uninstall:
+ (cd $(DESTDIR)$(sbindir); $(RMF) check_bacula)
+
+
+
+# Semi-automatic generation of dependencies:
+# Use gcc -MM because X11 `makedepend' doesn't work on all systems
+# and it also includes system headers.
+# `semi'-automatic since dependencies are generated at distribution time.
+
+depend:
+ @$(MV) Makefile Makefile.bak
+ @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
+ @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
+ @$(CXX) -S -M $(CPPFLAGS) $(CHECK_CPPFLAGS) -I$(srcdir) -I$(basedir) *.c >> Makefile
+ @if test -f Makefile ; then \
+ $(RMF) Makefile.bak; \
+ else \
+ $(MV) Makefile.bak Makefile; \
+ echo -e "Something went wrong\n\a"; \
+ fi
+
+# -----------------------------------------------------------------------
+# DO NOT DELETE: nice dependency list follows
--- /dev/null
+# It's more or less untested, though.
+# Submitted by Arno Lehmann <al@its-lehmann.de>
+#
+
+run ./configure with your usual options at the toplevel. Afterwards, use
+'make' to create your binaries.
+
+If you encounter problems, you'll have to setup the Bacula source manually.
+
+Note that check_bacula does not support TLS and is an unsupported add-on to
+Bacula. Even if it's not part of the core Bacula programs, questions can be
+asked at the bacula-users mailing list.
+
+Bacula is a Trademark of Kern Sibbald. Bacula and the accompanying programs
+are open source. See the LICENSE file for more information.
--- /dev/null
+/*
+ *
+ * Bacula authentication. Provides authentication with
+ * File and Storage daemons.
+ *
+ * Nicolas Boichat, August MMIV
+ *
+ * This routine runs as a thread and must be thread reentrant.
+ *
+ * Basic tasks done here:
+ *
+ */
+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
+
+#include "bacula.h"
+#include "check_bacula.h"
+
+void senditf(const char *fmt, ...);
+void sendit(const char *buf);
+
+/* Commands sent to Director */
+static char DIRhello[] = "Hello %s calling\n";
+
+/* Response from Director */
+static char DIROKhello[] = "1000 OK:";
+
+/* Commands sent to Storage daemon and File daemon and received
+ * from the User Agent */
+static char SDFDhello[] = "Hello Director %s calling\n";
+
+/* Response from SD */
+static char SDOKhello[] = "3000 OK Hello\n";
+/* Response from FD */
+static char FDOKhello[] = "2000 OK Hello\n";
+static char FD3OKhello[] = "2000 OK Hello 1\n";
+static char FD31OKhello[] = "2000 OK Hello 2\n";
+
+/* Forward referenced functions */
+
+/*
+ * Authenticate Director
+ */
+int authenticate_director(BSOCK *dir, char *dirname, char *password)
+{
+ int tls_local_need = BNET_TLS_NONE;
+ int tls_remote_need = BNET_TLS_NONE;
+ int compatible = true;
+ char bashed_name[MAX_NAME_LENGTH];
+
+ bstrncpy(bashed_name, dirname, sizeof(bashed_name));
+ bash_spaces(bashed_name);
+
+ /* Timeout Hello after 5 mins */
+ btimer_t *tid = start_bsock_timer(dir, 60 * 5);
+ bnet_fsend(dir, DIRhello, bashed_name);
+
+ if (!cram_md5_respond(dir, password, &tls_remote_need, &compatible) ||
+ !cram_md5_challenge(dir, password, tls_local_need, compatible)) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+
+ Dmsg1(6, ">dird: %s", dir->msg);
+ if (bnet_recv(dir) <= 0) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ Dmsg1(10, "<dird: %s", dir->msg);
+ stop_bsock_timer(tid);
+ if (strncmp(dir->msg, DIROKhello, sizeof(DIROKhello)-1) != 0) {
+ return 0;
+ }
+ return 1;
+}
+
+/*
+ * Authenticate Storage daemon connection
+ */
+int authenticate_storage_daemon(BSOCK *sd, char *sdname, char* password)
+{
+ char dirname[MAX_NAME_LENGTH];
+ int tls_local_need = BNET_TLS_NONE;
+ int tls_remote_need = BNET_TLS_NONE;
+ int compatible = true;
+
+ /*
+ * Send my name to the Storage daemon then do authentication
+ */
+ bstrncpy(dirname, sdname, sizeof(dirname));
+ bash_spaces(dirname);
+ /* Timeout Hello after 5 mins */
+ btimer_t *tid = start_bsock_timer(sd, 60 * 5);
+ if (!bnet_fsend(sd, SDFDhello, dirname)) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ if (!cram_md5_respond(sd, password, &tls_remote_need, &compatible) ||
+ !cram_md5_challenge(sd, password, tls_local_need, compatible)) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ Dmsg1(116, ">stored: %s", sd->msg);
+ if (bnet_recv(sd) <= 0) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ Dmsg1(110, "<stored: %s", sd->msg);
+ stop_bsock_timer(tid);
+ if (strncmp(sd->msg, SDOKhello, sizeof(SDOKhello)) != 0) {
+ return 0;
+ }
+ return 1;
+}
+
+/*
+ * Authenticate File daemon connection
+ */
+int authenticate_file_daemon(BSOCK *fd, char *fdname, char *password)
+{
+ char dirname[MAX_NAME_LENGTH];
+ int tls_local_need = BNET_TLS_NONE;
+ int tls_remote_need = BNET_TLS_NONE;
+ int compatible = true;
+
+ /*
+ * Send my name to the File daemon then do authentication
+ */
+ bstrncpy(dirname, fdname, sizeof(dirname));
+ bash_spaces(dirname);
+ /* Timeout Hello after 5 mins */
+ btimer_t *tid = start_bsock_timer(fd, 60 * 5);
+ if (!bnet_fsend(fd, SDFDhello, dirname)) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ if (!cram_md5_respond(fd, password, &tls_remote_need, &compatible) ||
+ !cram_md5_challenge(fd, password, tls_local_need, compatible)) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ Dmsg1(116, ">filed: %s", fd->msg);
+ if (bnet_recv(fd) <= 0) {
+ stop_bsock_timer(tid);
+ return 0;
+ }
+ Dmsg1(110, "<stored: %s", fd->msg);
+ stop_bsock_timer(tid);
+ if ((strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0) &&
+ (strncmp(fd->msg, FD3OKhello, sizeof(FD3OKhello)) != 0) &&
+ (strncmp(fd->msg, FD31OKhello, sizeof(FD31OKhello)) != 0) ) {
+ return 0;
+ }
+ return 1;
+}
--- /dev/null
+/*
+ *
+ * Nagios Plugin check_bacula
+ *
+ * Christian Masopust, (c)2005
+ *
+ * Version $Id: check_bacula.c,v 1.0 2005/02/25
+ */
+
+/*
+ Copyright (C) 2005 Christian Masopust
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+#include "bacula.h"
+#include "check_bacula.h"
+
+#define STATE_OK 0
+#define STATE_WARNING 1
+#define STATE_CRITICAL 2
+#define STATE_UNKNOWN 3
+
+
+/* Imported functions */
+int authenticate_director(BSOCK *s, char *dirname, char *password);
+int authenticate_file_daemon(BSOCK *s, char *fdname, char *password);
+int authenticate_storage_daemon(BSOCK *s, char* sdname, char *password);
+
+/* Forward referenced functions */
+void writecmd(monitoritem* item, const char* command);
+int docmd(monitoritem* item, const char* command, char *answer);
+
+/* Static variables */
+static monitoritem mitem;
+
+/* Data received from DIR/FD/SD */
+static char OKqstatus[] = "%c000 OK .status\n";
+
+
+
+static void usage()
+{
+ fprintf(stderr, _(
+"Copyright (C) 2005 Christian Masopust\n"
+"Written by Christian Masopust (2005)\n"
+"\nVersion: " VERSION " (" BDATE ") %s %s %s\n\n"
+"Usage: check_bacula [-d debug_level] -H host -D daemon -N name -P port\n"
+" -H <host> hostname where daemon runs\n"
+" -D <daemon> which daemon to check: dir|sd|fd\n"
+" -M <name> name of monitor (as in bacula-*.conf)\n"
+" -K <md5-hash> password for access to daemon\n"
+" -P <port> port where daemon listens\n"
+" -dnn set debug level to nn\n"
+" -? print this message.\n"
+"\n"), HOST_OS, DISTNAME, DISTVER);
+}
+
+
+/*********************************************************************
+ *
+ * Main Bacula Tray Monitor -- User Interface Program
+ *
+ */
+int main(int argc, char *argv[])
+{
+ int ch;
+ DIRRES s_dird;
+ CLIENT s_filed;
+ STORE s_stored;
+
+ char host[250];
+ char daemon[20];
+ char monitorname[100];
+ char pw[200];
+ int port = 0;
+
+ char answer[1024];
+ int retcode = STATE_UNKNOWN;
+
+ unsigned int i, j;
+ struct MD5Context md5c;
+ unsigned char signature[16];
+
+
+ struct sigaction sigignore;
+ sigignore.sa_flags = 0;
+ sigignore.sa_handler = SIG_IGN;
+ sigfillset(&sigignore.sa_mask);
+ sigaction(SIGPIPE, &sigignore, NULL);
+
+ strcpy (pw, "");
+
+ init_stack_dump();
+ my_name_is(argc, argv, "check_bacula");
+ textdomain("bacula");
+ init_msg(NULL, NULL);
+
+ while ((ch = getopt(argc, argv, "H:D:M:P:K:d:h?")) != -1) {
+
+ switch (ch) {
+
+ case 'H':
+ strcpy (host, optarg);
+ break;
+
+ case 'D':
+ strcpy (daemon, optarg);
+ break;
+
+ case 'M':
+ strcpy (monitorname, optarg);
+ break;
+
+ case 'P':
+ port = atoi(optarg);
+ break;
+
+ case 'K':
+ strcpy (pw, optarg);
+ break;
+
+ case 'd':
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
+ break;
+
+ case 'h':
+ case '?':
+ default:
+ usage();
+ exit(1);
+ }
+ }
+ argc -= optind;
+ //argv += optind;
+
+ if (argc) {
+ usage();
+ exit(STATE_UNKNOWN);
+ }
+
+ lmgr_init_thread();
+
+ char sig[100];
+ MD5Init(&md5c);
+ MD5Update(&md5c, (unsigned char *) pw, strlen(pw));
+ MD5Final(signature, &md5c);
+ for (i = j = 0; i < sizeof(signature); i++) {
+ sprintf(&sig[j], "%02x", signature[i]);
+ j += 2;
+ }
+
+
+ /* director ? */
+ if (strcmp (daemon, "dir") == 0) {
+
+ if (port != 0)
+ s_dird.DIRport = port;
+ else
+ s_dird.DIRport = 9101;
+
+ s_dird.address = host;
+ s_dird.password = sig;
+ s_dird.hdr.name = monitorname;
+
+ mitem.type = R_DIRECTOR;
+ mitem.resource = &s_dird;
+ mitem.D_sock = NULL;
+
+ } else if (strcmp (daemon, "sd") == 0) {
+
+ if (port != 0)
+ s_stored.SDport = port;
+ else
+ s_stored.SDport = 9103;
+
+ s_stored.address = host;
+ s_stored.password = sig;
+ s_stored.hdr.name = monitorname;
+
+ mitem.type = R_STORAGE;
+ mitem.resource = &s_stored;
+ mitem.D_sock = NULL;
+
+ } else if (strcmp (daemon, "fd") == 0) {
+
+ if (port != 0)
+ s_filed.FDport = port;
+ else
+ s_filed.FDport = 9102;
+
+ s_filed.address = host;
+ s_filed.password = sig;
+ s_filed.hdr.name = monitorname;
+
+ mitem.type = R_CLIENT;
+ mitem.resource = &s_filed;
+ mitem.D_sock = NULL;
+
+ } else {
+
+ usage();
+ exit(1);
+ }
+
+
+ if (mitem.type == R_DIRECTOR)
+ retcode = docmd(&mitem, ".status dir current\n", answer);
+ else
+ retcode = docmd(&mitem, ".status current\n", answer);
+
+
+ if (mitem.D_sock) {
+ bnet_sig(mitem.D_sock, BNET_TERMINATE); /* send EOF */
+ bnet_close(mitem.D_sock);
+ }
+
+ printf ("%s\n", answer);
+ return retcode;
+}
+
+
+static int authenticate_daemon(monitoritem* item) {
+
+ DIRRES *d;
+ CLIENT *f;
+ STORE *s;
+
+ switch (item->type) {
+ case R_DIRECTOR:
+ d = (DIRRES *)item->resource;
+ return authenticate_director(item->D_sock, d->hdr.name, d->password);
+ break;
+ case R_CLIENT:
+ f = (CLIENT *)item->resource;
+ return authenticate_file_daemon(item->D_sock, f->hdr.name, f->password);
+ break;
+ case R_STORAGE:
+ s = (STORE *)item->resource;
+ return authenticate_storage_daemon(item->D_sock, s->hdr.name, s->password);
+ break;
+ default:
+ printf("Error, currentitem is not a Client or a Storage..\n");
+ return FALSE;
+ }
+}
+
+
+
+int docmd(monitoritem* item, const char* command, char *answer) {
+
+ int stat;
+ char num;
+ char *dname;
+
+ dname = "";
+
+ if (!item->D_sock) {
+
+ DIRRES* dird;
+ CLIENT* filed;
+ STORE* stored;
+
+ switch (item->type) {
+ case R_DIRECTOR:
+ dird = (DIRRES*)item->resource;
+ item->D_sock = bnet_connect(NULL, 0, 0, 0, "Director daemon", dird->address, NULL, dird->DIRport, 0);
+ dname = "Director";
+ break;
+ case R_CLIENT:
+ filed = (CLIENT*)item->resource;
+ item->D_sock = bnet_connect(NULL, 0, 0, 0, "File daemon", filed->address, NULL, filed->FDport, 0);
+ dname = "FileDaemon";
+ break;
+ case R_STORAGE:
+ stored = (STORE*)item->resource;
+ item->D_sock = bnet_connect(NULL, 0, 0, 0, "Storage daemon", stored->address, NULL, stored->SDport, 0);
+ dname = "StorageDaemon";
+ break;
+ default:
+ printf("Error, currentitem is not a Client, a Storage or a Director..\n");
+ return STATE_UNKNOWN;
+ }
+
+ if (item->D_sock == NULL) {
+ sprintf (answer, "BACULA CRITICAL - Cannot connect to %s!", dname);
+ return STATE_CRITICAL;
+ }
+
+ if (!authenticate_daemon(item)) {
+ sprintf (answer, "BACULA CRITICAL - Cannot authenticate to %s: %s", dname, item->D_sock->msg);
+ item->D_sock = NULL;
+ return STATE_CRITICAL;
+ }
+
+ }
+
+ if (command[0] != 0)
+ writecmd(item, command);
+
+ while(1) {
+ if ((stat = bnet_recv(item->D_sock)) >= 0) {
+
+ /* welcome message of director */
+ if ((item->type == R_DIRECTOR) && (strncmp(item->D_sock->msg, "Using ", 6) == 0))
+ continue;
+
+ if (sscanf(item->D_sock->msg, OKqstatus, &num) != 1) {
+ /* Error, couldn't find OK */
+ sprintf (answer, "BACULA CRITICAL - %s Status: %s", dname, item->D_sock->msg);
+ return STATE_CRITICAL;
+ } else {
+ sprintf (answer, "BACULA OK - %s Status OK", dname);
+ return STATE_OK;
+ }
+ }
+ else if (stat == BNET_SIGNAL) {
+ if (item->D_sock->msglen == BNET_EOD) {
+ strcpy(answer, "BACULA WARNING - << EOD >>");
+ return STATE_WARNING;
+ }
+ else if (item->D_sock->msglen == BNET_PROMPT) {
+ strcpy(answer, "BACULA WARNING - BNET_PROMPT signal received.");
+ return STATE_WARNING;
+ }
+ else if (item->D_sock->msglen == BNET_HEARTBEAT) {
+ bnet_sig(item->D_sock, BNET_HB_RESPONSE);
+ }
+ else {
+ sprintf(answer, "BACULA WARNING - Unexpected signal received : %s ", bnet_sig_to_ascii(item->D_sock));
+ }
+ }
+ else { /* BNET_HARDEOF || BNET_ERROR */
+ strcpy(answer, "BACULA CRITICAL - ERROR: BNET_HARDEOF or BNET_ERROR");
+ item->D_sock = NULL;
+ return STATE_CRITICAL;
+ }
+
+ if (is_bnet_stop(item->D_sock)) {
+ item->D_sock = NULL;
+ return STATE_WARNING;
+ }
+ }
+}
+
+void writecmd(monitoritem* item, const char* command) {
+ if (item->D_sock) {
+ item->D_sock->msglen = strlen(command);
+ pm_strcpy(&item->D_sock->msg, command);
+ bnet_send(item->D_sock);
+ }
+}
+
--- /dev/null
+/*
+ * Includes specific to the tray monitor
+ *
+ * Nicolas Boichat, August MMIV
+ *
+ * Version $Id: tray-monitor.h,v 1.6 2004/08/25 12:20:01 nboichat Exp $
+ */
+/*
+ Copyright (C) 2004 Kern Sibbald and John Walker
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ */
+
+/*
+ * Resource codes -- they must be sequential for indexing
+ */
+enum rescode {
+ R_MONITOR = 1001,
+ R_DIRECTOR,
+ R_CLIENT,
+ R_STORAGE,
+ R_FIRST = R_MONITOR,
+ R_LAST = R_STORAGE /* keep this updated */
+};
+
+
+/*
+ * Some resource attributes
+ */
+enum {
+ R_NAME = 1020,
+ R_ADDRESS,
+ R_PASSWORD,
+ R_TYPE,
+ R_BACKUP
+};
+
+/* Director */
+struct DIRRES {
+ RES hdr;
+ int DIRport; /* UA server port */
+ char *address; /* UA server address */
+ char *password; /* UA server password */
+ int enable_ssl; /* Use SSL */
+};
+
+/*
+ * Tray Monitor Resource
+ *
+ */
+struct MONITOR {
+ RES hdr;
+ int require_ssl; /* Require SSL for all connections */
+ MSGS *messages; /* Daemon message handler */
+ char *password; /* UA server password */
+ utime_t RefreshInterval; /* Status refresh interval */
+ utime_t FDConnectTimeout; /* timeout for connect in seconds */
+ utime_t SDConnectTimeout; /* timeout in seconds */
+};
+
+
+/*
+ * Client Resource
+ *
+ */
+struct CLIENT {
+ RES hdr;
+
+ int FDport; /* Where File daemon listens */
+ char *address;
+ char *password;
+ int enable_ssl; /* Use SSL */
+};
+
+/*
+ * Store Resource
+ *
+ */
+struct STORE {
+ RES hdr;
+
+ int SDport; /* port where Directors connect */
+ char *address;
+ char *password;
+ int enable_ssl; /* Use SSL */
+};
+
+
+
+/* Define the Union of all the above
+ * resource structure definitions.
+ */
+union URES {
+ MONITOR res_monitor;
+ DIRRES res_dir;
+ CLIENT res_client;
+ STORE res_store;
+ RES hdr;
+};
+
+
+
+struct monitoritem {
+ rescode type; /* R_DIRECTOR, R_CLIENT or R_STORAGE */
+ void* resource; /* DIRRES*, CLIENT* or STORE* */
+ BSOCK *D_sock;
+};
+++ /dev/null
-#!/bin/sh
-#
-# This script prepares the source for compiling check_bacula
-#
-# It's more or less untested, though.
-# Submitted by Arno Lehmann <al@its-lehmann.de>
-#
-
-# Save configure
-mv -uiv configure configure.without_check_bacula
-
-# Modify ./configure
-sed -e 's/\(ac_config_files=".*$PFILES\)"/\1 src\/check_bacula\/Makefile"/' -e 's/\(^ *# Handling of arguments.*$\)/\1\n "src\/check_bacula\/Makefile" ) CONFIG_FILES="$CONFIG_FILES src\/check_bacula\/Makefile" ;;/' configure.without_check_bacula > configure
-chmod a+x configure
-
-# extract check_bacula source
-tar xzCf src examples/nagios/nagios_plugin_check_bacula.tgz
-
-echo "Now you can run ./configure with your usual options. Afterwards, use
-'make' to create your binaries. Then you can run 'make' in
-src/check_bacula to create that program.
-
-If you encounter problems, you'll have to setup the Bacula source manually.
-The original configure script has been saved to configure.without_check_bacula
-
-Note that check_bacula does not support TLS and is an unsupported add-on to
-Bacula. Even if it's not part of the core Bacula programs, questions can be
-asked at the bacula-users mailing list.
-
-Bacula is a Trademark of Kern Sibbald. Bacula and the accompanying programs
-are open source. See the LICENSE file for more information.
-"