1# Cacti ™ 2 3[![Build Status - 4Develop](https://travis-ci.org/Cacti/cacti.svg?branch=develop)](https://travis-ci.org/Cacti/cacti) 5[![Project 6Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges) 7[![Translation 8Status](https://translate.cacti.net/widgets/cacti/-/core/svg-badge.svg)](https://translate.cacti.net 9"Translation Status") [![Average time to resolve an 10issue](http://isitmaintained.com/badge/resolution/cacti/cacti.svg)](http://isitmaintained.com/project/cacti/cacti 11"Average time to resolve an issue") [![Percentage of open 12issues](http://isitmaintained.com/badge/open/cacti/cacti.svg)](http://isitmaintained.com/project/cacti/cacti 13"Percentage of issues still open") 14 15----------------------------------------------------------------------------- 16 17## Running Cacti from the `develop` Branch 18 19### IMPORTANT 20 21When using source or by downloading the code directly from the repository, it is 22important to run the database upgrade script if you experience any errors 23referring to missing tables or columns in the database. 24 25Changes to the database are committed to the `cacti.sql` file which is used for 26new installations and committed to the installer database upgrade for existing 27installations. Because the version number does not change until release in the 28`develop` branch, which will result in the database upgrade not running, it is 29important to either use the database upgrade script to force the current version 30or update the version in the database. 31 32#### Upgrading from Pre-Cacti 1.x Releases 33 34When Cacti was first developed nearly 20 years ago, MySQL was not as mature as it 35is now. When The Cacti Group went about engineering Cacti 1.x, a decision was 36made to force users to use the InnoDB storage engine for many of the Tables. This 37was done as the InnoDB storage engine provides a better user experience when your 38web site has several concurrent logins. Though a little slower, it also provides 39greater resiliancy for the developers. 40 41With that said, there are several changes that you MUST perform to MySQL/MariaDB 42before you upgrade, and a service restart is required. Depending on your release 43of MariaDB or MySQL, the following settings will either be required, or already 44enabled as default: 45 46``` 47[mysqld] 48 49# required for multiple language support 50character-set-server = utf8mb4 51collation-server = utf8mb4_unicode_ci 52 53# Memory tunables - Cacti provides recommendations at upgrade time 54max_heap_table_size = XXX 55max_allowed_packet = 500M 56tmp_table_size = XXX 57join_buffer_size = XXX 58sort_buffer_size = XXX 59 60# important for compatibility 61sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER 62 63# innodb settings - Cacti provides recommendations at upgrade time 64innodb_buffer_pool_instances = XXX 65innodb_flush_log_at_trx_commit = 2 66innodb_buffer_pool_size = XXX 67innodb_sort_buffer_size = XXX 68innodb_doublewrite = ON 69 70# required 71innodb_file_per_table = ON 72innodb_file_format = Barracuda 73innodb_large_prefix = 1 74 75# not all version support 76innodb_flush_log_at_timeout = 3 77 78# for SSD's/NVMe 79innodb_read_io_threads = 32 80innodb_write_io_threads = 16 81innodb_io_capacity = 10000 82innodb_io_capacity_max = 20000 83innodb_flush_method = O_DIRECT 84``` 85 86The *required* settings are very important. Otherwise, you will encounter issues 87upgrading. The settings with XXX, Cacti will provide a recommendation at upgrade time. 88It is not out of the ordinary to have to restart MySQL/MariaDB during the upgrade 89to tune these settings. Please make special note of this before you begin your upgrade. 90 91Before you upgrade, you should make these required changes, then restart MySQL/MariaDB. After that, you can save yourself some time and poential errors by running the following scripts (assuming you are using bash): 92 93``` 94for table in `mysql -e "SELECT TABLE_NAME FROM information_schema.TABLES WHERE table_schema='cacti' AND engine!='MEMORY'" cacti | grep -v TABLE_NAME`; 95do 96 echo "Converting $table"; 97 mysql -e "ALTER TABLE $table ENGINE=InnoDB ROW_FORMAT=Dynamic CHARSET=utf8mb4" cacti; 98done 99``` 100 101This will convert any tables that are either InnoDB or MyISAM to Barracuda file format, dynamic row format and utf8mb4. Note, that if you have been using MySQL or MariaDB without innodb_file_per_table set to on, you might be better in backing up your database, resetting InnoDB by removing your ib* files in the /var/lib/mysql directory, and after which restoring your database and MySQL/MariaDB tables and permissions. Before you take such a step, you should always practice on a test server until you feel comfortable with the change. 102 103Good luck, and enjoy Cacti! 104 105#### Running Database Upgrade Script 106 107``` 108sudo -u cacti php -q cli/upgrade_database.php --forcever=`cat include/cacti_version` 109``` 110 111#### Updating Cacti Version in Database 112 113``` 114update version set cacti = '1.1.38'; 115``` 116 117***Note:*** Change the above version to the correct version or risk the 118installer upgrading from a previous version. 119 120----------------------------------------------------------------------------- 121 122## About 123 124Cacti is a complete network graphing solution designed to harness the power of 125RRDtool's data storage and graphing functionality providing the following 126features: 127 128- Remote and local data collectors 129 130- Device discovery 131 132- Automation of device and graph creation 133 134- Graph and device templating 135 136- Custom data collection methods 137 138- User, group and domain access controls 139 140All of this is wrapped in an intuitive, easy to use interface that makes sense 141for both LAN-sized installations and complex networks with thousands of devices. 142 143Developed in the early 2000s by Ian Berry as a high school project, it has been 144used by thousands of companies and enthusiasts to monitor and manage their 145Enterprise Networks and Data Centers. 146 147## Requirements 148 149Cacti should be able to run on any Linux, UNIX, or Windows based operating 150system with the following requirements: 151 152- PHP 5.4+ 153 154- MySQL 5.1+ 155 156- RRDtool 1.3+, 1.5+ recommended 157 158- NET-SNMP 5.5+ 159 160- Web Server with PHP support 161 162PHP Must also be compiled as a standalone cgi or cli binary. This is required 163for data gathering via cron. 164 165### php-snmp 166 167We mark the php-snmp module as optional. So long as you are not using ipv6 168devices, or using snmpv3 engine IDs or contexts, then using php-snmp should be 169safe. Otherwise, you should consider uninstalling the php-snmp module as it 170will create problems. We are aware of the problem with php-snmp and looking to 171get involved in the php project to resolve these issues. 172 173### RRDtool 174 175RRDtool is available in multiple versions and a majority of them are supported 176by Cacti. Please remember to confirm your Cacti settings for the RRDtool version 177if you having problem rendering graphs. 178 179## Documentation 180 181Documentation is available with the Cacti releases and also available for 182viewing on the [Documentation 183Repository](https://github.com/Cacti/documentation/blob/develop/README.md). 184 185## Contribute 186 187Check out the main [Cacti](http://www.cacti.net) web site for downloads, change 188logs, release notes and more! 189 190### Community forums 191 192Given the large scope of Cacti, the forums tend to generate a respectable amount 193of traffic. Doing your part in answering basic questions goes a long way since 194we cannot be everywhere at once. Contribute to the Cacti community by 195participating on the [Cacti Community Forums](http://forums.cacti.net). 196 197### GitHub Documentation 198 199Get involved in creating and editing Cacti Documentation! Fork, change and 200submit a pull request to help improve the documentation on 201[GitHub](https://github.com/cacti/documentation). 202 203### GitHub Development 204 205Get involved in development of Cacti! Join the developers and community on 206[GitHub](https://github.com/cacti)! 207 208----------------------------------------------------------------------------- 209 210## Functionality 211 212### Data Sources 213 214Cacti handles the gathering of data through the concept of data sources. Data 215sources utilize input methods to gather data from devices, hosts, databases, 216scripts, etc... The possibilities are endless as to the nature of the data you 217are able to collect. Data sources are the direct link to the underlying RRD 218files; how data is stored within RRD files and how data is retrieved from RRD 219files. 220 221### Graphs 222 223Graphs, the heart and soul of Cacti, are created by RRDtool using the defined 224data sources definition. 225 226### Templating 227 228Bringing it all together, Cacti uses and extensive template system that allows 229for the creation and consumption of portable templates. Graph, data source, and 230RRA templates allow for the easy creation of graphs and data sources out of the 231box. Along with the Cacti community support, templates have become the standard 232way to support graphing any number of devices in use in today computing and 233networking environments. 234 235### Data Collection (The Poller) 236 237Local and remote data collection support with the ability to set collection 238intervals. Check out ***Data Source Profile*** with in Cacti for more 239information. Data Source Profiles can be applied to graphs at creation time or 240at the data template level. 241 242Remote data collection has been made easy through replication of resources to 243remote data collectors. Even when connectivity to the main Cacti installation is 244lost from remote data collector, it will store collected data until connectivity 245is restored. Remote data collection only requires MySQL and HTTP/HTTPS access 246back to the main Cacti installation location. 247 248### Network Discovery and Automation 249 250Cacti provides administrators a series of network automation functionality in 251order to reduce the time and effort it takes to setup and manage devices. 252 253- Multiple definable network discovery rules 254 255- Automation templates that specify how devices are configured 256 257### Plugin Framework 258 259Cacti is more than a network monitoring system, it is an operations framework 260that allows the extension and augmentation of Cacti functionality. The Cacti 261Group continues to maintain an assortment of plugins. If you are looking to add 262features to Cacti, there is quite a bit of reference material to choose from on 263GitHub. 264 265### Dynamic Graph Viewing Experience 266 267Cacti allows for many runtime augmentations while viewing graphs: 268 269- Dynamically loaded tree and graph view 270 271- Searching by string, graph and template types 272 273- Viewing augmentation 274 275- Simple time span adjustments 276 277- Convenient sliding time window buttons 278 279- Single click realtime graph option 280 281- Easy graph export to csv 282 283- RRA view with just a click 284 285### User, Groups and Permissions 286 287Support for per user and per group permissions at a per realm (area of Cacti), 288per graph, per graph tree, per device, etc... The permission model in Cacti is 289role based access control (RBAC) to allow for flexible assignment of 290permissions. Support for enforcement of password complexity, password age and 291changing of expired passwords. 292 293## RRDtool Graph Options 294 295Cacti supports most RRDtool graphing abilities including: 296 297### Graph Options 298 299- Full right axis 300 301- Shift 302 303- Dash and dash offset 304 305- Alt y-grid 306 307- No grid fit 308 309- Units length 310 311- Tab width 312 313- Dynamic labels 314 315- Rules legend 316 317- Legend position 318 319### Graph Items 320 321- VDEFs 322 323- Stacked lines 324 325- User definable line widths 326 327- Text alignment 328 329----------------------------------------------------------------------------- 330Copyright (c) 2021 - The Cacti Group, Inc. 331