Hello Kern,

On Tue, 2014-04-01 at 15:16 +0200, Kern Sibbald wrote:
> Hello Ulrich,
> 
> Please download Bacula version 7.0.1 (I released it last night, but I
> hate to announce it today) :-)
> 7.0.1 has a fix for check_bacula.  You must just rebuild it.
> 

I was already on 7.0.1, compiled from source
git clone http://git.bacula.org/bacula -b Branch-7.0 bacula-7.0

After enabling trace i found the problem, SD now answers different hello
than FD.  Here is my patch which fixes check_bacula for 7.0.1.

--- check_bacula/authenticate.c.7.0.1   2014-03-31 09:15:23.807192305 +0200
+++ check_bacula/authenticate.c 2014-04-01 16:00:44.749065410 +0200
@@ -50,12 +50,14 @@
 /* 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";
+/* Commands sent to Storage daemon */
+static char SDhello[]     = "Hello SD: Bacula Director %s calling\n";
+
+/* Commands sent to  File daemon */
+static char FDhello[]     = "Hello Director %s calling\n";
 
 /* Response from SD */
-static char SDOKhello[]   = "3000 OK Hello\n";
+static char SDOKhello[]  = "3000 OK Hello";
 /* Response from FD */
 static char FDOKhello[] = "2000 OK Hello";
 
@@ -114,7 +116,7 @@
    bash_spaces(dirname);
    /* Timeout Hello after 5 mins */
    btimer_t *tid = start_bsock_timer(sd, 60 * 5);
-   if (!sd->fsend(SDFDhello, dirname)) {
+   if (!sd->fsend(SDhello, dirname)) {
       stop_bsock_timer(tid);
       return 0;
    }
@@ -130,7 +132,7 @@
    }
    Dmsg1(110, "<stored: %s", sd->msg);
    stop_bsock_timer(tid);
-   if (strncmp(sd->msg, SDOKhello, sizeof(SDOKhello)) != 0) {
+   if (strncmp(sd->msg, SDOKhello, strlen(SDOKhello)) != 0) {
       return 0;
    }
    return 1;
@@ -153,7 +155,7 @@
    bash_spaces(dirname);
    /* Timeout Hello after 5 mins */
    btimer_t *tid = start_bsock_timer(fd, 60 * 5);
-   if (!fd->fsend(SDFDhello, dirname)) {
+   if (!fd->fsend(FDhello, dirname)) {
       stop_bsock_timer(tid);
       return 0;
    }


Best regards
Ulrich


> Best regards,
> Kern
> 
> On 04/01/2014 02:40 PM, Ulrich Leodolter wrote:
> > Hello,
> >
> > I have upgraded one of my bacula installations,
> > compiled from latest git source (7.0.1) on CentOS 6.5.
> >
> > Build and install works without problems, and everything seems ok.
> >
> > I have also compiled the check_bacula,  it was already configured
> > in version 5.2.13 and worked.
> >
> > I have integrated it into /etc/snmp/snmpd.conf
> >
> > extend check_bacula_fd /opt/bacula/sbin/check_bacula -H localhost -D fd -M 
> > vlhost.obvsg.at-mon -K secret
> > extend check_bacula_sd /opt/bacula/sbin/check_bacula -H localhost -D sd -M 
> > vlhost.obvsg.at-mon -K secret
> > extend check_bacula_dir /opt/bacula/sbin/check_bacula -H localhost -D dir 
> > -M vlhost.obvsg.at-mon -K secret
> >
> > Now after upgrading the fd and dir check is OK, but the sd stopped working,
> > it just writes an error message:
> >
> > BACULA CRITICAL - Cannot authenticate to StorageDaemon: 1999 Authorization 
> > failed.
> >
> > Until now i did not change bacula config after upgrading.
> >
> > It seems sd authentication has changed and check_bacula needs an update.
> >
> > Anyone else tried check_bacula ?
> >
> >
> > Best regards
> > Ulrich
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > Bacula-devel mailing list
> > Bacula-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bacula-devel
> >
> 
> 



------------------------------------------------------------------------------
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to