Skip to content

Commit c686a9a

Browse files
docs: fix broken SQL syntax, wrong Spine build deps, wrong cron user
Refs #211 Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent c707c76 commit c686a9a

5 files changed

Lines changed: 75 additions & 40 deletions

File tree

How-To-Setup-Remote-Pollers.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,39 @@ With this setup the following layout is assumed
2525

2626
## Database Configuration
2727

28+
> **Security**: The username `cacti` and password `cacti` shown in the examples
29+
> below are placeholders. Use a strong, randomly generated password in
30+
> production. Never use the literal string `cacti` as a database password on
31+
> any reachable system.
32+
2833
Each server will have its own local database however the remote pollers will
2934
need to talk back to the main poller so we must allow the remote servers user
3035
account to connect back to the main pollers database via the network
3136

3237
Main server database config
3338

3439
```sql
35-
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.10' IDENTIFIED BY 'cacti';
36-
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.20' IDENTIFIED BY 'cacti';
40+
CREATE USER 'cacti'@'192.168.1.10' IDENTIFIED BY 'strongpassword';
41+
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.10';
42+
CREATE USER 'cacti'@'192.168.1.20' IDENTIFIED BY 'strongpassword';
43+
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.20';
44+
FLUSH PRIVILEGES;
3745
```
3846

3947
Remote poller 1 database configuration
4048

4149
```sql
42-
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5' IDENTIFIED BY 'cacti';
50+
CREATE USER 'cacti'@'192.168.1.5' IDENTIFIED BY 'strongpassword';
51+
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5';
52+
FLUSH PRIVILEGES;
4353
```
4454

4555
Remote poller 2 database configuration
4656

4757
```sql
48-
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5' IDENTIFIED BY 'cacti';
58+
CREATE USER 'cacti'@'192.168.1.5' IDENTIFIED BY 'strongpassword';
59+
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5';
60+
FLUSH PRIVILEGES;
4961
```
5062

5163
We have also let the main poller talk to the remote pollers to keep in sync
@@ -58,15 +70,21 @@ configure the spine.conf file to connect to the remote database as well.
5870
Be sure to remove the # next to the below entries
5971

6072
```console
61-
RDB_Host 192.168.1.5
73+
RDB_Host 192.168.1.5
6274
RDB_Database cacti
63-
RDB_User cacti
64-
RDB_Pass cacti
65-
RDB_Port 3306
66-
#RDB_UseSSL 0
67-
#RDB_SSL_Key
68-
#RDB_SSL_Cert
69-
#RDB_SSL_CA
75+
RDB_User cacti
76+
RDB_Pass strongpassword
77+
RDB_Port 3306
78+
```
79+
80+
If the network between pollers and the main server is not fully trusted,
81+
enable SSL for the remote database connection:
82+
83+
```console
84+
RDB_UseSSL 1
85+
RDB_SSL_Key /etc/cacti/ssl/client.key
86+
RDB_SSL_Cert /etc/cacti/ssl/client.crt
87+
RDB_SSL_CA /etc/cacti/ssl/ca.crt
7088
```
7189

7290
## Spine poller and max connections
@@ -90,7 +108,7 @@ the remote poller to talk to the main server be sure to remove the hash sign (#)
90108
```console
91109
$rdatabase_type = 'mysql';
92110
$rdatabase_default = 'cacti';
93-
$rdatabase_hostname = '192.168.1.5;
111+
$rdatabase_hostname = '192.168.1.5';
94112
$rdatabase_username = 'cacti';
95113
$rdatabase_password = 'cacti';
96114
$rdatabase_port = '3306';

Installing-Under-Ubuntu-Debian.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Create and edit `/etc/cron.d/cacti` file.
120120
Make sure to setup the correct path to poller.php
121121

122122
```console
123-
*/5 * * * * apache php /var/www/html/cacti/poller.php &>/dev/null
123+
*/5 * * * * www-data php /var/www/html/cacti/poller.php >/dev/null 2>&1
124124
```
125125

126126
For systemd unit's file install, you will need to modify the

Plugin-Development.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Overview
44

5-
Cacti Plugins allow users of Cacti to extend it's functionality into areas
5+
Cacti Plugins allow users of Cacti to extend its functionality into areas
66
that the core Cacti developers have not. They were written based off of
7-
the work of Jimmy Conner from the Squirrel Mail project years ago. They
8-
allow developers to augment the Cacti Website, and it's polling processes
7+
the work of Jimmy Conner from the SquirrelMail project years ago. They
8+
allow developers to augment the Cacti Website, and its polling processes
99
to extend Cacti's reach.
1010

1111
There are a number of popular plugins including:
@@ -191,9 +191,9 @@ plugins other than RRDtool.
191191

192192
- [Billboard.js](https://naver.github.io/billboard.js/)
193193
- [D3](https://d3js.org/)
194-
- [Chart.js](http://www.chartjs.org/)
195-
- [DyGraphs](http://dygraphs.com/)
196-
- [jQuery Sparklines](http://omnipotent.net/jquery.sparkline/)
194+
- [Chart.js](https://www.chartjs.org/)
195+
- [DyGraphs](https://dygraphs.com/)
196+
- [jQuery Sparklines](https://omnipotent.net/jquery.sparkline/) (note: this project appears unmaintained; evaluate before use)
197197

198198
## Logging
199199

Spine.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ in polling time of an order of magnitude. Polling times far less than 60 seconds
66
for about 20,000 data sources are achievable e.g. on a dual XEON system supplied
77
with 4 GB RAM and standard local disks.
88

9-
When using Spine, don't change crontab or systemd settings! Always use
10-
poller.php with crontab or cactid.php for systemd!
9+
When using Spine, don't change crontab or systemd settings. The poller entry
10+
point is always `poller.php` — Spine is invoked by the poller, not directly
11+
from cron or systemd.
1112

1213
To activate Spine instead of cmd.php, please visit
1314
`Console > Configuration > Settings > Poller` and select spine and save as the
@@ -68,17 +69,16 @@ be installed on below is an example of compiling on centos and Ubuntu
6869
Install the required system packages
6970

7071
```console
71-
apt-get install -y build-essential dos2unix dh-autoreconf libtool help2man libssl-dev libmysql++-dev librrds-perl libsnmp-dev
72+
apt-get install -y build-essential dos2unix dh-autoreconf libtool help2man libssl-dev default-libmysqlclient-dev librrd-dev libsnmp-dev
7273
```
7374

74-
Next, download the version of spine you are looking for Typically this should
75-
match the version of Cacti you are using. In this case we will download Version
76-
1.2.3 of Spine
75+
Download the version of Spine that matches your Cacti version. Replace `X.Y.Z`
76+
with the actual release number (e.g., `1.2.31`):
7777

7878
```console
79-
wget <https://github.com/Cacti/spine/archive/release/1.2.3.zip>
80-
unzip 1.2.3
81-
cd spine-release-1.2.3
79+
wget https://github.com/Cacti/spine/archive/release/X.Y.Z.zip
80+
unzip X.Y.Z.zip
81+
cd spine-release-X.Y.Z
8282
```
8383

8484
Once you are in the spine directory its time to compile the poller by issuing
@@ -135,9 +135,9 @@ chmod u+s /usr/local/spine/bin/spine
135135

136136
### Testing/Debugging spine via command line
137137

138-
spine offer a a few different ways at the command line to test its
138+
Spine offers a few different ways at the command line to test its
139139
functionality. Here are a few examples of some tests you can run by executing
140-
spine.
140+
Spine.
141141

142142
#### Test Spine without writing results to database
143143

Upgrading-Cacti.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,60 @@ Before you begin, ensure that both your Apache/NGINX and your Crontab or systemd
3232

3333
You will probably have to specify the -u and -p flags for the MySQL username and password. This user must have permission to read from Cacti's database or you will end up with an empty backup.
3434
35-
5. Backup the Old Cacti Directory:
35+
4. Backup the Old Cacti Directory:
3636
3737
Backup the old Cacti directory with the exception of the RRD files, which should not need backup.
3838
```shell
3939
shell> tar --exclude=*.rrd -zcf cacti_backup_YYYYMMDD.tgz cacti
4040
```
41-
6. Extract the Distribution Tarball:
41+
5. Extract the Distribution Tarball:
4242
```shell
4343
shell> tar -xzvf cacti-version.tar.gz
4444
```
45-
7. Copy the Distribution Tarball Over the Existing Installation:
45+
6. Copy the Distribution Tarball Over the Existing Installation:
4646
```shell
4747
shell> /bin/cp -rpf cacti-version cacti
4848
```
49-
8. Set Appropriate Permissions:
49+
7. Set Appropriate Permissions:
5050
5151
Set the appropriate permissions on Cacti's directories for graph/log generation. Execute these commands from inside Cacti's directory to change the permissions.
52+
53+
On RHEL/Rocky Linux/AlmaLinux (Apache runs as `apache`):
5254
```shell
5355
shell> chown -R apache:apache rra/ log/
5456
```
55-
9. Recreate the Cache Folder (Optional):
57+
58+
On Ubuntu/Debian (Apache runs as `www-data`):
59+
```shell
60+
shell> chown -R www-data:www-data rra/ log/
61+
```
62+
63+
8. Recreate the Cache Folder (Optional):
5664
5765
If you are using Performance > Image Caching or Realtime Graphing, recreate the cache folder and correct the permissions.
5866
```shell
5967
shell> mkdir cache
68+
```
69+
70+
On RHEL/Rocky Linux/AlmaLinux:
71+
```shell
6072
shell> chown -R apache:apache cache
61-
```
73+
```
74+
75+
On Ubuntu/Debian:
76+
```shell
77+
shell> chown -R www-data:www-data cache
78+
```
6279
63-
10. Point Your Browser:
80+
9. Point Your Browser:
6481
6582
Point your web browser to http://your-server/cacti/ and follow the on-screen instructions to update your database to the new version.
6683
67-
11. Re-enable Polling:
84+
10. Re-enable Polling:
6885
6986
Go to the console and re-enable the poller. It will take two polling cycles to update the remote pollers.
7087
71-
12. If Remote Pollers Fail to Update:
88+
11. If Remote Pollers Fail to Update:
7289
7390
Try to rebuild the Resource Cache by going to Console >> Utilities and wait 2 polling cycles.
7491

0 commit comments

Comments
 (0)