Discussion:
[smokeping-users] Master/Slave "No secret found..."
Christian Benke
2008-07-09 16:50:05 UTC
Permalink
Hello!

I'm struggling with my Master/Slave-Setup and i believe after skimming
through the mailinglist i've straightened out all syntax-errors.
On the Master-Machine the Slave-config looks like this(slavesecrets
mode 400, ownership www-data:www-data):

*** Slaves ***
#
## make sure this is not world-readable!
secrets=/etc/smokeping/slavesecrets.conf
#
+slave1
display_name=location-of-host.in.mydomain.at
location=wien
color=0000ff


++override
Probes.FPing.binary = /usr/bin/fping


I've also added the line "slaves=slave1" to some targets in the
Targets-Section, the /etc/smokeping/slavesecrets.conf(mode 400,
ownership www-data:www-data) looks like this:

slave1:testblasmoke71

On the slave-machine i start with this command:


sudo -u www-data /usr/sbin/smokeping
--master-url=http://$internal-master-ip/cgi-bin/smokeping.cgi
--cache-dir=/var/smokeping/
--shared-secret=/var/smokeping/slavesecrets.conf --debug


and promptly get the answer:
WARNING: No secret found for slave location-of-host.in.mydomain.at

Sent data to Server. Server said WARNING: No secret found for slave
location-of-host.in.mydomain.at ERROR: we did not get config from
the master. Maybe we are not configured as a slave for any of the
targets on the master ?

On the master, the apache-error.log says:

smokeping.cgi [client $client-internal-ip]: Use of uninitialized value
in string eq at /usr/share/perl5/smokeping/Smokeping/Master.pm line 233.

Looks like the client doesn't send a secret - but where is the problem?
Is there a syntax-error or a permission problem(Allthough i've tried
several options, smokeping usually complains when the permissions fail)?

regards
Christian
--
Christian Benke
InQnet GmbH
Praterstraße 31
A-1020 Wien

Tel.: +43 1 212 7650 524
Fax.: +43 1 212 7650 610
Christian Benke
2008-07-15 08:33:39 UTC
Permalink
On Fri, 11 Jul 2008 14:18:11 -0400
Hello,
Both of your machines should have permissions like below. (disregard
path as this is a debian install ). www-data group only needs read
access.
smokeping:~# ls -ltra /etc/smokeping/slavesecrets.conf
-rw-r----- 1 root www-data 19 2008-06-19
21:45 /etc/smokeping/slavesecrets.conf
thx for the answer, this is how it looks now:

slave:/var/smokeping# ls -ltra /var/smokeping/slavesecrets.conf
-rw-r----- 1 root www-data 22 2008-07-15
08:15 /var/smokeping/slavesecrets.conf
slave:/var/smokeping# cat /var/smokeping/slavesecrets.conf
slave1:testblasmoke71
slave:/var/smokeping#

master:/etc/smokeping# ls -ltra /etc/smokeping/slavesecrets.conf
-rw-r----- 1 root www-data 22 Jul 9
16:40 /etc/smokeping/slavesecrets.conf
master:/etc/smokeping# cat /etc/smokeping/slavesecrets.conf
slave1:testblasmoke71
master:/etc/smokeping#

but the error is the same(After restarting everything) - am i missing
something else?

regards
christian
G.W. Haywood
2008-07-15 08:38:35 UTC
Permalink
Hi there,
Post by Christian Benke
slave:/var/smokeping# cat /var/smokeping/slavesecrets.conf
slave1:testblasmoke71
master:/etc/smokeping# cat /etc/smokeping/slavesecrets.conf
slave1:testblasmoke71
but the error is the same(After restarting everything) - am i
missing something else?
It isn't very clear in the documentation (Tobi?) but your slave file
is incorrect. It should just contain

testblasmoke71

and not the name of the slave, which (er, obviously:) isn't needed.

--

73,
Ged.
Christian Benke
2008-09-12 10:08:24 UTC
Permalink
On Tue, 15 Jul 2008 09:38:35 +0100 (BST)
Post by G.W. Haywood
It isn't very clear in the documentation (Tobi?) but your slave file
is incorrect. It should just contain
testblasmoke71
and not the name of the slave, which (er, obviously:) isn't needed.
Sorry for the late reply - i was on holiday in the meantime and had the
issue postponed until it showed up in the ticketing lately ;-)

I have solved the issue after some debugging and trial-and-error, the
problem was not about permissions or secrets-syntax but about
section-naming, this is how my master-config looks like now:


*** Slaves ***
#
## make sure this is not world-readable!
secrets=/etc/smokeping/slavesecrets.conf

+this.is.the.fullhostnameofmyslave.in.mydomain.com
display_name=this.is.the.fullhostnameofmyslave
location=wien
color=0000ff

++override
Probes.FPing.binary = /usr/bin/fping


Accordingly, in the Targets-section i add the slave like this:


slaves=this.is.the.fullhostnameofmyslave.in.mydomain.com


the slave works without any configuration now(was not sure about that)
and sends its data to the master - perfect! :-)

btw:
in Master.pm this section(233:238) is wrong - in case $secret is
not set, the equal-function will report an error:


return if $secret eq '__HORRIBLE_INLINE_SIGNALING__';
if (not $secret){
print "Content-Type: text/plain\n\n";
print "WARNING: No secret found for slave ${slave}\n";
return;
}


and should be:


if (not $secret){
print "Content-Type: text/plain\n\n";
print "WARNING: No secret found for slave ${slave}\n";
return;
}
return if $secret eq '__HORRIBLE_INLINE_SIGNALING__';


instead.

Regards
Christian

Continue reading on narkive:
Loading...