[smokeping-users] New User and Trying to setup a Master/Slave topology

Nicolas MICHEL trash at nmichel.fr
Mon Apr 15 14:37:03 CEST 2013


Hi again.

I have read several blogpost about it and it appears that there is 
definitely a problem with the rights setup by default on the server

At the begining the GOOGLE_FR.rrd and the GOOGLE_FR~ubuntu.rrd *slave* 
had the same right and were owned by the same user and group => 
smokeping:smokeping.

I have seen that the apache user need to be "chowned" to this RRD  so I 
did :
chown www-data:www-data /var/lib/smokeping/Local/GOOGLE_FR~ubuntu.rrd
chmod  666 /var/lib/smokeping/Local/GOOGLE_FR~ubuntu.rrd

I know this is dirty and that most of you will feel the need to take a 
shower as they saw this but this is only for testing purpose and to 
understand what I am doing or not doing.

root at ubuntu:/home/nml# ls -lua /var/lib/smokeping/Local/
total 8780
drwxr-xr-x 2 smokeping smokeping    4096 Apr 15 14:09 .
drwxr-xr-x 5 smokeping smokeping    4096 Apr 15 10:14 ..
-rw-r--r-- 1 smokeping smokeping 2986808 Apr 15 14:30 GOOGLE_FR.rrd
-rw-rw-rw- 1 www-data  www-data  2986808 Apr 15 14:25 
GOOGLE_FR~ubuntu.rrd
-rw-r--r-- 1 smokeping smokeping 2986808 Apr 15 14:30 LocalMachine.rrd

The problem is that the slave RRD is not getting updated as you can see 
above 14:25 vs 14:30


Here are the websites I have used for reference.
Thanks for your help .... :)

https://lists.oetiker.ch/pipermail/smokeping-users/2011-March/004287.html
https://lists.oetiker.ch/pipermail/smokeping-users/2009-January/003493.html
https://lists.oetiker.ch/pipermail/smokeping-users/2007-October/002502.html
http://oss.oetiker.ch/smokeping/doc/smokeping_master_slave.en.html



Nicolas







Le Monday, April 15, 2013 10:02:49 AM, Nicolas MICHEL a écrit :
> Hey guys.
>
> Thanks for your help.
>
>
> Staticsafe your hints did the trick. I can now see trafic from my
> slave to my properly configured targets.
> But there is one more problem, I cannot see the graphs and I guess
> there is something wrong in some apache files/directory as this old
> email states:
>
> http://comments.gmane.org/gmane.network.smokeping.user/5043
>
>
> I am currently searching for a solution to my problem but my lack of
> Linux knowledge is killing me ...
> If someone has some insights, that would be great !
>
> Thanks a lot to all of you !
>
> Nicolas
>
>
>
>
>
>
>
>
> Le Thursday, April 11, 2013 8:07:54 PM, staticsafe a écrit :
>> On 4/11/2013 3:29, Trash NMICHEL wrote:
>>> Hi and thanks for your insights :!
>>>
>>> Here is what I did :
>>>
>>> ****** MASTER*******
>>>
>>>
>>> root at ubuntu:/home/nml# ls -lua /etc/smokeping/
>>> total 44
>>> drwxr-xr-x  3 root      root      4096 Apr 11 09:05 .
>>> drwxr-xr-x 86 root      root      4096 Apr 11 09:04 ..
>>> -rw-r--r--  1 root      root       191 Apr 10 22:33 apache2.conf
>>> -rw-r--r--  1 root      root      2031 Apr 10 22:36 basepage.html
>>> -rw-r--r--  1 root      root       290 Apr 10 22:33 config
>>> drwxr-xr-x  2 root      root      4096 Apr 11 09:12 config.d
>>> -r--------  1 smokeping www-data    19 Apr 11 09:05 slave-secrets
>>> -r--------  1 smokeping www-data     5 Apr 11 09:05 slavesecrets.conf
>>> -rw-r--r--  1 root      root      1564 Apr 10 22:33 smokemail
>>> -rw-r-----  1 smokeping smokeping   59 Apr 10 22:33 smokeping_secrets
>>> -rw-r--r--  1 root      root      3815 Apr 10 22:33 tmail
>>>
>>>
>>> root at ubuntu:/home/nml# cat /etc/smokeping/slavesecrets.conf
>>> test
>>> root at ubuntu:/home/nml# cat /etc/smokeping/slave-secrets
>>> ubuntu:test
>>>
>>> root at ubuntu:/home/nml# cat /etc/smokeping/config.d/Slaves
>>> *** Slaves ***
>>> secrets=/etc/smokeping/slave-secrets
>>> #+boomer
>>> #display_name=boomer
>>> #color=0000ff
>>>
>>> #+slave2
>>> #display_name=another
>>> #color=00ff00
>>>
>>> +ubuntu
>>> display_name=ubuntu
>>> color=00ff00
>>>
>>>
>>> root at ubuntu:/home/nml# cat /etc/smokeping/config.d/Targets
>>> *** Targets ***
>>>
>>> probe = FPing
>>>
>>> menu = Top
>>> title = Network Latency Grapher
>>> remark = Welcome to the SmokePing website of xxx Company. \
>>>           Here you will learn all about the latency of our network.
>>>
>>> + Local
>>>
>>> menu = Local
>>> title = Local Network
>>> #parents = owner:/Test/James location:/
>>>
>>> ++ LocalMachine
>>>
>>> menu = Local Machine
>>> title = This host
>>> host = localhost
>>> #alerts = someloss
>>>
>>>
>>> ++ Site1
>>>
>>> menu = SLAVE
>>> title = SLAVE_TITLE
>>> host = google.fr
>>> slaves = ubuntu
>>>
>>> root at ubuntu:/home/nml#
>>
>>> ****** SLAVE*******
>>>
>>> root at ubuntu:/etc/smokeping# cat /etc/default/smokeping
>>> # /etc/default/smokeping: Startup configuration for smokeping(1)
>>> #
>>> # select master or slave mode
>>> MODE=slave
>>> # in master mode, the rest of the configuration is in
>>> # /etc/smokeping/config
>>> #
>>> # in slave mode, uncomment and set the following variables too
>>> # see smokeping(1)
>>> #
>>> # Mandatory configuration
>>> MASTER_URL=http://172.16.119.236/cgi-bin/smokeping.cgi
>>> SHARED_SECRET=/etc/smokeping/slavesecrets.conf
>>> #
>>> # Optional configuration
>>> SLAVE_NAME=ubuntu
>>>
>>>
>>> root at ubuntu:/etc/smokeping# ls -lus
>>> total 32
>>> 4 -rw-r--r-- 1 root      root       191 Apr 10 22:35 apache2.conf
>>> 4 -rw-r--r-- 1 root      root      2031 Apr 10 22:37 basepage.html
>>> 4 -rw-r--r-- 1 root      root       290 Apr 10 22:35 config
>>> 4 drwxr-xr-x 2 root      root      4096 Apr 10 22:34 config.d
>>> 4 -r-------- 1 smokeping root         5 Apr 11 09:17 slavesecrets.conf
>>> 4 -rw-r--r-- 1 root      root      1564 Apr 10 22:35 smokemail
>>> 4 -rw-r----- 1 smokeping smokeping   59 Apr 10 22:35 smokeping_secrets
>>> 4 -rw-r--r-- 1 root      root      3815 Apr 10 22:35 tmail
>>> root at ubuntu:/etc/smokeping# cat /etc/smokeping/slavesecrets.conf
>>> test
>>>
>>>
>>> When I restart the master, everything goes fine ...
>>>
>>> When I restart the slave ... it can connect to the master but I get
>>> this
>>> error :
>>> root at ubuntu:/etc/smokeping# /etc/init.d/smokeping restart
>>>   * Shutting down latency logger daemon smokeping
>>> start-stop-daemon: warning: failed to kill 942: No such process
>>>     ...done.
>>>   * Starting latency logger daemon smokeping
>>> WARNING: Opening secrets file /etc/smokeping/slave-secrets: Permission
>>> denied
>>>
>>> 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 ?
>>>     ...done.
>>>
>>>
>>> I was thinking more about a permission error but then I did this on the
>>> MASTER:
>>>
>>> root at ubuntu:/home/nml# chmod 777 /etc/smokeping/slave-secrets
>>>
>>> Then the master is not working any more :
>>>
>>> root at ubuntu:/home/nml# /etc/init.d/smokeping restart
>>>   * Shutting down latency logger daemon smokeping
>>>     ...done.
>>>   * Starting latency logger daemon smokeping
>>> ERROR: /etc/smokeping/config.d/Slaves, line 2: File
>>> '/etc/smokeping/slave-secrets' is world-readable or writable,
>>> refusing it
>>>     ...done.
>>>
>>>
>>> Can someone help a Linux noob ? :P
>>>
>>> Thanks for your help guys
>>>
>>>
>>> Nic
>> [..] Snipping due to overly long quoting.
>>
>> The key error is this:
>> ERROR: /etc/smokeping/config.d/Slaves, line 2: File
>> '/etc/smokeping/slave-secrets' is world-readable or writable,
>> refusing it
>>     ...done.
>>
>> This is an error on the *Master*, the file needs to be *readable* by the
>> smokeping user and the www-data group.
>>
>> On the master:
>>
>> $ chown smokeping:www-data /etc/smokeping/slave-secrets
>> $ chmod 440 /etc/smokeping/slave-secrets
>>
>> That should solve the "Permission denied" error from the slave.
>>
>> Essentially the issue was that the file was only *readable* by the
>> smokeping user on the master but not the www-data group as it needs to
>> be for the slave to pull the file.
>>
>> -r--------  1 smokeping www-data    19 Apr 11 09:05 slave-secrets



More information about the smokeping-users mailing list