Hi,

On 8/22/2006 11:00 PM, Masopust, Christian wrote:
> Hello Dan,
> 
> as check_bacula is my child it's up to me to answer this :-))

that reminds me... :-)

I upgraded to Bacula 1.39.22 and the check_bacula doesn't work any longer:

> elf:/usr/local/nagios2/libexec # ./check_bacula -H goblin -D dir -K yesindeed 
> -M elf-monitor ; echo $?
> BACULA CRITICAL - Director Status: Automatically selected Catalog: BaculaCat
> 
> 2

I managed to fix this myself by ignoring a message starting with
"Automatically selected Catalog:" - just like it's done with "Using " -
but I found that there's some other problem, too.

During make, I get:
> ==>Entering directory 
> /srv/nfsexport/bacula/bacula-1.39.22-20060908/src/check_bacula
> make[1]: Entering directory 
> `/srv/nfsexport/bacula/bacula-1.39.22-20060908/src/check_bacula'
> /usr/bin/g++   -c -fno-strict-aliasing -fno-exceptions -fno-rtti  -I. -I..  
> -g -O2 -Wall -fn
> o-strict-aliasing -fno-exceptions -fno-rtti  check_bacula.c
> /usr/bin/g++   -c -fno-strict-aliasing -fno-exceptions -fno-rtti  -I. -I..  
> -g -O2 -Wall -fn
> o-strict-aliasing -fno-exceptions -fno-rtti  authenticate.c
> authenticate.c: In function `int authenticate_director(BSOCK*, char*, char*)':
> authenticate.c:71: error: `cram_md5_get_auth' undeclared (first use this
>    function)
> authenticate.c:71: error: (Each undeclared identifier is reported only once 
> for
>    each function it appears in.)
> authenticate.c:72: error: `cram_md5_auth' undeclared (first use this function)
> authenticate.c: In function `int authenticate_storage_daemon(BSOCK*, char*,
>    char*)':
> authenticate.c:108: error: `cram_md5_get_auth' undeclared (first use this
>    function)
> authenticate.c:109: error: `cram_md5_auth' undeclared (first use this 
> function)
> authenticate.c: In function `int authenticate_file_daemon(BSOCK*, char*, 
> char*)
>    ':
> authenticate.c:144: error: `cram_md5_get_auth' undeclared (first use this
>    function)
> authenticate.c:145: error: `cram_md5_auth' undeclared (first use this 
> function)
> make[1]: *** [authenticate.o] Error 1
> make[1]: Leaving directory 
> `/srv/nfsexport/bacula/bacula-1.39.22-20060908/src/check_bacula'

Looking into the technotes file, I noticed the following line:

kes  Rename the cram_md5 routine names to be slightly more appropriate
      to what they are doing (challenge and respond).

With some help from the tray-monitor sources, I fixed that, too. The
source now compiles, and my modifications are these:

diff -u check_bacula.orig/authenticate.c check_bacula/authenticate.c
--- check_bacula.orig/authenticate.c    2005-11-02 13:56:49.000000000 +0100
+++ check_bacula/authenticate.c 2006-09-11 23:23:39.144430393 +0200
@@ -60,6 +60,7 @@
     int tls_local_need = BNET_TLS_NONE;
     int tls_remote_need = BNET_TLS_NONE;
     char bashed_name[MAX_NAME_LENGTH];
+   int compat = true;

     bstrncpy(bashed_name, dirname, sizeof(bashed_name));
     bash_spaces(bashed_name);
@@ -68,8 +69,8 @@
     btimer_t *tid = start_bsock_timer(dir, 60 * 5);
     bnet_fsend(dir, DIRhello, bashed_name);

-   if (!cram_md5_get_auth(dir, password, &tls_remote_need) ||
-       !cram_md5_auth(dir, password, tls_local_need)) {
+   if (!cram_md5_respond(dir, password, &tls_remote_need, &compat) ||
+       !cram_md5_challenge(dir, password, tls_local_need, compat)) {
        stop_bsock_timer(tid);
        return 0;
     }
@@ -93,6 +94,7 @@
     char dirname[MAX_NAME_LENGTH];
     int tls_local_need = BNET_TLS_NONE;
     int tls_remote_need = BNET_TLS_NONE;
+   int compat = true;

     /*
      * Send my name to the Storage daemon then do authentication
@@ -105,8 +107,8 @@
        stop_bsock_timer(tid);
        return 0;
     }
-   if (!cram_md5_get_auth(sd, password, &tls_remote_need) ||
-       !cram_md5_auth(sd, password, tls_local_need)) {
+   if (!cram_md5_respond(sd, password, &tls_remote_need, &compat) ||
+       !cram_md5_challenge(sd, password, tls_local_need, compat)) {
        stop_bsock_timer(tid);
        return 0;
     }
@@ -129,6 +131,7 @@
     char dirname[MAX_NAME_LENGTH];
     int tls_local_need = BNET_TLS_NONE;
     int tls_remote_need = BNET_TLS_NONE;
+   int compat = true;

     /*
      * Send my name to the File daemon then do authentication
@@ -141,8 +144,8 @@
        stop_bsock_timer(tid);
        return 0;
     }
-   if (!cram_md5_get_auth(fd, password, &tls_remote_need) ||
-       !cram_md5_auth(fd, password, tls_local_need)) {
+   if (!cram_md5_respond(fd, password, &tls_remote_need, &compat) ||
+       !cram_md5_challenge(fd, password, tls_local_need, compat)) {
        stop_bsock_timer(tid);
        return 0;
     }
diff -u check_bacula.orig/check_bacula.c check_bacula/check_bacula.c
--- check_bacula.orig/check_bacula.c    2005-05-23 09:19:43.000000000 +0200
+++ check_bacula/check_bacula.c 2006-09-11 23:09:02.921072018 +0200
@@ -320,6 +320,8 @@
         /* welcome message of director */
         if ((item->type == R_DIRECTOR) && (strncmp(item->D_sock->msg,
"Using ", 6) == 0))
                 continue;
+       if ((item->type == R_DIRECTOR) && (strncmp(item->D_sock->msg,
"Automatically ", 14) == 0))
+               continue;

         if (sscanf(item->D_sock->msg, OKqstatus, &num) != 1) {
                 /* Error, couldn't find OK */
============================================
patch ends

This compiles and links and runs on my system.

I see some problems with openssl but I simply took that out of the
configuration for now.

And now I hope someone else cleans up what I did :-)

Arno


Arno

> 1. extract nagios_plugin_check_bacula.tgz in bacula-1.38.x/src (you should 
> get a new
>    directory in src called check_bacula)
> 2. in bacula-1.38.x/Makefile.in add the following:
>       to "all_subdirs" add src/check_bacula
> 3. in bacula-1.38.x/configure add:
>       - "src/check_bacula/Makefile" to ac_config_files
>       - to "case "$ac_config_target" in"  (near line 30312) add:
>               "src/check_bacula/Makefile" ) CONFIG_FILES="$CONFIG_FILES 
> src/check_bacula/Makefile" ;;
> 
> 4. run configure and make the usual way
> 
> hope this helps,
> Chris
>  
> --
> "I sense much NT in you, NT leads to Blue Screen. 
> Blue Screen leads to downtime, downtime leads to suffering. NT is the path to 
> the darkside." 
> 
> - Unknown Unix Jedi  
> 
> 
>>-----Original Message-----
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Dan Langille
>>Sent: Tuesday, August 22, 2006 3:45 PM
>>To: bacula-users@lists.sourceforge.net
>>Subject: [Bacula-users] Ngaios plugin
>>
>>After having the Director stop running on the 19th, and only noticing 
>>it last night, I decided to start monitoring the service.
>>
>>I found bacula/examples/nagios_plugin_check_bacula.tgz but cannot 
>>find how it should be compiled.
>>
>>Anyone done this?
>>
>>-- 
>>Dan Langille : Software Developer looking for work
>>my resume: http://www.freebsddiary.org/dan_langille.php
>>
>>
>>
>>--------------------------------------------------------------
>>-----------
>>Using Tomcat but need to do more? Need to support web 
>>services, security?
>>Get stuff done quickly with pre-integrated technology to make 
>>your job easier
>>Download IBM WebSphere Application Server v.1.0.1 based on 
>>Apache Geronimo
>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&;
>>dat=121642
>>_______________________________________________
>>Bacula-users mailing list
>>Bacula-users@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users

-- 
IT-Service Lehmann                    [EMAIL PROTECTED]
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to