Skip to content

Commit 459386c

Browse files
docs: fix grammar, logic, and technical errors in remaining install/upgrade guides
Installing-Under-Windows.md: - Replace php_mysql.dll with php_pdo_mysql.dll (php_mysql removed in PHP 7.0) - Remove IIS ISAPI steps referencing php8isapi.dll (ISAPI dropped in PHP 8.0); replace with FastCGI instructions via php-cgi.exe - Remove NO_AUTO_CREATE_USER from sql_mode (removed MySQL 8.0, breaks startup) - sort_buffer_size = 200M → 32M with caveat (per-session; 200M causes OOM under load) - Fix step numbering gaps: main list 5→8, IIS 3→5, Finishing 5→8 - "you will have to user 8.3 notation" → "use" - "c:cygwin" → "c:\cygwin" (missing backslash) - "it's subfolders" → "its subfolders" - "A anm example" → "An example" - "verify/udate" → "verify/update" Installing-Under-Ubuntu-Debian.md: - Cron user: apache → www-data (apache user does not exist on Ubuntu/Debian) - CREATE DATABASE: use utf8mb4 directly; remove redundant ALTER DATABASE - php8.1-mbstring listed twice in apt-get install; deduplicated - "may received" → "may receive" - Note php8.1 is EOL; recommend checking current supported release Upgrading-Cacti-Under-Windows.md: - Fix all steps numbered 1. → proper sequential numbering (1–10) - Remove hardcoded MySQL 5.7 path; use generic %MYSQL_HOME% note Upgrading-Cacti-Under-FreeBSD.md: - mysqldump: remove contradictory -l / --lock-tables=false flags; replace with --single-transaction (correct for InnoDB, no locking) How-To-SSH-Tunnels.md: - Add prominent note: SSH -L is TCP-only; standard SNMP uses UDP; this guide requires TCP transport configured on snmpd and does not work for most network devices - Fix unclosed code fence after ssh-keygen output block - Replace rc.local persistence with systemd unit (rc.local is deprecated and disabled by default on systemd distros: Ubuntu 16.04+, Debian 9+) - ssh-keygen: recommend ed25519 over RSA
1 parent 72145e1 commit 459386c

5 files changed

Lines changed: 378 additions & 438 deletions

How-To-SSH-Tunnels.md

Lines changed: 75 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,142 @@
1-
# How To Setup SSH Tunnels to graph a remote Unix server
1+
# How To Set Up SSH Tunnels to Graph a Remote Unix Server
22

3-
Howto created by `fmangeant` at [Cacti
4-
Forum](https://forums.cacti.net/viewtopic.php?t=24960)
3+
Howto created by `fmangeant` at the
4+
[Cacti Forum](https://forums.cacti.net/viewtopic.php?t=24960)
55

6-
This HowTo will explain how to use SSH tunnels to graph a Unix server that
7-
isn't directly reachable by your Cacti server :
6+
This guide explains how to use SSH tunnels to graph a Unix server that is not
7+
directly reachable by your Cacti server.
88

99
![Overview](images/device-templates-ssh-tunnel.png)
1010

1111
In this example, the Cacti server can reach the Gateway, which can reach the
1212
target server.
1313

14+
> **Important — TCP vs UDP**: SSH port forwarding (`-L`) is TCP-only. Standard
15+
> SNMP uses UDP port 161 and **cannot** be tunneled this way. This guide works
16+
> only when the target's `snmpd` is explicitly configured to accept TCP
17+
> transport (as shown below). It is **not** suitable for most network devices
18+
> (routers, switches, etc.), which support UDP SNMP only. For UDP SNMP across
19+
> untrusted networks, use a VPN instead.
20+
1421
## Configuring the SSH tunnel
1522

16-
On Gateway, create a "cactiuser" user :
23+
On the Gateway, create a `cactiuser` account:
1724

1825
```console
1926
# useradd -d /home/cactiuser -m cactiuser
2027
```
2128

22-
Then you have to generate SSH keys (without passphrase) :
29+
Generate an SSH key pair (no passphrase, so the tunnel can start
30+
unattended). The modern recommendation is ed25519:
2331

2432
```console
2533
# su - cactiuser
26-
$ ssh-keygen -t rsa
27-
Generating public/private rsa key pair.
28-
Enter file in which to save the key (/home/cactiuser/.ssh/id_rsa):
34+
$ ssh-keygen -t ed25519
35+
Generating public/private ed25519 key pair.
36+
Enter file in which to save the key (/home/cactiuser/.ssh/id_ed25519):
2937
Enter passphrase (empty for no passphrase):
3038
Enter same passphrase again:
31-
Your identification has been saved in /home/cactiuser/.ssh/id_rsa.
32-
Your public key has been saved in /home/cactiuser/.ssh/id_rsa.pub.
33-
The key fingerprint is:
34-
40:f6:91:a1:2d:d1:46:d4:76:e3:d8:c6:3f:c2:cf:f2 cactiuser@gateway
35-
```console
39+
Your identification has been saved in /home/cactiuser/.ssh/id_ed25519.
40+
Your public key has been saved in /home/cactiuser/.ssh/id_ed25519.pub.
41+
```
3642

37-
The public key of the "cactiuser" user has then to be authorized as an input key :
43+
Authorize the public key for login:
3844

3945
```console
4046
$ cd $HOME/.ssh
41-
$ cp -p id_rsa.pub authorized_keys
47+
$ cp -p id_ed25519.pub authorized_keys
4248
```
4349

44-
Finally, create the SSH tunnel :
50+
Create the SSH tunnel:
4551

4652
```console
4753
# su - cactiuser -c "ssh -f -N -g -L 192.168.0.2:10000:192.168.1.2:161 cactiuser@localhost"
4854
```
4955

50-
This SSH tunnel will forward all packets sent to 192.168.0.2 on TCP port 10000,
51-
to 192.168.1.2 on port TCP 161.
56+
This forwards all TCP traffic sent to `192.168.0.2:10000` on the Gateway to
57+
`192.168.1.2:161` on the target server.
58+
59+
Option summary:
60+
61+
```
62+
-f Go to background before executing the command
63+
-N Do not execute a remote command
64+
-g Allow remote hosts to connect to locally forwarded ports
65+
-L Forward the given local port to the given host and port on the remote side
66+
```
67+
68+
### Making the tunnel persistent (systemd)
69+
70+
On systemd-based hosts (Ubuntu 16.04+, Debian 9+, most current distros),
71+
`/etc/rc.local` is deprecated and disabled by default. Use a systemd service
72+
instead.
5273

53-
The options that are used are the following :
74+
Create `/etc/systemd/system/cacti-ssh-tunnel.service`:
5475

55-
```shell
56-
-f : requests SSH to go to background just before command execution
57-
-N : do not execute a remote command
58-
-g : allows remote hosts to connect to local forwarded ports
59-
-L : specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.
76+
```ini
77+
[Unit]
78+
Description=SSH tunnel for Cacti SNMP polling
79+
After=network.target
80+
81+
[Service]
82+
User=cactiuser
83+
ExecStart=/usr/bin/ssh -N -g -L 192.168.0.2:10000:192.168.1.2:161 cactiuser@localhost
84+
Restart=always
85+
RestartSec=10
86+
87+
[Install]
88+
WantedBy=multi-user.target
6089
```
6190

62-
You can add this command to `/etc/rc.local`, so it will be executed at boot time.
91+
Enable and start it:
6392

64-
## Configuring Net-SNMP
93+
```console
94+
# systemctl daemon-reload
95+
# systemctl enable cacti-ssh-tunnel
96+
# systemctl start cacti-ssh-tunnel
97+
```
98+
99+
## Configuring Net-SNMP on the target server
65100

66-
By default, the Net-SNMP agent listens on UDP port 161; we'll modify its
67-
configuration to listen on TCP port 161.
101+
By default, the Net-SNMP agent listens on **UDP** port 161. For this SSH
102+
tunnel approach you must configure it to listen on **TCP** port 161 instead.
68103

69-
To do so, use that in `snmpd.conf` on the target server :
104+
In `snmpd.conf` on the target server:
70105

71106
```ini
72107
agentaddress tcp:161
73108
rocommunity mycommunity
74109
```
75110

76-
For a more detailed configuration of snmpd.conf, refer to the
77-
[Net-SNMP snmpd.conf man page](https://net-snmp.sourceforge.io/docs/man/snmpd.conf.html)
111+
For a more detailed `snmpd.conf` reference, see the
112+
[Net-SNMP snmpd.conf man page](https://net-snmp.sourceforge.io/docs/man/snmpd.conf.html).
78113

79-
### Testing the SNMP connectivity
114+
### Testing SNMP connectivity
80115

81-
From the Gateway host, run this command :
116+
From the Gateway host:
82117

83118
```console
84119
$ snmpwalk -v 1 -c mycommunity tcp:192.168.1.2 sysname
85120
SNMPv2-MIB::sysName.0 = STRING: target_server
86121
```
87122

88-
From the Cacti server, run this command :
123+
From the Cacti server:
89124

90125
```console
91126
$ snmpwalk -v 1 -c mycommunity tcp:192.168.0.2:10000 sysname
92127
SNMPv2-MIB::sysName.0 = STRING: target_server
93128
```
94129

95-
If everything works fine, your host is then ready to be added to Cacti.
96-
97-
If not, review your network configuration (firewall rules, especially).
130+
If these succeed, the host is ready to be added to Cacti. If not, review
131+
your firewall rules and verify `snmpd` is listening on TCP.
98132

99133
## Adding the device to Cacti
100134

101-
In Cacti, create a new device like that :
135+
In Cacti, create a new device as shown:
102136

103137
![Add device](images/device-templates-ssh-add-device.png)
104138

105-
Voila ! Your target server is graphed by Cacti :)
139+
Your target server is now graphed by Cacti.
106140

107141
---
108142
Copyright (c) 2004-2026 The Cacti Group

Installing-Under-Ubuntu-Debian.md

Lines changed: 50 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,49 @@
1-
# Installing Cacti 1.x in Ubuntu/Debian LAMP stack
1+
# Installing Cacti 1.x on Ubuntu/Debian LAMP Stack
22

3-
> **Note**: As of Cacti 1.2.31, PHP 8.1 is required and PHP Composer is required.
4-
> Composer will be used to ensure all of the libraries are installed and are up to date.
3+
> **Note**: As of Cacti 1.2.31, PHP 8.1 is required and PHP Composer is required.
4+
> Composer will be used to ensure all libraries are installed and up to date.
5+
> PHP 8.1 reached end-of-life in November 2024. Check the
6+
> [PHP supported versions page](https://www.php.net/supported-versions.php)
7+
> and substitute the current supported release (e.g. `php8.3`) where appropriate.
58
6-
## Installing the required packages needed for the LAMP stack
9+
## Installing the required packages
710

811
```console
912
apt-get update
10-
apt-get install -y apache2 rrdtool mariadb-server snmp snmpd php8.1 php8.1-mysql php8.1-snmp php8.1-xml php8.1-mbstring php8.1-json php8.1-gd php8.1-gmp php8.1-zip php8.1-ldap php8.1-mbstring composer
13+
apt-get install -y apache2 rrdtool mariadb-server snmp snmpd \
14+
php8.3 php8.3-mysql php8.3-snmp php8.3-xml php8.3-mbstring \
15+
php8.3-json php8.3-gd php8.3-gmp php8.3-zip php8.3-ldap \
16+
php8.3-intl php8.3-curl composer
1117
```
1218

1319
### A special note for systems using PHP-FPM
1420

15-
Prior to starting the setup process of Cacti you should restart the PHP-FPM
16-
Daemon to rebuild the Cache or you may received a HTTP 500 Error
21+
Before starting the Cacti setup process, restart the PHP-FPM daemon to rebuild
22+
its cache, or you may receive an HTTP 500 error.
1723

1824
```console
1925
systemctl restart php-fpm
2026
```
2127

22-
### A special Note on installing Cacti in LXC Containers such as the ones found on Proxmox
28+
### A special note on installing Cacti in LXC containers (e.g. Proxmox)
2329

24-
We recommend creating a privileged container. You may need to update your container's config file with
30+
We recommend creating a privileged container. You may need to update your
31+
container's config file with:
2532

2633
```console
2734
lxc.apparmor.profile: unconfined
2835
```
29-
This will allow for ICMP ping and other functions to work
3036

31-
A tested configuration file like below should be good however tune to your needs/standards
37+
This allows ICMP ping and other functions to work.
38+
39+
A tested configuration is shown below; tune to your needs and standards.
3240

3341
```console
3442
arch: amd64
3543
cores: 2
3644
hostname: cacti
3745
memory: 2048
38-
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=mac-id,ip=dhcp,type=v>
46+
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=mac-id,ip=dhcp,type=veth
3947
ostype: ubuntu
4048
rootfs: local-lvm:vm-110-disk-0,size=8G
4149
swap: 2048
@@ -44,59 +52,53 @@ lxc.apparmor.profile: unconfined
4452

4553
### Downloading the Cacti software
4654

47-
Once the OS packages are installed, you will need to download the Cacti files
48-
you can do this by using the git command
55+
Once the OS packages are installed, clone the Cacti repository:
4956

5057
```console
51-
git clone -b 1.2.x https://github.com/Cacti/cacti.git
52-
Cloning into 'cacti'...
53-
remote: Enumerating objects: 81, done.
54-
remote: Counting objects: 100% (81/81), done.
55-
remote: Compressing objects: 100% (55/55), done.
56-
remote: Total 59936 (delta 40), reused 51 (delta 26), pack-reused 59855&
57-
Receiving objects: 100% (59936/59936), 76.33 MiB | 1.81 MiB/s, done.
58-
Resolving deltas: 100% (43598/43598), done.
58+
git clone -b 1.2.x https://github.com/Cacti/cacti.git
5959
```
6060

61-
After cloning the Cacti repository, move the files into the /var/www/html
62-
directory
61+
Move the files into the web root:
6362

6463
```console
6564
mv cacti /var/www/html
6665
```
6766

68-
#### Database Creation
67+
### Database creation
6968

70-
Next we will create a database for the cacti installation to use
69+
Create the Cacti database and user:
7170

7271
```console
7372
mysql -u root -p
74-
CREATE DATABASE cacti DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
73+
```
74+
75+
```sql
76+
CREATE DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
7577
CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';
7678
GRANT ALL ON cacti.* TO 'cactiuser'@'localhost';
7779
GRANT SELECT ON mysql.time_zone_name TO 'cactiuser'@'localhost';
78-
ALTER DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
7980
FLUSH PRIVILEGES;
8081
```
8182

82-
You will now need to pre-populate the database used by cacti
83+
> **Security note**: Replace `cactiuser`/`cactiuser` with a strong,
84+
> unique username and password before using this in production.
85+
86+
Import the default Cacti schema:
8387

8488
```console
8589
mysql -u root cacti < /var/www/html/cacti/cacti.sql
8690
```
8791

88-
Next, you will need to create the config.php file in /var/www/html/cacti/include
92+
### Creating the config file
8993

9094
```console
9195
cd /var/www/html/cacti/include
9296
cp config.php.dist config.php
9397
```
9498

95-
Now, edit the config.php file and make sure to change the database settings as
96-
needed to match the below entries (though it is highly recommended to use a
97-
customised username/password combination for security)
99+
Edit `config.php` to match your database settings:
98100

99-
```console
101+
```php
100102
$database_type = 'mysql';
101103
$database_default = 'cacti';
102104
$database_hostname = 'localhost';
@@ -108,47 +110,37 @@ $database_ssl = false;
108110
$database_ssl_key = '';
109111
```
110112

111-
### Create your cron task file or systemd units file
112-
113-
Starting with Cacti 1.2.16, you have the option to use either the
114-
legacy Crontab entry, or an optional cactid units file and server
115-
to run your Cacti pollers.
113+
### Create your cron task or systemd units file
116114

117-
For Crontab use, follow the instructions below:
115+
Starting with Cacti 1.2.16, you can use either a legacy crontab entry or the
116+
optional `cactid` systemd service to run your Cacti pollers.
118117

119-
Create and edit `/etc/cron.d/cacti` file.
120-
Make sure to setup the correct path to poller.php
118+
For crontab use, create and edit `/etc/cron.d/cacti`:
121119

122120
```console
123-
*/5 * * * * apache php /var/www/html/cacti/poller.php &>/dev/null
121+
*/5 * * * * www-data php /var/www/html/cacti/poller.php &>/dev/null
124122
```
125123

126-
For systemd unit's file install, you will need to modify the
127-
included units file to following your install location
128-
and desired user and group's to run the Cacti poller as.
129-
To complete the task, follow the procedure below:
124+
For systemd, modify the included units file to reflect your install location
125+
and the desired user and group, then:
130126

131127
```console
132-
vim /var/www/html/cacti/service/cactid.service (edit the path)
128+
vim /var/www/html/cacti/service/cactid.service
133129
touch /etc/sysconfig/cactid
134130
cp -p /var/www/html/cacti/service/cactid.service /etc/systemd/system
135131
systemctl enable cactid
136132
systemctl start cactid
137133
systemctl status cactid
138134
```
139135

140-
The systemd units file makes managing a highly available Cacti
141-
setup a bit more convenient.
142-
143-
The system is now ready to finalise the steps by browsing to
144-
[http://serverip/cacti](http://serverip/cacti) to start the cacti initialization
145-
wizard.
136+
The system is now ready. Browse to
137+
[http://serverip/cacti](http://serverip/cacti) to start the Cacti
138+
initialization wizard.
146139

147-
### Considerations when using Proxies in front of Cacti (Cacti 1.2.23+)
140+
### Considerations when using proxies in front of Cacti (Cacti 1.2.23+)
148141

149-
For optimal security, only specify the HTTP headers that are set by your proxy
150-
software to prevent unauthorized access.
151-
These can be set by editing the following section of config.php
142+
For optimal security, specify only the HTTP headers that your proxy software
143+
actually sets. Configure this by editing the following section of `config.php`:
152144

153145
```ini
154146
* Allow the use of Proxy IPs when searching for client

0 commit comments

Comments
 (0)