1 | Installing SmokePing as a Slave |
---|
2 | ----------------------------------------------------- |
---|
3 | * Prequisites: Fully functional SmokePing installation to act as the Master |
---|
4 | * References: http://oss.oetiker.ch/smokeping/doc/smokeping_master_slave.en.html |
---|
5 | |
---|
6 | Instructions tested on Ubuntu 8.10 Server ONLY |
---|
7 | |
---|
8 | Run all commands as root (> sudo -i, then run all commands) |
---|
9 | |
---|
10 | 1) SLAVE Setup Instructions |
---|
11 | |
---|
12 | Setup Smokeping |
---|
13 | > apt-get install smokeping |
---|
14 | - No configuration files are necessary for slave installations |
---|
15 | - Technically, you don't need SpeedyCGI for slave installations, but you'll get everything with the Ubuntu package |
---|
16 | - If you want to run SmokePing as a master or stand-alone installation, you will have all the files you need |
---|
17 | |
---|
18 | |
---|
19 | Create a file containing a password to be used as a shared secret |
---|
20 | > pico /etc/smokeping/slave_secret |
---|
21 | - Enter a strong password on the first line of the new file, then save the file |
---|
22 | - Note, /etc/smokeping/slave_secret will contain one word, the password, and nothing else |
---|
23 | |
---|
24 | Set appropriate permissions on this file |
---|
25 | > chmod 600 /etc/smokeping/slave_secret |
---|
26 | > chown smokeping:root /etc/smokeping/slave_secret |
---|
27 | |
---|
28 | Create the cache directory and set appropriate persmissions |
---|
29 | > mkdir /var/smokeping |
---|
30 | > chown smokeping:root /var/smokeping |
---|
31 | |
---|
32 | Modify the init.d Daemon script so /etc/init.d/smokeping start | stop | restart works |
---|
33 | > pico /etc/init.d/smokeping |
---|
34 | Change "MODE=master" to "MODE=slave" |
---|
35 | Change DAEMON_ARGS="" to "DAEMON_ARGS="--master-url=http://<master_IP>/<path to smokeping.cgi>" --cache-dir=/var/smokeping/ --shared-secret=/etc/smokeping/slave-secret" |
---|
36 | |
---|
37 | Restart SmokePing |
---|
38 | > /etc/init.d/smokeping restart |
---|
39 | |
---|
40 | 2) MASTER Setup Instructions |
---|
41 | |
---|
42 | Create a file containing the password to be used as a shared secret |
---|
43 | > pico /etc/smokeping/master_secrets |
---|
44 | - Enter the hostname (hostname only, not fully qualified domain name) followed by a colon, followed by the password on one line |
---|
45 | The password should match what you created on your slave SmokePing installation in /etc/smokeping/slave_secret |
---|
46 | The hostname is the name of the host running the slave installation of SmokePing |
---|
47 | If you have multiple slaves, put the hostname:password combinations on separate lines |
---|
48 | Example: myhostname:mypassword |
---|
49 | |
---|
50 | Set appropriate permisssions on this file |
---|
51 | > chmod 640 /etc/smokeping/master_secrets |
---|
52 | > chown www-data:root /etc/smokeping/master_secrets |
---|
53 | |
---|
54 | Modify the SmokePing Slaves configuration file |
---|
55 | > pico /etc/smokeping/config.d/Slaves |
---|
56 | - This file should be as follows, but replace 'myhostname' with the hostname of your slave SmokePing installation |
---|
57 | The display_name can be whatever you wish but should be descriptive of where the slave is located |
---|
58 | If you have multiple slaves, put in additional +myhostname, display_name, and color lines |
---|
59 | ------ |
---|
60 | *** Slaves *** |
---|
61 | # |
---|
62 | ## make sure this is not world-readable! |
---|
63 | secrets=/etc/smokeping/masters-secrets |
---|
64 | |
---|
65 | |
---|
66 | +myhostname |
---|
67 | display_name=myhostname |
---|
68 | color=0000ff |
---|
69 | ------ |
---|
70 | |
---|
71 | Modify the SmokePint Targets configuration file |
---|
72 | > pico /etc/smokeping/config.d/Targets |
---|
73 | - Add the following line under the *** Targets *** title, replacing myhostname with the name of your slave Smokeping installation |
---|
74 | If you have multiple slaves, put them all on one line separate by spaces |
---|
75 | ------ |
---|
76 | slaves = myhostname |
---|
77 | ------ |
---|
78 | |
---|
79 | Restart SmokePing |
---|
80 | > killall speedy_backend |
---|
81 | > /etc/init.d/smokeping restart |
---|
82 | |
---|