Giter Site home page Giter Site logo

docker-cacti's Introduction

Cacti v1+ Docker Container

Dockerhub Stars on Docker HubPulls on Docker Hub

Github GitHub Open IssuesGitHub StarsGitHub Forks

Cacti System

Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides following features:

  • remote and local data collectors
  • network discovery
  • device management automation
  • graph templating
  • custom data acquisition methods
  • user, group and domain management
  • C3 level security settings for local accounts
    • strong password hashing
    • forced regular password changes, complexity, and history
    • account lockout support

All of this is wrapped in an intuitive, easy to use interface that makes sense for both LAN-sized installations and complex networks with thousands of devices. Developed in the early 2000's by Ian Berry as a high school project, it has been used by thousands of companies and enthusiasts to monitor and manage their Networks and Data Centers. More information around this opensource product can be located at the following website.

Using this image

Running the container

This container contains Cacti v1+ and is not compatible with older version of cacti. It does rely on an external MySQL database that can be already configured before initial startup or having the container itself perform the setup and initialization. If you want this container to perform these steps for you, you will need to pass the root password for mysql login or startup will fail. This container automatically incorporates Cacti Spine's multithreaded poller.

Exposed Ports

The following ports are important and used by Cacti

Port Notes
80 HTTP GUI Port
443 HTTPS GUI Port

It is recommended to allow at least one of the above ports for access to the monitoring system. This is translated by the -p hook. For example docker run -p 80:80 -p 443:443

HTTPS

By default https will work if exposed, though using a self signed certificate. To provide your own certificate replace via mounting the following files:

/etc/ssl/certs/cacti.key
/etc/ssl/certs/cacti.crt

Installation

Cacti Master

The main cacti poller settings, these are required for single cacti and multi cacti host installations.

Environment Variable Function
DB_NAME The MySQL database name, this is used for both cacti settings and spine poller configurations.
DB_USER MySQL database user cacti should use. Both cacti and spine poller will share these settings.
DB_PASS MySQL database password assigned to DB_USER Both cacti and spine poller will share these settings.
DB_HOST The IP address, FQDN/hostname, or linked container name that cacti would use as a database.
DB_PORT What TCP port is the MySQL database listening on, by default its 3306.
DB_ROOT_PASS This is only needed if the INITIALIZE_DB is set to 1. This is required if you want the cacti container to setup remote MySQL user accounts and Databases for use.
INITIALIZE_DB Can be 0 for false or 1 for true. If true the container will require DB_ROOT_PASS to the target database. The container will attempt to create usernames/passwords and Databases required on the remote system for Cacti to funtion.
TZ TimeZone, please select a format Centos understands, a list can be generated by running ls /usr/share/zoneinfo.
BACKUP_RETENTION Number of backup files to keep.
REMOTE_POLLER Can be 0 for false (default) or 1 for true.
PHP_MEMORY_LIMIT PHP memory limit adjust, by defaults its 128M
PHP_MAX_EXECUTION_TIME PHP max execution time adjust, by defaults its 30 second
PHP_SNMP If set to 0, will remove PHP-SNMP, this is sometimes required for some scripts or snmpv3 to work properly. by defualt this php-snmp is enabled

Remote Cacti Pollers

Remote cacti poller containers require the following, the major differance here is the inclusion of RDB (remote database) variables which should be pointed at the master cacti installation settings.

Environment Variable Function
DB_NAME The MySQL database, this is used for both cacti settings and spine poller configurations.
DB_USER MySQL database user cacti should use. Both cacti and spine poller will share these settings.
DB_PASS MySQL database password assigned to DB_USER Both cacti and spine poller will share these settings.
DB_HOST The IP address, FQDN/hostname, or linked container name that cacti would use as a database.
DB_PORT What TCP port is the MySQL database listening on, by default its 3306.
CACTI_URL_PATH Cacti URL, by default cacti is used. --> http://cacti_ip/cacti, Currently only allows root URL changes, i.e. this/is/something will not work. Only this
INITIALIZE_DB Can be 0 for false or 1 for true. If true the container will require DB_ROOT_PASS to the target database. The container will attempt to create usernames/passwords and Databases required on the remote system for Cacti to funtion.
TZ TimeZone, please select a format Centos understands, a list can be generated by running ls /usr/share/zoneinfo.
BACKUP_RETENTION Number of backup files to keep
REMOTE_POLLER Can be 0 for false (default) or 1 for true. If true the container is setup as a remote poller.
RDB_NAME The master Cacti instance MySQL database name, this is used for both cacti settings and spine poller configurations.
RDB_USER MySQL database user used by the master Cacti container should use.
RDB_PASS MySQL database password assigned to RDB_USER that is used by the master Cacti container.
RDB_HOST The IP address, FQDN/hostname, or linked container name that the master Cacti instance uses
RDB_PORT What TCP port is the MySQL database listening on, by default its 3306.

Database Settings

The folks at Cacti.net recommend the following settings for its MySQL based database. Please understand depending on your systems resources and amount of devices your installation is monitoring these settings may need to change for optimal performance. I would recommend shooting any questions around these settings to the Cacti community forums.

MySQL Variable Recommended Value Notes
Version >= 5.6 MySQL 5.6+ and MariaDB 10.0+ are great releases, and are very good versions to choose. Make sure you run the very latest release though which fixes a long standing low level networking issue that was casuing spine many issues with reliability.
collation_server utf8mb4_unicode_ci When using Cacti with languages other than English, it is important to use the utf8mb4_unicode_ci collation type as some characters take more than a single byte.
character_set_client utf8mb4 When using Cacti with languages other than English, it is important ot use the utf8mb4 character set as some characters take more than a single byte.
max_connections >= 100 Depending on the number of logins and use of spine data collector, MySQL will need many connections. The calculation for spine is: total_connections = total_processes * (total_threads + script_servers + 1), then you must leave headroom for user connections, which will change depending on the number of concurrent login accounts.
max_heap_table_size >= 10% RAM If using the Cacti Performance Booster and choosing a memory storage engine, you have to be careful to flush your Performance Booster buffer before the system runs out of memory table space. This is done two ways, first reducing the size of your output column to just the right size. This column is in the tables poller_output, and poller_output_boost. The second thing you can do is allocate more memory to memory tables. We have arbitrarily chosen a recommended value of 10% of system memory, but if you are using SSD disk drives, or have a smaller system, you may ignore this recommendation or choose a different storage engine. You may see the expected consumption of the Performance Booster tables under Console -> System Utilities -> View Boost Status.
max_allowed_packet >= 16777216 With Remote polling capabilities, large amounts of data will be synced from the main server to the remote pollers. Therefore, keep this value at or above 16M.
tmp_table_size >= 64M When executing subqueries, having a larger temporary table size, keep those temporary tables in memory.
join_buffer_size >= 64M When performing joins, if they are below this size, they will be kept in memory and never written to a temporary file.
innodb_file_per_table ON When using InnoDB storage it is important to keep your table spaces separate. This makes managing the tables simpler for long time users of MySQL. If you are running with this currently off, you can migrate to the per file storage by enabling the feature, and then running an alter statement on all InnoDB tables.
innodb_file_format Barracuda When using innodb_file_per_table, it is important to set the innodb_file_format to Barracuda. This setting will allow longer indexes important for certain Cacti tables.
innodb_large_prefix 1 If your tables have very large indexes, you must operate with the Barracuda innodb_file_format and the innodb_large_prefix equal to 1. Failure to do this may result in plugins that can not properly create tables.
innodb_buffer_pool_size >=25% RAM InnoDB will hold as much tables and indexes in system memory as is possible. Therefore, you should make the innodb_buffer_pool large enough to hold as much of the tables and index in memory. Checking the size of the /var/lib/mysql/cacti directory will help in determining this value. We are recommending 25% of your systems total memory, but your requirements will vary depending on your systems size.
innodb_doublewrite ON This settings should remain ON unless your Cacti instances is running on either ZFS or FusionI/O which both have internal journaling to accomodate abrupt system crashes. However, if you have very good power, and your systems rarely go down and you have backups, turning this setting to OFF can net you almost a 50% increase in database performance.
innodb_lock_wait_timeout >= 50 Rogue queries should not for the database to go offline to others. Kill these queries before they kill your system.
innodb_flush_log_at_timeout >= 3 As of MariaDB 10.3.22-1:10.3.22+maria~bionic, the you can control how often MariaDB flushes transactions to disk. The default is 1 second, but in high I/O systems setting to a value greater than 1 can allow disk I/O to be more sequential
innodb_read_io_threads >= 32 With modern SSD type storage, having multiple read io threads is advantageous for applications with high io characteristics.
innodb_write_io_threads >= 16 With modern SSD type storage, having multiple write io threads is advantageous for applications with high io characteristics.
innodb_buffer_pool_instances >= 9 MariaDB will divide the innodb_buffer_pool into memory regions to improve performance. The max value is 64. When your innodb_buffer_pool is less than 1GB, you should use the pool size divided by 128MB. Continue to use this equation upto the max of 64.
innodb_io_capacity 5000 If you have SSD disks, use this suggestion. If you have physical hard drives, use 200 * the number of active drives in the array. If using NVMe or PCIe Flash, much larger numbers as high as 100000 can be used.
innodb_io_capacity_max 10000 If you have SSD disks, use this suggestion. If you have physical hard drives, use 2000 * the number of active drives in the array. If using NVMe or PCIe Flash, much larger numbers as high as 200000 can be used.
memory_limit >= 800M A minimum of 800 MB memory limit
max_execution_time >= 60 A minimum of 1 m execution time

Data Backups

Included is a backup script that will backup cacti (including settings/plugins), rrd files, and spine. This is accomplished by taking a complete copy of the root spine and cacti directory and performing a MySQL dump of the cacti database which stores all the settings and device information. To manually perform a backup, run the following exec commands:

docker exec <docker image ID or name> ./backup.sh

This will store compressed backups in a tar.gz format within the cacti docker container under /backups directory. Its recommended to map this directory using volumes so data is persistent. By default it only stores 7 most recent backups and will automatically delete older ones, to change this value update BACKUP_RETENTION environmental variable with the number of backups you wish to store.

Restore Backup

To restore from an existing backup, run the following docker exec command with the backup file location as an argument.

docker exec <docker image ID or name> ./restore.sh /backups/<filename>

To get a list of backups, the following command should display them:

docker exec <docker image ID or name> ls /backups

Updating Cacti

You can now update the Cacti/Spine version of this container using the included script. By default this will update to the latest version.

docker exec <docker image ID or name> ./upgrade.sh

If you want to specify a specific version please update the /upgrade.sh values.

#!/bin/bash
# script to upgrade a cacti instance to latest, if you want a specific version please update the following download links
cacti_download_url=http://www.cacti.net/downloads/cacti-latest.tar.gz
spine_download_url=http://www.cacti.net/downloads/spine/cacti-spine-latest.tar.gz

Docker Cacti Architecture


With the recent update to version 1+, Cacti has introduced the ability to have remote polling servers. This allows us to have one centrally located UI and information system while scaling out multiple datacenters or locations. Each instance, master or remote poller, requires its own MySQL based database. The pollers also have an addition requirement to access the Cacti master's database with read/write access.

Some docker-compose examples can be found in the following readme

Container Customization

There are a few customizations you can do if you are building the container locally. During the build process Plugins and Device Templates can be added to folders where at startup, scripts will import and install.

Device Templates

Dropping device templates in the /templates/ folder using the following structure:

├── templates
│   ├── template_name.xml
│   ├── resource
│   │   └── script_queries
│   │       └── ...
│   │   └── script_server
│   │       └── ...
│   │   └── snmp_queries
│   │       └── ...
│   ├── scripts
│   │   └── ...

At buld/first boot you will see some log messages that they were imported to the underlying Cacti system

2017-03-24_19:22 [New Install] Installing supporting template files.
2017-03-24_19:22 [New Install] Installing template file /templates/cacti_host_template_juniper_networks.xml

Plugins

To have plugins automatically loaded on boot, simply have the uncompressed plugin in the plugins folder within the main directory. Upon build/run, the startup script will automatically install them to the appropriate directory. Please understand that you will need to enable any plugins via Cacti GUI for them to become active.

To add plugins after the container is built, for example if pulling directly form dockerhub, mount the /cacti/plugins directory using docker volumes.

Settings

Settings can be passed through to cacti at initial install by placing the SQL changes in the form of filename.sql under the settings folder. start.sh will automatically merge all *.sql files during install. For example the folling is there to enable spine by default:

/settings/spine.sql
--
-- Enable spine poller from docker installation
--

REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine', '/spine/bin/spine');
REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine_config', '/spine/etc/spine.conf');
REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('poller_type', '2');

Change Log

1.2.17 - 05/11/2021

  • Update Cacti and Spine from 1.2.16 to 1.2.17

1.2.16 - 12/27/2020

  • Update Cacti and Spine from 1.2.15 to 1.2.16
  • zuka1337 added powertools to base dockerfile image via #82

1.2.15 - 11/05/2020

  • Update Cacti and Spine from 1.2.14 to 1.2.15

1.2.14 - 08/15/2020

  • Close issue #73 - Add CACTI_URL_PATH; Thanks for the request xbolshe and help on apache configs.
  • Update Cacti and Spine from 1.2.11 to 1.2.14

1.2.11a - 04/18/2020

  • Close issue #64 - FPM initialization failed; Thanks to kevburkett for bringing this one up and helping validate the fix
  • Close issue #65 - PHP-SNMP yum commands cause rpmdb error

1.2.11 - 04/17/2020

  • Update Docker container to use Centos8 over Centos7
  • Close issue #59 - errors with percona on compose single instance; Thank you miguelwill
    • Update docker-comose examples with Mariadb:10.3 from older Percona version
  • Close issue #61 - spine directory and crontab empty after docker-compose down and restoring; Thank you kevburkett
    • Update docker-compose with spine volume
  • Enable HTTPS functionality and self-sign certs when needed
  • Allow functionality to disable PHP-SNMP usagage via PHP_SNMP environment variable se
  • Manual patch on provisioning new remote pollers - Cacti/cacti#3459
  • Update Cacti and Spine from 1.2.8 to 1.2.11

1.2.8 - 12/11/2019

1.2.6a - 10/30/2019

  • Update start.sh to persist Apache Cacti configurations on restart. [#52] (#52)
  • Update docker-compose examples to use different type of volumes so docker-compose down will not affect data without the -v flag.

1.2.6 - 09/06/2019

  • Update Cacti and Spine from 1.2.0 to 1.2.6
  • Removed 1.1.X changelog notes from README.md, this can be located in CHANGELOG.md
  • Close Issue #49 - New version of Spine don't have configure file
  • Close Issue #45 - Directories backup and backups mixed up; thank you shortbloke for PR #46
  • Merge PR #47 and PR #48 - Add modify PHP env; thank you joey741019

1.2.0 - 01/06/2019

  • Update Cacti and Spine from 1.1.38 to 1.2.0

  • Add sendmail to dockerfile via yum due to cacti 1.2.0 requirements

  • Created separate changlog file for future documentation cleanup

  • Update PHP variable readme to include max_execution_time and memory_limit changes for 1.2.0

  • Add and Hotfix the PHP variable max_execution_time for PHP_MAX_EXECUTION_TIME and memory_limit for PHP_MEMORY_LIMIT

ToDo

  • Auto import remote pollers, currently you need to navigate to there GUI for a few clicks.
  • Documentation cleanup.

docker-cacti's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-cacti's Issues

Starting httpd service - Freeze

Docker Run Cant get out of this state..

root@CETPCACT007:~# docker logs -f 52
2020-09-02_12:32 [Note] Setting server timezone settings to 'Europe/Lisbon'
2020-09-02_12:32 [PHP-SNMP] Insalling php-snmp since ENV variable 'PHP_SNMP' is set to 1
CentOS-8 - AppStream                            7.4 MB/s | 5.8 MB     00:00
CentOS-8 - Base                                 5.4 MB/s | 2.2 MB     00:00
CentOS-8 - Extras                                31 kB/s | 7.3 kB     00:00
CentOS-8 - PowerTools                           6.2 MB/s | 1.9 MB     00:00
Extra Packages for Enterprise Linux Modular 8 - 182 kB/s | 117 kB     00:00
Extra Packages for Enterprise Linux 8 - x86_64  8.9 MB/s | 7.9 MB     00:00
Package php-snmp-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
46 files removed
2020-09-02_12:32 [Apache] Validating httpd cacti configuration is present.
2020-09-02_12:32 [Apache] /etc/httpd/conf.d/cacti.conf does not exist, copying a new one over.
2020-09-02_12:32 [Apache] Applying cacti URL enviromental variable to /etc/httpd/conf.d/cacti.conf
2020-09-02_12:32 [Apache] Missing HTTPS certs, generating self-signed one's.
Generating a RSA private key
.................................................................................................++++
.........................++++
writing new private key to '/etc/ssl/certs/cacti.key'
-----
2020-09-02_12:32 [Note] Setting cacti file permissions.
2020-09-02_12:32 [Note] Starting crond service.
2020-09-02_12:32 [Note] Starting snmpd service.
2020-09-02_12:32 [Note] Starting php-fpm service.
2020-09-02_12:32 [Note] Starting httpd service.

no listening sockets available, shutting down

Hi Guys,

I'm new to docker so sorry for the odd questions.

I want to launch a container on my Synology device. But when I choose "Use the same network as Docker Host" I cannot change the port settings. I think this is the reason that I'm getting the following error's:

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs

Is it also possible to add port as a variable in the Advanced Settings? Or do I have anyother options?

Persistent storage option for rras?

Does it make sense to store the RRAs in a persistent location so as to not have to rely on a backup scripts? If so, is the current storage location simply /cacti/rra?

cpu&memery don't have data

hello,i use the docker cacti&mysql to used.
now cacti can display interface traffice graph,but cpu&memery can't display graph and the debug mode is no data.

微信图片_20201016142302

FPM initialization failed

Hi Sean, I was just going to try out the recent changes and seeing the following error after starting a test container with new volumes. I believe the www.sock file needs a permission change to either be owned by apache although I'm not completely sure.

2020-04-17_16:20 [Note] Setting cacti file permissions.
2020-04-17_16:20 [Note] Starting crond service.
2020-04-17_16:20 [Note] Starting snmpd service.
2020-04-17_16:20 [Note] Starting php-fpm service.
2020-04-17_16:20 [Note] Starting httpd service.
[17-Apr-2020 16:20:37] ERROR: [pool www] failed to read the ACL of the socket '/run/php-fpm/www.sock': Operation not supported (95)
[17-Apr-2020 16:20:37] ERROR: FPM initialization failed
kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti /bin/bash
[root@cacti /]# ls -l /run/php-fpm/www.sock 
srw-rw---- 1 root root 0 Apr 17 16:20 /run/php-fpm/www.sock

Let me know if there's any further info you need.

Thanks,
Kevin

syslog plugin

Hi.
I'm having trouble installing and configuring the syslog plugin.
what is the correct procedure to install and configure it?
i am missing the rsyslog-mysql part, how can i install it?
Thank you

FATAL: You are not authorized to use this service | Multiple pollers

Hello,

Very simple to replicate.
Go a head and compose up:

  1. docker-compose -f cacti_multi_shared.yml up -d
  2. Install cactimaster and cactipoller

Add any machine to the cactipoller, I get this error:

image

What I'm missing here?

Both fqdns are resolvable.. no problem in pinging those.

Install fails due to mysql needing SUPER privilege.

Looks like newer versions of MySQL and Percona are causing the following issues when installing via start.sh

ERROR 1227 (42000) at line 6: Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

Cacti User

Hi,

I can't log in in cacti. Is there any default user? Can I set it in installation?

Thanks

How to add perl package

How to add perl package for cacti container: perl-libwww-perl?
Can you give me some suggestions?

Problem with DB initialization

2020-08-16_21:09 [New Install] Database is up! - configuring DB located at mysql.mysql.svc.cluster.local:3306 (this can take a few minutes).
2020-08-16_21:09 [New Install] Container has been instructed to create new Database on remote system.
2020-08-16_21:09 [New Install] CREATE DATABASE cacti /*\!40100 DEFAULT CHARACTER SET utf8 */;
ERROR 1007 (HY000) at line 1: Can't create database 'cacti'; database exists
2020-08-16_21:09 [New Install] GRANT ALL ON cacti.* TO 'cacti' IDENTIFIED BY '*******';
ERROR 1044 (42000) at line 1: Access denied for user 'root'@'%' to database 'cacti'
2020-08-16_21:09 [New Install] GRANT SUPER ON *.* TO 'cacti'@'%';
ERROR 1045 (28000) at line 1: Access denied for user 'root'@'%' (using password: YES)
2020-08-16_21:09 [New Install] GRANT SELECT ON mysql.time_zone_name TO 'cacti' IDENTIFIED BY '*******';
ERROR 1142 (42000) at line 1: GRANT command denied to user 'root'@'10.244.131.232' for table 'time_zone_name'
2020-08-16_21:09 [New Install] Merging vanilla cacti.sql file to database.
ERROR 1045 (28000): Access denied for user 'cacti'@'10.244.131.232' (using password: YES)
2020-08-16_21:09 [New Install] Installing supporting template files.
2020-08-16_21:09 [New Install] Installing plugins.
2020-08-16_21:09 [New Install] Installing template file /templates/cacti_host_template_cacti_stats.xml
2020-08-16_21:09 [New Install] Installing template file /templates/cacti_host_template_cisco_router.xml
2020-08-16_21:09 [New Install] Installing template file /templates/cacti_host_template_f5_bigip_v11.xml
2020-08-16_21:09 [New Install] Installing template file /templates/cacti_host_template_juniper_networks.xml
2020-08-16_21:09 [New Install] Importing settings file /settings/boost.sql
ERROR 1045 (28000): Access denied for user 'cacti'@'10.244.131.232' (using password: YES)
2020-08-16_21:09 [New Install] Importing settings file /settings/data_source_profiles.sql
ERROR 1045 (28000): Access denied for user 'cacti'@'10.244.131.232' (using password: YES)
2020-08-16_21:09 [New Install] Importing settings file /settings/poller.sql
ERROR 1045 (28000): Access denied for user 'cacti'@'10.244.131.232' (using password: YES)
2020-08-16_21:09 [New Install] Importing settings file /settings/spine.sql
ERROR 1045 (28000): Access denied for user 'cacti'@'10.244.131.232' (using password: YES)
2020-08-16_21:09 [New Install] Removing temp Cacti and Spine installation files.

But there is an access to MySQL from this container:

[root@cacti /]# mysql -h mysql.mysql.svc.cluster.local -u 'root' -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.7.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]>

Plugin caching_sha2_password could not be loaded

Getting the following error and yes I'm using MySql 8.0.23 when installing the docker image.

ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: /usr/lib64/mariadb/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

Graphs empty

Hi,

I've installed cacti in my k3s Kubernetes cluster, but the graphics are empty, just say "Failed to open data file, poller may not have run yet".

Should I mount the cacti data file into an external volume? I've also create a file inside /cact/rra and it works with the apache user or root user.

Finally, there are no error messages in the logs:

2021-01-05 23:00:03 - SYSTEM STATS: Time:1.3251 Method:spine Processes:1 Threads:1 Hosts:2 HostsPerProcess:2 DataSources:12 RRDsProcessed:0

Any tips?

Thanks,

Changind DB credentials fails

Can you explain the proper way to change our db credentials but keep the data already collected?
I tested the default docker compose succesfuly,collected data and then after backing up with your script the data i deployed a new docker-compose file with different creds to a new VM and restored.It didnt start.

Then i copied the volumes and it starts correctly,thing is although the env vars are different i found its still using the default creds from your example and thats why its getting data.

The common error is Access denied for user 'cactiuser'@'172.21.0.3' (using password: YES)

Also i tried to change from inside the cacti docker manually the creds for the root and cactiuser users in the DB.I then noticed config.php kept the old creds so i changed it there too.Ofcourse im doing docker-compose down and up -d for my changes.

Still it keeps throwing the error and wont update the spine poller results.
SPINE: Poller[Main Poller] PID[1286] FATAL: Connection Failed, Error:'1045', Message:'Access denied for user 'cactiuser'@'172.21.0.3' (using password: YES)' (Spine parent)

I made combinations with initialize_db values but no luck.

Im missing something here,maybe another file that needs changing?Could you please reproduce and present the correct order of actions we need to do to change the DB credentials but keep the data?

Sendmail / SMTP / PHP Mail - All fail not an connection problem.

Hello @scline ,

As reporterd here 4024 but I think they will not give too much attention, all possible connection is ok from container or host.

Whit this Image I cant send any email.

  • Cacti Version 1.2.16
  • Centos 8

I've build another one

  • Cacti Version 1.2.16
  • Centos 7 + ssmtp package and it works... without any specific config

Do you have anything on this matter?

Cacti exited with code 1

I get this error when I try to install Cacti on my server.

cacti exited with code 1

[root@NMS_Server compose]# docker-compose up Pulling db (mariadb:10.3)... 10.3: Pulling from library/mariadb 32d7611b468c: Pull complete e5be16fdc306: Pull complete a361e87bde5e: Pull complete 324b95d44184: Pull complete c7a02ed92077: Pull complete 8ea02edf9bf7: Pull complete 7f24c9bd9fe3: Pull complete 0d6d5537d6c9: Pull complete 309e2f0e8909: Pull complete fb7c12284efd: Pull complete b51c8be748ee: Pull complete ff7d4b81455a: Pull complete 805638aa8a32: Pull complete Digest: sha256:518be0d8a58b0f080eb623549c6a58bcad3e4a4489af447a0c612067ed474ded Status: Downloaded newer image for mariadb:10.3 Pulling cacti (smcline06/cacti:)... latest: Pulling from smcline06/cacti 7a0437f04f83: Pull complete 33c370c2cd19: Pull complete 2a132a08075a: Pull complete ad41a6ac1796: Pull complete c8d6ce164cce: Pull complete 8b2570e5be9f: Pull complete b9a8e7d4bec2: Pull complete 87277c0dc6bf: Pull complete 1b28abea8ede: Pull complete 6f9a9fbcbe97: Pull complete 77e332dc0e39: Pull complete cfc1f915d859: Pull complete 2fb0f7ab8985: Pull complete 600a0a78c8b2: Pull complete 683e4002c613: Pull complete da294e368fc3: Pull complete 8e20a2ef92c5: Pull complete 5634aa74e542: Pull complete Digest: sha256:aeff878b4da26a7b43e44f315c4e1e466b37578846d6c9ea8d0df0bf8734e727 Status: Downloaded newer image for smcline06/cacti:latest Creating cacti_db ... done Creating cacti ... done Attaching to cacti_db, cacti cacti | standard_init_linux.go:211: exec user process caused "exec format error" cacti_db | 2021-03-07 19:44:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.3.28+maria~focal started. cacti_db | 2021-03-07 19:44:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' cacti_db | 2021-03-07 19:44:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.3.28+maria~focal started. cacti_db | 2021-03-07 19:44:07 0 [Note] mysqld (mysqld 10.3.28-MariaDB-1:10.3.28+maria~focal) starting as process 1 ... cacti_db | 2021-03-07 19:44:07 0 [Warning] The parameter innodb_file_format is deprecated and has no effect. It may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/ cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Using Linux native AIO cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Uses event mutexes cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Number of pools: 1 cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Using generic crc32 instructions cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 9, chunk size = 113.778M cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Completed initialization of buffer pool cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). cacti_db | 2021-03-07 19:44:07 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1625479 cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: 128 out of 128 rollback segments are active. cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Creating shared tablespace for temporary tables cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Waiting for purge to start cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: 10.3.28 started; log sequence number 1625488; transaction id 20 cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool cacti_db | 2021-03-07 19:44:08 0 [Note] Plugin 'FEEDBACK' is disabled. cacti_db | 2021-03-07 19:44:08 0 [Note] Recovering after a crash using tc.log cacti_db | 2021-03-07 19:44:08 0 [Note] Starting crash recovery... cacti_db | 2021-03-07 19:44:08 0 [Note] Crash recovery finished. cacti_db | 2021-03-07 19:44:08 0 [Note] InnoDB: Buffer pool(s) load completed at 210307 19:44:08 cacti_db | 2021-03-07 19:44:08 0 [Note] Server socket created on IP: '::'. cacti_db | 2021-03-07 19:44:08 0 [Warning] 'proxies_priv' entry '@% root@db' ignored in --skip-name-resolve mode. cacti_db | 2021-03-07 19:44:08 0 [Note] Reading of all Master_info entries succeeded cacti_db | 2021-03-07 19:44:08 0 [Note] Added new Master_info '' to hash table cacti_db | 2021-03-07 19:44:08 0 [Note] mysqld: ready for connections. cacti_db | Version: '10.3.28-MariaDB-1:10.3.28+maria~focal' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution cacti exited with code 1

On checking the logs of the containers created
I get this error for in the smcline06/cacti container.
standard_init_linux.go:211: exec user process caused "exec format error"

Cacti breaks if container is recreated

Issues: Some setting which need to persist are being retained within the container, such that a container can not be re-created. This seems pretty fundamental, unless I'm missing something (sorry a bit new to Docker).

Reproduction Steps:

  • Copy cacti_single_install.yml to docker-compose.yaml
  • Edit docker-compose.yaml to change the ports which are in use (as 80 and 443 are already in use)
    ports:
      - "8282:80"
      - "8383:443"
  • Run docker-compose up -d to create the cacti and database containers
  • Open localhost:8282 and complete the configuration of cacti
  • Make a change to the docker-compose.yml file. .e.g. Change the port again to say 8080 for cacti, or change the timezone, or add some additional labels (for example adding Traefik support).
  • Re-run docker-compose up -d the cacti_cacti_1 container will be recreated.
  • Navigate to localhost:8080 (if you changed the port) find you now get the Apache HTTP Server Test page, not Cacti. http://localhost:8080/cacti gives error not found.

Add CACTI_URL_PATH

Now $url_path = '/cacti/' is hardcoded in config.php. And there is no possibility to change it via an environment variable.
My proposal is to add CACTI_URL_PATH to have a possibility to change url_path. It is useful for Kubernetes with Ingress controller.

$url_path = '/cacti/';

errors with percona on compose single instance

good
when using the example with the compose using the suggested database, the installation process cannot create the "poller_output_boost" table due to an error with the timestamp format of the "time" field
I changed the image percona to mariadb:10.3, and this succeeded in creating the table without problems

RRD Error

Hi,
I am experimenting that problem below now.
RRDtool Says:
ERROR: opening '/cacti/rra/sw-3850-idb_nonunicast_out_26.rrd': No such file or directory

SMTP Fails with Cacti client But conects normaly from cli inside Container

Hello,

Well I think is more of a question..
Do you guys have any problem conecting to a SMTP server from Cacti client on docker?

Host  --> I had tested from two sources, local/external both conects from telnet via cli with TLS enable or disabled.
Cacti Host --> Connects normaly to the server, all tests OK.
Container --> Also tested from two sources local/external both conects from telnet via cli with TLS enable or disabled.
Cacti Container --> It fails conection with SMTP normaly to the server, all tests NOT OK

I See traffic when I send a test email, but unable to connect from the container..

Cacti version 15 & 14
Docker version 19.03.10

spine directory and crontab empty after docker-compose down and restoring

Using the cacti_single_install.yml docker-compose example. When bringing down/removing the containers with docker-compose down and restoring with docker-compose up -d the /spine/ directory is empty and original contents of the /etc/crontab is lost. I don't see any errors in logs so I wont post unless you need it.

Example:
After creating new container with persistent volumes for /cacti and /var/lib/mysql

Before snapshot: /spine directory and /etc/crontab has content.

kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti-test_cacti_1 /bin/bash
[root@b916fb282470 /]# ls /spine/
bin  etc  share
[root@b916fb282470 /]# cat /etc/crontab 
*/5 * * * * apache php /cacti/poller.php > /dev/null 2>&1
[root@b916fb282470 /]# exit
exit

Down/remove the containers & restore

kevin@p-serv-01:~/docker/cacti-test$ docker-compose down
Stopping cacti-test_cacti_1 ... done
Stopping cacti-test_db_1    ... done
Removing cacti-test_cacti_1 ... done
Removing cacti-test_db_1    ... done
Removing network cacti-test_default
kevin@p-serv-01:~/docker/cacti-test$ docker-compose up -d
Creating network "cacti-test_default" with the default driver
Creating cacti-test_db_1 ... done
Creating cacti-test_cacti_1 ... done

The /spine directory and /etc/crontab is empty.

kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti-test_cacti_1 /bin/bash
[root@5a93e723b394 /]# ls /spine/
[root@5a93e723b394 /]# cat /etc/crontab 
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

[root@5a93e723b394 /]# exit

Here is the docker-compose.yml file I used for this test:

kevin@p-serv-01:~/docker/cacti-test$ cat docker-compose.yml 
version: '2'
services:
  cacti:
    image: "smcline06/cacti"
    ports:
      - "8008:80"
     #- "443:443"
    environment:
      - DB_NAME=cacti_master
      - DB_USER=cactiuser
      - DB_PASS=cactipassword
      - DB_HOST=db
      - DB_PORT=3306
      - DB_ROOT_PASS=rootpassword
      - INITIALIZE_DB=1
      - TZ=America/Los_Angeles
    volumes:
      - cacti-data:/cacti
      - cacti-backups:/backups
    links:
      - db
  db:
    image: "percona:5.7.14"
    ports:
      - "3306:3306"
    command:
      - mysqld
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --max_connections=200
      - --max_heap_table_size=128M
      - --max_allowed_packet=32M
      - --tmp_table_size=128M
      - --join_buffer_size=128M
      - --innodb_buffer_pool_size=1G
      - --innodb_doublewrite=OFF
      - --innodb_flush_log_at_timeout=3
      - --innodb_read_io_threads=32
      - --innodb_write_io_threads=16
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - TZ=America/Los_Angeles
    volumes:
      - cacti-db:/var/lib/mysql
volumes:
  cacti-db:
  cacti-data:
  cacti-backups:

Thanks,
Kevin

Upgrade Bash script

We have to take a look into this script, some weird things after testing that.

Page does not load properly, and stuff

I'll take a look

New version of Spine don't have configure file

Hi,

I notice that new builds of spine don't have configure file so upgrades are applied just to Cacti. In Cacti dashboard error is displayed because cacti version is newer than spine.

To fix it i need to execute autoreconf -fvi and autoconf in order to generate the configure file.

Container fails to stay running on second and subsequent starts

Terminal / log:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.6. Set the 'ServerName' directive globally to suppress this message

And the container stops. I have temporarily added the following to start.sh to remediate, although might be best to add to Dockerfile on initial build?

echo "ServerName localhost" > /etc/httpd/conf.d/fqdn.conf

perl-Net-SNMP package miss to run some scripts

We used this container to migrate an older version of Cacti on a new one.
We are using some scripts provided in perl language
These script failed with missing librabry on the container:
Can't locate Net/SNMP.pm in @inc (you may need to install the Net::SNMP module) (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /cacti/scripts/f5_bigip_cpun.pl line 5.
BEGIN failed--compilation aborted at /cacti/scripts/f5_bigip_cpun.pl line 5.
FATAL: Spine Encountered a Segmentation Fault

The package perl-Net-SNMP is missing in the container.
I added it manually, but it should be easier to have it directly in the default container

yum -y install perl-Net-SNMP.noarch

Thanks a lot
Regards.

Directories backup and backups mixed up

The backup script copies the resultant backup .tar.gz file to /backup however readme indicates it should be /backups
The docker-compose files also map /backups which then doesn't work as the backups are created within the container not in the mapped volume.

I'd submit changes, but I'm not sure if you'd prefer backup or backups to be used. It does contain multiple so the plural would make more sense. This would need the backup.sh to be updated and the readme.

PHP-SNMP yum commands cause rpmdb error

2020-04-17_17:05 [PHP-SNMP] Insalling php-snmp since ENV variable 'PHP_SNMP' is set to 1
error: rpmdb: damaged header #173 retrieved -- skipping.
error: rpmdbNextIterator: skipping h#     173 blob size(4836): BAD, 8 + 16 * il(70) + dl(3708)
CentOS-8 - AppStream                            1.2 MB/s | 6.8 MB     00:05

The poller_output_boost_arch tables are not deleted

I'm using Cacti 1.2.17 from Docker hub smcline06/cacti, all settings are on their defaults (except added new devices and graphs).
I see ~14500 tables with the name poller_output_boost_arch_NNNNNN, and this makes DB slow, just due to the big directory size.
All of them are zero rows, but they aren't deleted automatically, so I had to delete them manually.
How this could be fixed?

As I'm not sure which project is responsible for this - I'm creating a bug in both, please see:
See Cacti/cacti#4535

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.