mirror of
https://github.com/Cacti/documentation.git
synced 2026-10-23 03:26:44 +09:00
docs: fix broken SQL syntax, wrong Spine build deps, and wrong cron user (#212)
* docs: fix broken SQL syntax, wrong Spine build deps, wrong cron user Refs #211 Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: align remote poller password example and drop em dash The config.php example still set $rdatabase_password to 'cacti' while the SQL and spine.conf examples used 'strongpassword', contradicting the guide's own advice against the literal 'cacti'. Replace the em dash in Spine.md with a period. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: netniV <netniv@hotmail.com>
This commit is contained in:
1 parent
9c0d7babc3
commit
2a5b6debae
5 files changed
+71
-36
No files matched your search
@@ -25,6 +25,11 @@ With this setup the following layout is assumed
|
||||
|
||||
## Database Configuration
|
||||
|
||||
> **Security**: The username `cacti` and password `cacti` shown in the examples
|
||||
> below are placeholders. Use a strong, randomly generated password in
|
||||
> production. Never use the literal string `cacti` as a database password on
|
||||
> any reachable system.
|
||||
|
||||
Each server will have its own local database however the remote pollers will
|
||||
need to talk back to the main poller so we must allow the remote servers user
|
||||
account to connect back to the main pollers database via the network
|
||||
@@ -32,20 +37,27 @@ account to connect back to the main pollers database via the network
|
||||
Main server database config
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.10' IDENTIFIED BY 'cacti';
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.20' IDENTIFIED BY 'cacti';
|
||||
CREATE USER 'cacti'@'192.168.1.10' IDENTIFIED BY 'strongpassword';
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.10';
|
||||
CREATE USER 'cacti'@'192.168.1.20' IDENTIFIED BY 'strongpassword';
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.20';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
Remote poller 1 database configuration
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5' IDENTIFIED BY 'cacti';
|
||||
CREATE USER 'cacti'@'192.168.1.5' IDENTIFIED BY 'strongpassword';
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
Remote poller 2 database configuration
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5' IDENTIFIED BY 'cacti';
|
||||
CREATE USER 'cacti'@'192.168.1.5' IDENTIFIED BY 'strongpassword';
|
||||
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'192.168.1.5';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
We have also let the main poller talk to the remote pollers to keep in sync
|
||||
@@ -61,12 +73,18 @@ Be sure to remove the # next to the below entries
|
||||
RDB_Host 192.168.1.5
|
||||
RDB_Database cacti
|
||||
RDB_User cacti
|
||||
RDB_Pass cacti
|
||||
RDB_Pass strongpassword
|
||||
RDB_Port 3306
|
||||
#RDB_UseSSL 0
|
||||
#RDB_SSL_Key
|
||||
#RDB_SSL_Cert
|
||||
#RDB_SSL_CA
|
||||
```
|
||||
|
||||
If the network between pollers and the main server is not fully trusted,
|
||||
enable SSL for the remote database connection:
|
||||
|
||||
```console
|
||||
RDB_UseSSL 1
|
||||
RDB_SSL_Key /etc/cacti/ssl/client.key
|
||||
RDB_SSL_Cert /etc/cacti/ssl/client.crt
|
||||
RDB_SSL_CA /etc/cacti/ssl/ca.crt
|
||||
```
|
||||
|
||||
## Spine poller and max connections
|
||||
@@ -90,9 +108,9 @@ the remote poller to talk to the main server be sure to remove the hash sign (#)
|
||||
```console
|
||||
$rdatabase_type = 'mysql';
|
||||
$rdatabase_default = 'cacti';
|
||||
$rdatabase_hostname = '192.168.1.5;
|
||||
$rdatabase_hostname = '192.168.1.5';
|
||||
$rdatabase_username = 'cacti';
|
||||
$rdatabase_password = 'cacti';
|
||||
$rdatabase_password = 'strongpassword';
|
||||
$rdatabase_port = '3306';
|
||||
$rdatabase_retries = 5;
|
||||
$rdatabase_ssl = false;
|
||||
|
||||
@@ -118,7 +118,7 @@ optional `cactid` systemd service to run your Cacti pollers.
|
||||
For crontab use, create and edit `/etc/cron.d/cacti`:
|
||||
|
||||
```console
|
||||
*/5 * * * * www-data php /var/www/html/cacti/poller.php &>/dev/null
|
||||
*/5 * * * * www-data php /var/www/html/cacti/poller.php >/dev/null 2>&1
|
||||
```
|
||||
|
||||
For systemd, modify the included units file to reflect your install location
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
## Overview
|
||||
|
||||
Cacti Plugins allow users of Cacti to extend it's functionality into areas
|
||||
Cacti Plugins allow users of Cacti to extend its functionality into areas
|
||||
that the core Cacti developers have not. They were written based off of
|
||||
the work of Jimmy Conner from the Squirrel Mail project years ago. They
|
||||
allow developers to augment the Cacti Website, and it's polling processes
|
||||
the work of Jimmy Conner from the SquirrelMail project years ago. They
|
||||
allow developers to augment the Cacti Website, and its polling processes
|
||||
to extend Cacti's reach.
|
||||
|
||||
There are a number of popular plugins including:
|
||||
@@ -191,9 +191,9 @@ plugins other than RRDtool.
|
||||
|
||||
- [Billboard.js](https://naver.github.io/billboard.js/)
|
||||
- [D3](https://d3js.org/)
|
||||
- [Chart.js](http://www.chartjs.org/)
|
||||
- [Chart.js](https://www.chartjs.org/)
|
||||
- [DyGraphs](https://dygraphs.com/)
|
||||
- [jQuery Sparklines](http://omnipotent.net/jquery.sparkline/)
|
||||
- [jQuery Sparklines](https://omnipotent.net/jquery.sparkline/) (note: this project appears unmaintained; evaluate before use)
|
||||
|
||||
## Logging
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ in polling time of an order of magnitude. Polling times far less than 60 seconds
|
||||
for about 20,000 data sources are achievable e.g. on a dual XEON system supplied
|
||||
with 4 GB RAM and standard local disks.
|
||||
|
||||
When using Spine, don't change crontab or systemd settings! Always use
|
||||
poller.php with crontab or cactid.php for systemd!
|
||||
When using Spine, don't change crontab or systemd settings. The poller entry
|
||||
point is always `poller.php`. Spine is invoked by the poller, not directly
|
||||
from cron or systemd.
|
||||
|
||||
To activate Spine instead of cmd.php, please visit
|
||||
`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
|
||||
Install the required system packages
|
||||
|
||||
```console
|
||||
apt-get install -y build-essential dos2unix dh-autoreconf libtool help2man libssl-dev libmysql++-dev librrds-perl libsnmp-dev
|
||||
apt-get install -y build-essential dos2unix dh-autoreconf libtool help2man libssl-dev default-libmysqlclient-dev librrd-dev libsnmp-dev
|
||||
```
|
||||
|
||||
Next, download the version of spine you are looking for Typically this should
|
||||
match the version of Cacti you are using. In this case we will download Version
|
||||
1.2.3 of Spine
|
||||
Download the version of Spine that matches your Cacti version. Replace `X.Y.Z`
|
||||
with the actual release number (e.g., `1.2.31`):
|
||||
|
||||
```console
|
||||
wget <https://github.com/Cacti/spine/archive/release/1.2.3.zip>
|
||||
unzip 1.2.3
|
||||
cd spine-release-1.2.3
|
||||
wget https://github.com/Cacti/spine/archive/release/X.Y.Z.zip
|
||||
unzip X.Y.Z.zip
|
||||
cd spine-release-X.Y.Z
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
### Testing/Debugging spine via command line
|
||||
|
||||
spine offer a a few different ways at the command line to test its
|
||||
Spine offers a few different ways at the command line to test its
|
||||
functionality. Here are a few examples of some tests you can run by executing
|
||||
spine.
|
||||
Spine.
|
||||
|
||||
#### Test Spine without writing results to database
|
||||
|
||||
|
||||
+25
-8
@@ -32,43 +32,60 @@ Before you begin, ensure that both your Apache/NGINX and your Crontab or systemd
|
||||
|
||||
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.
|
||||
|
||||
5. Backup the Old Cacti Directory:
|
||||
4. Backup the Old Cacti Directory:
|
||||
|
||||
Backup the old Cacti directory with the exception of the RRD files, which should not need backup.
|
||||
```shell
|
||||
shell> tar --exclude=*.rrd -zcf cacti_backup_YYYYMMDD.tgz cacti
|
||||
```
|
||||
6. Extract the Distribution Tarball:
|
||||
5. Extract the Distribution Tarball:
|
||||
```shell
|
||||
shell> tar -xzvf cacti-version.tar.gz
|
||||
```
|
||||
7. Copy the Distribution Tarball Over the Existing Installation:
|
||||
6. Copy the Distribution Tarball Over the Existing Installation:
|
||||
```shell
|
||||
shell> /bin/cp -rpf cacti-version cacti
|
||||
```
|
||||
8. Set Appropriate Permissions:
|
||||
7. Set Appropriate Permissions:
|
||||
|
||||
Set the appropriate permissions on Cacti's directories for graph/log generation. Execute these commands from inside Cacti's directory to change the permissions.
|
||||
|
||||
On RHEL/Rocky Linux/AlmaLinux (Apache runs as `apache`):
|
||||
```shell
|
||||
shell> chown -R apache:apache rra/ log/
|
||||
```
|
||||
9. Recreate the Cache Folder (Optional):
|
||||
|
||||
On Ubuntu/Debian (Apache runs as `www-data`):
|
||||
```shell
|
||||
shell> chown -R www-data:www-data rra/ log/
|
||||
```
|
||||
|
||||
8. Recreate the Cache Folder (Optional):
|
||||
|
||||
If you are using Performance > Image Caching or Realtime Graphing, recreate the cache folder and correct the permissions.
|
||||
```shell
|
||||
shell> mkdir cache
|
||||
```
|
||||
|
||||
On RHEL/Rocky Linux/AlmaLinux:
|
||||
```shell
|
||||
shell> chown -R apache:apache cache
|
||||
```
|
||||
|
||||
10. Point Your Browser:
|
||||
On Ubuntu/Debian:
|
||||
```shell
|
||||
shell> chown -R www-data:www-data cache
|
||||
```
|
||||
|
||||
9. Point Your Browser:
|
||||
|
||||
Point your web browser to http://your-server/cacti/ and follow the on-screen instructions to update your database to the new version.
|
||||
|
||||
11. Re-enable Polling:
|
||||
10. Re-enable Polling:
|
||||
|
||||
Go to the console and re-enable the poller. It will take two polling cycles to update the remote pollers.
|
||||
|
||||
12. If Remote Pollers Fail to Update:
|
||||
11. If Remote Pollers Fail to Update:
|
||||
|
||||
Try to rebuild the Resource Cache by going to Console >> Utilities and wait 2 polling cycles.
|
||||
|
||||
|
||||
Reference in new issue
Block a user