├── .github └── workflows │ └── docker-image.yml ├── .gitignore ├── CHANGELOG.md ├── Dockerfile ├── README.md ├── backup.sh ├── cacti ├── cacti-1.2.25.tar.gz └── cacti-spine-1.2.25.tar.gz ├── configs ├── cacti.conf ├── config.php ├── crontab ├── snmpd.conf └── spine.conf ├── docker-compose ├── README.md ├── cacti_multi.yml ├── cacti_multi_shared.yml ├── cacti_single_install.yml └── cacti_testing.yml ├── document_images ├── multi_host.png ├── single_db.png └── single_host.png ├── plugins └── README.md ├── restore.sh ├── settings ├── boost.sql ├── data_source_profiles.sql ├── poller.sql └── spine.sql ├── start.sh ├── templates ├── cacti_host_template_cacti_stats.xml ├── cacti_host_template_cisco_router.xml ├── cacti_host_template_f5_bigip_v11.xml ├── cacti_host_template_juniper_networks.xml ├── resource │ ├── script_queries │ │ ├── juniper-rpm-pktloss.xml │ │ ├── juniper-rpm-rttjitter.xml │ │ └── juniper_bgp_prefix.xml │ └── snmp_queries │ │ ├── Juniper_Firewall_Filter.xml │ │ ├── f5_bigip_if.xml │ │ ├── f5_bigip_ifStat.xml │ │ ├── f5_bigip_ltm_member.xml │ │ ├── f5_bigip_ltm_pool.xml │ │ ├── f5_bigip_ltm_vs.xml │ │ ├── f5_bigip_pm.xml │ │ ├── f5_bigip_pool.xml │ │ ├── f5_bigip_statProfiles.xml │ │ ├── f5_bigip_vs.xml │ │ ├── f5_gtm_poolStat.xml │ │ ├── f5_gtm_wip.xml │ │ ├── juniper_bgp_peer_state.xml │ │ ├── juniper_fpc_stats.xml │ │ ├── juniper_pem_stats.xml │ │ ├── juniper_re_stats.xml │ │ ├── juniper_srx_central_point.xml │ │ ├── juniper_srx_screens.xml │ │ ├── juniper_srx_security_policy.xml │ │ └── juniper_srx_services_processing_unit.xml └── scripts │ ├── README.md │ ├── f5-bigip-cpu-nice.pl │ ├── f5_bigip_cpu.pl │ ├── f5_bigip_cpun.pl │ ├── juniper-rpm.pl │ ├── juniper_bgp_prefix.php │ └── ss_multicpu_avg.php └── upgrade.sh /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Build the Docker image 18 | run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac Files 2 | .DS_Store 3 | docker-compose.* 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | #### 1.2.16 - 12/27/2020 3 | * Update Cacti and Spine from 1.2.15 to 1.2.16 4 | * [changelog][CL1.2.16] 5 | * [zuka1337](https://github.com/zuka1337) added powertools to base dockerfile image via [#82](https://github.com/scline/docker-cacti/pull/82) 6 | 7 | #### 1.2.15 - 11/05/2020 8 | * Update Cacti and Spine from 1.2.14 to 1.2.15 9 | * [changelog][CL1.2.15] 10 | 11 | #### 1.2.14 - 08/15/2020 12 | * Close issue [#73](https://github.com/scline/docker-cacti/issues/73) - Add CACTI_URL_PATH; Thanks for the request [xbolshe](https://github.com/xbolshe) and help on apache configs. 13 | * Update Cacti and Spine from 1.2.11 to 1.2.14 14 | * [changelog][CL1.2.14] 15 | 16 | #### 1.2.11a - 04/18/2020 17 | * Close issue [#64](https://github.com/scline/docker-cacti/issues/64) - FPM initialization failed; Thanks to [kevburkett](https://github.com/kevburkett) for bringing this one up and helping validate the fix 18 | * Close issue [#65](https://github.com/scline/docker-cacti/issues/65) - PHP-SNMP yum commands cause rpmdb error 19 | 20 | #### 1.2.11 - 04/17/2020 21 | * Update Docker container to use Centos8 over Centos7 22 | * Close issue [#59](https://github.com/scline/docker-cacti/issues/59) - errors with percona on compose single instance; Thank you [miguelwill](https://github.com/miguelwill) 23 | * Update docker-comose examples with Mariadb:10.3 from older Percona version 24 | * Close issue [#61](https://github.com/scline/docker-cacti/issues/61) - spine directory and crontab empty after docker-compose down and restoring; Thank you [kevburkett](https://github.com/kevburkett) 25 | * Update docker-compose with `spine` volume 26 | * Enable HTTPS functionality and self-sign certs when needed 27 | * Allow functionality to disable PHP-SNMP usagage via `PHP_SNMP` environment variable 28 | se 29 | * Manual patch on provisioning new remote pollers - https://github.com/Cacti/cacti/issues/3459 30 | * Update Cacti and Spine from 1.2.8 to 1.2.11 31 | * [changelog 1.2.10 -> 1.2.11][CL1.2.11] 32 | * [changelog 1.2.9 -> 1.2.10][CL1.2.10] 33 | * [changelog 1.2.8 -> 1.2.9][CL1.2.9] 34 | 35 | #### 1.2.8 - 12/11/2019 36 | * Update Cacti and Spine from 1.2.6 to 1.2.8 37 | * [changelog 1.2.7 -> 1.2.8][CL1.2.8] 38 | * [changelog 1.2.6 -> 1.2.7][CL1.2.7] 39 | 40 | #### 1.2.6a - 10/30/2019 41 | * Update start.sh to persist Apache Cacti configurations on restart. [#52] (https://github.com/scline/docker-cacti/issues/52) 42 | * Update docker-compose examples to use different type of volumes so `docker-compose down` will not affect data without the `-v` flag. 43 | 44 | #### 1.2.6 - 09/06/2019 45 | * Update Cacti and Spine from 1.2.0 to 1.2.6 46 | * [changelog][cacti_changelog] 47 | * Removed 1.1.X changelog notes from README.md, this can be located in [CHANGELOG.md](https://github.com/scline/docker-cacti/blob/master/changelog.md) 48 | * Close Issue [#49](https://github.com/scline/docker-cacti/issues/49) - New version of Spine don't have configure file 49 | * Close Issue [#45](https://github.com/scline/docker-cacti/issues/45) - Directories backup and backups mixed up; thank you [shortbloke](https://github.com/shortbloke) for [PR #46](https://github.com/scline/docker-cacti/pull/46) 50 | * Merge [PR #47](https://github.com/scline/docker-cacti/pull/47) and [PR #48](https://github.com/scline/docker-cacti/pull/48) - Add modify PHP env; thank you [joey741019](https://github.com/joey741019) 51 | 52 | #### 1.2.0 - 01/06/2019 53 | * Update Cacti and Spine from 1.1.38 to 1.2.0 54 | * [changelog][cacti_changelog] 55 | 56 | * Add sendmail to dockerfile via yum due to cacti 1.2.0 requirements 57 | * Created separate changlog file for future documentation cleanup 58 | * Update PHP variable readme to include `max_execution_time` and `memory_limit` changes for 1.2.0 59 | * Add and Hotfix the PHP variable `max_execution_time` for PHP_MAX_EXECUTION_TIME and `memory_limit` for PHP_MEMORY_LIMIT 60 | 61 | #### 1.1.38 - 05/12/2018 62 | * Update Cacti and Spine from 1.1.37 to 1.1.38 63 | * [changelog 1.1.37 -> 1.1.38][CL1.1.38] 64 | * Merge yum run commands in dockerfile to reduce stored space. 65 | 66 | #### 1.1.37 - 04/4/2018 67 | * Update Cacti and Spine from 1.1.34 to 1.1.37 68 | * [changelog 1.1.36 -> 1.1.37][CL1.1.37] 69 | * [changelog 1.1.35 -> 1.1.36][CL1.1.36] 70 | * [changelog 1.1.34 -> 1.1.35][CL1.1.35] 71 | * Close Issue [#36](https://github.com/scline/docker-cacti/issues/36) - Initialize DB fails if mysql running on non-standard port 72 | * Close Issue [#38](https://github.com/scline/docker-cacti/issues/38) - "httpd: Could not reliably determine the server's fully qualified domain name" httpd errors 73 | * Close Issue [#40](https://github.com/scline/docker-cacti/issues/40) - Remove documentation about automated backups since this is not implemented. 74 | 75 | #### 1.1.34 - 02/8/2018 76 | * Update Cacti and Spine from 1.1.31 to 1.1.34 77 | * [changelog 1.1.33 -> 1.1.34][CL1.1.34] 78 | * [changelog 1.1.32 -> 1.1.33][CL1.1.33] 79 | * [changelog 1.1.31 -> 1.1.32][CL1.1.32] 80 | 81 | #### 1.1.31 - 01/18/2018 82 | * Update Cacti and Spine from 1.1.30 to 1.1.31 83 | * [changelog 1.1.30 -> 1.1.31][CL1.1.31] 84 | 85 | #### 1.1.30 - 01/03/2018 86 | * Update Cacti and Spine from 1.1.28 to 1.1.30 87 | * [changelog 1.1.29 -> 1.1.30][CL1.1.30] 88 | * [changelog 1.1.28 -> 1.1.29][CL1.1.29] 89 | 90 | #### 1.1.28u1 - 12/23/2017 91 | * Removed pre-installed plugins (expecting users to add there own) 92 | * Refactored the way Cacti is installed. This is now removed from Dockerfile and moved to start.sh 93 | * Allows the volume mounting of '/cacti', before this would break cacti installation 94 | 95 | #### 1.1.28 - 11/21/2017 96 | * Update Cacti and Spine from 1.1.27 to 1.1.28 97 | * [changelog 1.1.27 -> 1.1.28][CL1.1.28] 98 | 99 | #### 1.1.27 - 11/07/2017 100 | * Update Cacti and Spine from 1.1.24 to 1.1.27 101 | * [changelog 1.1.26 -> 1.1.27][CL1.1.27] 102 | * [changelog 1.1.25 -> 1.1.26][CL1.1.26] 103 | * [changelog 1.1.24 -> 1.1.25][CL1.1.25] 104 | 105 | #### 1.1.24 - 09/18/2017 106 | * Update Cacti and Spine from 1.1.19 to 1.1.24 107 | * [changelog 1.1.23 -> 1.1.24][CL1.1.24] 108 | * [changelog 1.1.22 -> 1.1.23][CL1.1.23] 109 | * [changelog 1.1.21 -> 1.1.22][CL1.1.22] 110 | * [changelog 1.1.20 -> 1.1.21][CL1.1.21] 111 | * [changelog 1.1.19 -> 1.1.20][CL1.1.20] 112 | 113 | #### 1.1.19 - 08/21/2017 114 | * Update Cacti and Spine from 1.1.12 to 1.1.19 115 | * [changelog 1.1.18 -> 1.1.19][CL1.1.19] 116 | * [changelog 1.1.17 -> 1.1.18][CL1.1.18] 117 | * [changelog 1.1.16 -> 1.1.17][CL1.1.17] 118 | * [changelog 1.1.15 -> 1.1.16][CL1.1.16] 119 | * [changelog 1.1.14 -> 1.1.15][CL1.1.15] 120 | * [changelog 1.1.13 -> 1.1.14][CL1.1.14] 121 | * [changelog 1.1.12 -> 1.1.13][CL1.1.13] 122 | 123 | #### 1.1.12 - 07/05/2017 124 | * Update Cacti and Spine from 1.1.11 to 1.1.12 - [changelog link][CL1.1.12] 125 | * Update upgrade.sh script to use `wget` instead of `curl` due to URL errors. 126 | 127 | #### 1.1.11 - 07/04/2017 128 | * Update Cacti and Spine from 1.1.10 to 1.1.11 - [changelog link][CL1.1.11] 129 | 130 | #### 1.1.10 - 06/17/2017 131 | * Update Cacti and Spine from 1.1.9 to 1.1.10 - [changelog link][CL1.1.10] 132 | 133 | #### 1.1.9 - 06/08/2017 134 | * Update Cacti and Spine from 1.1.5 to 1.1.9 135 | * [changelog 1.1.8 -> 1.1.9][CL1.1.9] 136 | * [changelog 1.1.7 -> 1.1.8][CL1.1.8] 137 | * [changelog 1.1.6 -> 1.1.7][CL1.1.7] 138 | * [changelog 1.1.5 -> 1.1.6][CL1.1.6] 139 | * Update cacti plugins 140 | * thold from 1.0.2 -> 1.0.3 141 | * monitor from 2.0 -> 2.1 142 | * syslog from 2.0 -> 2.1 143 | 144 | #### 1.1.5 - 04/27/2017 145 | * Update Cacti and Spine from 1.1.4 to 1.1.5 - [changelog link][CL1.1.5] 146 | 147 | #### 1.1.4 - 04/24/2017 148 | * Update Cacti and Spine from 1.1.3 to 1.1.4 - [changelog link][CL1.1.4] 149 | * Update THOLD template with master due to function bug on cacti 1.1+ 150 | 151 | #### 1.1.3 - 04/15/2017 152 | * Update Cacti and Spine from 1.1.2 to 1.1.3 - [changelog link][CL1.1.3] 153 | * remove temp automation_api file fix since this has been solved in 1.1.3 154 | 155 | #### 1.1.2 - 04/11/2017 156 | * Added 1 Minute polling template 157 | * Updated plugin THOLD 1.0.1 -> 1.0.2 158 | * Updated CereusTransporter 0.65 -> 0.66 159 | * Added F5, ESX, PerconaDB, and Linux host templates 160 | ##### --- 04/09/2017 --- 161 | * Update crontab from apache user to /etc/crontab 162 | * Apply https://github.com/CentOS/CentOS-Dockerfiles/issues/31 fix so cron works on Centos:7 container 163 | ##### --- 04/02/2017 --- 164 | * Update Cacti and Spine from 1.1.1 to 1.1.2 - [changelog link][CL1.1.2] 165 | * Restore from a cacti backup is now working via `restore.sh ` command 166 | * Minor cleanup of `backup.sh` script 167 | * Upgrade cacti script created and tested using `upgrade.sh` script 168 | 169 | #### 1.1.1 - 03/27/2017 170 | * Update Cacti and Spine from 1.1.0 to 1.1.1 - [changelog link][CL1.1.1] 171 | * GitHub ReadMe organization 172 | 173 | #### 1.1.0 - 03/25/2017 174 | * Initial push 175 | 176 | [CL1.2.16]: http://www.cacti.net/release_notes.php?version=1.2.16 177 | [CL1.2.15]: http://www.cacti.net/release_notes.php?version=1.2.15 178 | [CL1.2.14]: http://www.cacti.net/release_notes.php?version=1.2.14 179 | [CL1.2.11]: http://www.cacti.net/release_notes.php?version=1.2.11 180 | [CL1.2.10]: http://www.cacti.net/release_notes.php?version=1.2.10 181 | [CL1.2.9]: http://www.cacti.net/release_notes.php?version=1.2.9 182 | [CL1.2.8]: http://www.cacti.net/release_notes.php?version=1.2.8 183 | [CL1.2.7]: http://www.cacti.net/release_notes.php?version=1.2.7 184 | [CL1.2.6]: http://www.cacti.net/release_notes.php?version=1.2.6 185 | [CL1.2.5]: http://www.cacti.net/release_notes.php?version=1.2.5 186 | [CL1.2.4]: http://www.cacti.net/release_notes.php?version=1.2.4 187 | [CL1.2.3]: http://www.cacti.net/release_notes.php?version=1.2.3 188 | [CL1.2.2]: http://www.cacti.net/release_notes.php?version=1.2.2 189 | [CL1.2.1]: http://www.cacti.net/release_notes.php?version=1.2.1 190 | [CL1.2.0]: http://www.cacti.net/release_notes.php?version=1.2.0 191 | [CL1.1.38]: https://www.cacti.net/changelog.php?version=1.1.38 192 | [CL1.1.37]: https://www.cacti.net/changelog.php?version=1.1.37 193 | [CL1.1.36]: https://www.cacti.net/changelog.php?version=1.1.36 194 | [CL1.1.35]: https://www.cacti.net/changelog.php?version=1.1.35 195 | [CL1.1.34]: https://www.cacti.net/changelog.php?version=1.1.34 196 | [CL1.1.33]: https://www.cacti.net/changelog.php?version=1.1.33 197 | [CL1.1.32]: https://www.cacti.net/changelog.php?version=1.1.32 198 | [CL1.1.31]: https://www.cacti.net/changelog.php?version=1.1.31 199 | [CL1.1.30]: https://www.cacti.net/changelog.php?version=1.1.30 200 | [CL1.1.29]: https://www.cacti.net/changelog.php?version=1.1.29 201 | [CL1.1.28]: https://www.cacti.net/changelog.php?version=1.1.28 202 | [CL1.1.27]: https://www.cacti.net/changelog.php?version=1.1.27 203 | [CL1.1.26]: https://www.cacti.net/changelog.php?version=1.1.26 204 | [CL1.1.25]: https://www.cacti.net/changelog.php?version=1.1.25 205 | [CL1.1.24]: https://www.cacti.net/changelog.php?version=1.1.24 206 | [CL1.1.23]: https://www.cacti.net/changelog.php?version=1.1.23 207 | [CL1.1.22]: https://www.cacti.net/changelog.php?version=1.1.22 208 | [CL1.1.21]: https://www.cacti.net/changelog.php?version=1.1.21 209 | [CL1.1.20]: https://www.cacti.net/changelog.php?version=1.1.20 210 | [CL1.1.19]: https://www.cacti.net/changelog.php?version=1.1.19 211 | [CL1.1.18]: https://www.cacti.net/changelog.php?version=1.1.18 212 | [CL1.1.17]: https://www.cacti.net/changelog.php?version=1.1.17 213 | [CL1.1.16]: https://www.cacti.net/changelog.php?version=1.1.16 214 | [CL1.1.15]: https://www.cacti.net/changelog.php?version=1.1.15 215 | [CL1.1.14]: https://www.cacti.net/changelog.php?version=1.1.14 216 | [CL1.1.13]: https://www.cacti.net/changelog.php?version=1.1.13 217 | [CL1.1.12]: https://www.cacti.net/changelog.php?version=1.1.12 218 | [CL1.1.11]: https://www.cacti.net/changelog.php?version=1.1.11 219 | [CL1.1.10]: https://www.cacti.net/changelog.php?version=1.1.10 220 | [CL1.1.9]: https://www.cacti.net/changelog.php 221 | [CL1.1.8]: https://www.cacti.net/changelog.php 222 | [CL1.1.7]: https://www.cacti.net/changelog.php 223 | [CL1.1.6]: https://www.cacti.net/changelog.php 224 | [CL1.1.5]: https://www.cacti.net/changelog.php 225 | [CL1.1.4]: https://www.cacti.net/changelog.php 226 | [CL1.1.3]: https://www.cacti.net/changelog.php 227 | [CL1.1.2]: https://www.cacti.net/changelog.php 228 | [CL1.1.1]: https://www.cacti.net/changelog.php 229 | 230 | [cacti_changelog]: https://www.cacti.net/changelog.php 231 | [cacti_download]: http://www.cacti.net/downloads 232 | [spine_download]: http://www.cacti.net/downloads/spine 233 | [arch]: https://github.com/scline/docker-cacti/tree/master/docker-compose 234 | [docker_volume_help]: https://docs.docker.com/engine/tutorials/dockervolumes 235 | [cacti_forums]: http://forums.cacti.net 236 | [cws]: http://cacti.net -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rockylinux:9.0 2 | 3 | LABEL org.opencontainers.image.authors="Sean Cline " 4 | 5 | EXPOSE 80 443 6 | 7 | ## --- ENV --- 8 | ENV \ 9 | DB_NAME=cacti \ 10 | DB_USER=cactiuser \ 11 | DB_PASS=cactipassword \ 12 | DB_HOST=localhost \ 13 | DB_PORT=3306 \ 14 | RDB_NAME=cacti \ 15 | RDB_USER=cactiuser \ 16 | RDB_PASS=cactipassword \ 17 | RDB_HOST=localhost \ 18 | RDB_PORT=3306 \ 19 | CACTI_URL_PATH=cacti \ 20 | BACKUP_RETENTION=7 \ 21 | BACKUP_TIME=0 \ 22 | REMOTE_POLLER=0 \ 23 | INITIALIZE_DB=0 \ 24 | TZ=UTC \ 25 | PHP_MEMORY_LIMIT=800M \ 26 | PHP_MAX_EXECUTION_TIME=60 \ 27 | PHP_SNMP=1 28 | 29 | CMD ["/start.sh"] 30 | 31 | ## --- Start --- 32 | COPY start.sh /start.sh 33 | 34 | ## --- SUPPORTING FILES --- 35 | #COPY cacti /cacti_install 36 | 37 | # --- GET LATEST VERSION 38 | ADD http://files.cacti.net/spine/cacti-spine-latest.tar.gz /cacti_install/cacti-spine-latest.tar.gz 39 | ADD https://files.cacti.net/cacti/linux/cacti-latest.tar.gz /cacti_install/cacti-latest.tar.gz 40 | 41 | ## --- SERVICE CONFIGS --- 42 | COPY configs /template_configs 43 | COPY configs/crontab /etc/crontab 44 | 45 | ## --- SETTINGS/EXTRAS --- 46 | COPY plugins /cacti_install/plugins 47 | COPY templates /templates 48 | COPY settings /settings 49 | 50 | ## --- SCRIPTS --- 51 | COPY upgrade.sh /upgrade.sh 52 | COPY restore.sh /restore.sh 53 | COPY backup.sh /backup.sh 54 | 55 | ## --- UPDATE OS, INSTALL EPEL, PHP EXTENTIONS, CACTI/SPINE Requirements, Other/Requests --- 56 | RUN \ 57 | chmod +x /upgrade.sh && \ 58 | chmod +x /restore.sh && \ 59 | chmod +x /backup.sh && \ 60 | chmod u+s /bin/ping && \ 61 | chmod g+s /bin/ping && \ 62 | mkdir /backups && \ 63 | mkdir /cacti && \ 64 | mkdir /spine && \ 65 | yum update -y && \ 66 | yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ 67 | yum install -y dnf-plugins-core && \ 68 | yum config-manager --set-enabled crb && \ 69 | yum install -y \ 70 | php php-xml php-session php-sockets php-ldap php-gd \ 71 | php-json php-mysqlnd php-gmp php-mbstring php-posix \ 72 | php-snmp php-intl php-common php-cli php-devel php-pear \ 73 | php-pdo && \ 74 | yum install -y \ 75 | rrdtool net-snmp net-snmp-utils cronie mariadb autoconf \ 76 | bison openssl openldap mod_ssl net-snmp-libs automake \ 77 | gcc gzip libtool make net-snmp-devel dos2unix m4 which \ 78 | openssl-devel mariadb-devel sendmail curl wget help2man perl-libwww-perl && \ 79 | yum clean all && \ 80 | rm -rf /var/cache/yum/* && \ 81 | chmod 0644 /etc/crontab && \ 82 | echo "ServerName localhost" > /etc/httpd/conf.d/fqdn.conf && \ 83 | /usr/libexec/httpd-ssl-gencerts 84 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cacti v1+ Docker Container 2 | 3 | #### Dockerhub [![](https://images.microbadger.com/badges/image/smcline06/cacti.svg)](https://microbadger.com/images/smcline06/cacti "Get your own image badge on microbadger.com")[![Stars on Docker Hub](https://img.shields.io/docker/stars/smcline06/cacti.svg)](https://hub.docker.com/r/smcline06/cacti)[![Pulls on Docker Hub](https://img.shields.io/docker/pulls/smcline06/cacti.svg)](https://hub.docker.com/r/smcline06/cacti) 4 | #### Github [![GitHub Open Issues](https://img.shields.io/github/issues/scline/docker-cacti.svg)](https://github.com/scline/docker-cacti/issues)[![GitHub Stars](https://img.shields.io/github/stars/scline/docker-cacti.svg)](https://github.com/scline/docker-cacti)[![GitHub Forks](https://img.shields.io/github/forks/scline/docker-cacti.svg)](https://github.com/scline/docker-cacti) 5 | 6 | ## Cacti System 7 | Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides following features: 8 | 9 | * remote and local data collectors 10 | * network discovery 11 | * device management automation 12 | * graph templating 13 | * custom data acquisition methods 14 | * user, group and domain management 15 | * C3 level security settings for local accounts 16 | * strong password hashing 17 | * forced regular password changes, complexity, and history 18 | * account lockout support 19 | 20 | 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. 21 | 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. 22 | More information around this opensource product can be located at the following [website][cws]. 23 | 24 | ## Using this image 25 | ### Running the container 26 | 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. 27 | 28 | ### Exposed Ports 29 | The following ports are important and used by Cacti 30 | 31 | | Port | Notes | 32 | |------|:-------------:| 33 | | 80 | HTTP GUI Port | 34 | | 443 | HTTPS GUI Port| 35 | 36 | 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 37 | `docker run -p 80:80 -p 443:443` 38 | 39 | #### HTTPS 40 | By default https will work if exposed, though using a self signed certificate. To provide your own certificate replace via mounting the following files: 41 | 42 | ``` 43 | /etc/ssl/certs/cacti.key 44 | /etc/ssl/certs/cacti.crt 45 | ``` 46 | 47 | ## Installation 48 | 49 | ### Cacti Master 50 | The main cacti poller settings, these are required for single cacti and multi cacti host installations. 51 | 52 | | Environment Variable | Function | 53 | |---|---| 54 | | DB_NAME | The MySQL database name, this is used for both cacti settings and spine poller configurations. | 55 | | DB_USER | MySQL database user cacti should use. Both cacti and spine poller will share these settings. | 56 | | DB_PASS | MySQL database password assigned to `DB_USER` Both cacti and spine poller will share these settings. | 57 | | DB_HOST | The IP address, FQDN/hostname, or linked container name that cacti would use as a database. | 58 | | DB_PORT | What TCP port is the MySQL database listening on, by default its 3306. | 59 | | 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. | 60 | | 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. | 61 | | TZ | TimeZone, please select a format Centos understands, a list can be generated by running `ls /usr/share/zoneinfo`. | 62 | | BACKUP_RETENTION | Number of backup files to keep. | 63 | | REMOTE_POLLER | Can be `0` for false (default) or `1` for true. | 64 | | PHP_MEMORY_LIMIT | PHP memory limit adjust, by defaults its 128M | 65 | | PHP_MAX_EXECUTION_TIME | PHP max execution time adjust, by defaults its 30 second | 66 | | 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 | 67 | 68 | ### Remote Cacti Pollers 69 | 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. 70 | 71 | | Environment Variable | Function | 72 | |---|---| 73 | | DB_NAME | The MySQL database, this is used for both cacti settings and spine poller configurations. | 74 | | DB_USER | MySQL database user cacti should use. Both cacti and spine poller will share these settings. | 75 | | DB_PASS | MySQL database password assigned to `DB_USER` Both cacti and spine poller will share these settings. | 76 | | DB_HOST | The IP address, FQDN/hostname, or linked container name that cacti would use as a database. | 77 | | DB_PORT | What TCP port is the MySQL database listening on, by default its 3306. | 78 | | 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` | 79 | | 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. | 80 | | TZ | TimeZone, please select a format Centos understands, a list can be generated by running `ls /usr/share/zoneinfo`.| 81 | | BACKUP_RETENTION | Number of backup files to keep| 82 | | REMOTE_POLLER | Can be `0` for false (default) or `1` for true. If true the container is setup as a remote poller. | 83 | | RDB_NAME | The master Cacti instance MySQL database name, this is used for both cacti settings and spine poller configurations. | 84 | | RDB_USER | MySQL database user used by the master Cacti container should use. | 85 | | RDB_PASS | MySQL database password assigned to `RDB_USER` that is used by the master Cacti container. | 86 | | RDB_HOST | The IP address, FQDN/hostname, or linked container name that the master Cacti instance uses | 87 | | RDB_PORT | What TCP port is the MySQL database listening on, by default its 3306. | 88 | 89 | ### Database Settings 90 | 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][cacti_forums]. 91 | 92 | |MySQL Variable| Recommended Value | Notes | 93 | |---|---|---| 94 | | 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. | 95 | | 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. | 96 | | 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. | 97 | | 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. | 98 | | 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.| 99 | | 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. | 100 | | tmp_table_size | >= 64M | When executing subqueries, having a larger temporary table size, keep those temporary tables in memory. | 101 | | 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. | 102 | | 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. | 103 | | 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. | 104 | | 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. | 105 | | 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. | 106 | | 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. | 107 | | 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. | 108 | | 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 | 109 | | innodb_read_io_threads | >= 32 | With modern SSD type storage, having multiple read io threads is advantageous for applications with high io characteristics. | 110 | | innodb_write_io_threads | >= 16 | With modern SSD type storage, having multiple write io threads is advantageous for applications with high io characteristics. | 111 | |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.| 112 | | 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. | 113 | | 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. | 114 | | memory_limit | >= 800M | A minimum of 800 MB memory limit | 115 | | max_execution_time | >= 60 | A minimum of 1 m execution time | 116 | 117 | ### Data Backups 118 | 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: 119 | 120 | ``` 121 | docker exec ./backup.sh 122 | ``` 123 | 124 | 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. 125 | 126 | ### Restore Backup 127 | To restore from an existing backup, run the following docker exec command with the backup file location as an argument. 128 | ``` 129 | docker exec ./restore.sh /backups/ 130 | ``` 131 | 132 | To get a list of backups, the following command should display them: 133 | ``` 134 | docker exec ls /backups 135 | ``` 136 | 137 | ### Updating Cacti 138 | You can now update the Cacti/Spine version of this container using the included script. By default this will update to the *latest* version. 139 | ``` 140 | docker exec ./upgrade.sh 141 | ``` 142 | 143 | If you want to specify a specific version please update the `/upgrade.sh` values. 144 | * [Cacti Version Links][cacti_download] 145 | * [Spine Version Links][spine_download] 146 | 147 | ``` 148 | #!/bin/bash 149 | # script to upgrade a cacti instance to latest, if you want a specific version please update the following download links 150 | cacti_download_url=http://www.cacti.net/downloads/cacti-latest.tar.gz 151 | spine_download_url=http://www.cacti.net/downloads/spine/cacti-spine-latest.tar.gz 152 | ``` 153 | 154 | ## Docker Cacti Architecture 155 | ----------------------------------------------------------------------------- 156 | 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. 157 | 158 | Some docker-compose examples can be found in the following [readme][arch] 159 | 160 | ## Container Customization 161 | 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. 162 | 163 | ### Device Templates 164 | Dropping device templates in the `/templates/` folder using the following structure: 165 | ``` 166 | ├── templates 167 | │ ├── template_name.xml 168 | │ ├── resource 169 | │ │ └── script_queries 170 | │ │ └── ... 171 | │ │ └── script_server 172 | │ │ └── ... 173 | │ │ └── snmp_queries 174 | │ │ └── ... 175 | │ ├── scripts 176 | │ │ └── ... 177 | ``` 178 | At buld/first boot you will see some log messages that they were imported to the underlying Cacti system 179 | ``` 180 | 2017-03-24_19:22 [New Install] Installing supporting template files. 181 | 2017-03-24_19:22 [New Install] Installing template file /templates/cacti_host_template_juniper_networks.xml 182 | ``` 183 | 184 | ### Plugins 185 | 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. 186 | 187 | To add plugins after the container is built, for example if pulling directly form dockerhub, mount the `/cacti/plugins` directory using [docker volumes][docker_volume_help]. 188 | 189 | ### Settings 190 | 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: 191 | ##### /settings/spine.sql 192 | ``` 193 | -- 194 | -- Enable spine poller from docker installation 195 | -- 196 | 197 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine', '/spine/bin/spine'); 198 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine_config', '/spine/etc/spine.conf'); 199 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('poller_type', '2'); 200 | ``` 201 | 202 | # Change Log 203 | #### 1.2.17 - 05/11/2021 204 | * Update Cacti and Spine from 1.2.16 to 1.2.17 205 | * [changelog][CL1.2.17] 206 | 207 | #### 1.2.16 - 12/27/2020 208 | * Update Cacti and Spine from 1.2.15 to 1.2.16 209 | * [changelog][CL1.2.16] 210 | * [zuka1337](https://github.com/zuka1337) added powertools to base dockerfile image via [#82](https://github.com/scline/docker-cacti/pull/82) 211 | 212 | #### 1.2.15 - 11/05/2020 213 | * Update Cacti and Spine from 1.2.14 to 1.2.15 214 | * [changelog][CL1.2.15] 215 | 216 | #### 1.2.14 - 08/15/2020 217 | * Close issue [#73](https://github.com/scline/docker-cacti/issues/73) - Add CACTI_URL_PATH; Thanks for the request [xbolshe](https://github.com/xbolshe) and help on apache configs. 218 | * Update Cacti and Spine from 1.2.11 to 1.2.14 219 | * [changelog][CL1.2.14] 220 | 221 | #### 1.2.11a - 04/18/2020 222 | * Close issue [#64](https://github.com/scline/docker-cacti/issues/64) - FPM initialization failed; Thanks to [kevburkett](https://github.com/kevburkett) for bringing this one up and helping validate the fix 223 | * Close issue [#65](https://github.com/scline/docker-cacti/issues/65) - PHP-SNMP yum commands cause rpmdb error 224 | 225 | #### 1.2.11 - 04/17/2020 226 | * Update Docker container to use Centos8 over Centos7 227 | * Close issue [#59](https://github.com/scline/docker-cacti/issues/59) - errors with percona on compose single instance; Thank you [miguelwill](https://github.com/miguelwill) 228 | * Update docker-comose examples with Mariadb:10.3 from older Percona version 229 | * Close issue [#61](https://github.com/scline/docker-cacti/issues/61) - spine directory and crontab empty after docker-compose down and restoring; Thank you [kevburkett](https://github.com/kevburkett) 230 | * Update docker-compose with `spine` volume 231 | * Enable HTTPS functionality and self-sign certs when needed 232 | * Allow functionality to disable PHP-SNMP usagage via `PHP_SNMP` environment variable 233 | se 234 | * Manual patch on provisioning new remote pollers - https://github.com/Cacti/cacti/issues/3459 235 | * Update Cacti and Spine from 1.2.8 to 1.2.11 236 | * [changelog 1.2.10 -> 1.2.11][CL1.2.11] 237 | * [changelog 1.2.9 -> 1.2.10][CL1.2.10] 238 | * [changelog 1.2.8 -> 1.2.9][CL1.2.9] 239 | 240 | #### 1.2.8 - 12/11/2019 241 | * Update Cacti and Spine from 1.2.6 to 1.2.8 242 | * [changelog 1.2.7 -> 1.2.8][CL1.2.8] 243 | * [changelog 1.2.6 -> 1.2.7][CL1.2.7] 244 | 245 | #### 1.2.6a - 10/30/2019 246 | * Update start.sh to persist Apache Cacti configurations on restart. [#52] (https://github.com/scline/docker-cacti/issues/52) 247 | * Update docker-compose examples to use different type of volumes so `docker-compose down` will not affect data without the `-v` flag. 248 | 249 | #### 1.2.6 - 09/06/2019 250 | * Update Cacti and Spine from 1.2.0 to 1.2.6 251 | * [changelog][cacti_changelog] 252 | * Removed 1.1.X changelog notes from README.md, this can be located in [CHANGELOG.md](https://github.com/scline/docker-cacti/blob/master/changelog.md) 253 | * Close Issue [#49](https://github.com/scline/docker-cacti/issues/49) - New version of Spine don't have configure file 254 | * Close Issue [#45](https://github.com/scline/docker-cacti/issues/45) - Directories backup and backups mixed up; thank you [shortbloke](https://github.com/shortbloke) for [PR #46](https://github.com/scline/docker-cacti/pull/46) 255 | * Merge [PR #47](https://github.com/scline/docker-cacti/pull/47) and [PR #48](https://github.com/scline/docker-cacti/pull/48) - Add modify PHP env; thank you [joey741019](https://github.com/joey741019) 256 | 257 | #### 1.2.0 - 01/06/2019 258 | * Update Cacti and Spine from 1.1.38 to 1.2.0 259 | * [changelog][cacti_changelog] 260 | 261 | * Add sendmail to dockerfile via yum due to cacti 1.2.0 requirements 262 | * Created separate changlog file for future documentation cleanup 263 | * Update PHP variable readme to include `max_execution_time` and `memory_limit` changes for 1.2.0 264 | * Add and Hotfix the PHP variable `max_execution_time` for PHP_MAX_EXECUTION_TIME and `memory_limit` for PHP_MEMORY_LIMIT 265 | 266 | # ToDo 267 | * Auto import remote pollers, currently you need to navigate to there GUI for a few clicks. 268 | * Documentation cleanup. 269 | 270 | [CL1.2.17]: http://www.cacti.net/release_notes.php?version=1.2.17 271 | [CL1.2.16]: http://www.cacti.net/release_notes.php?version=1.2.16 272 | [CL1.2.15]: http://www.cacti.net/release_notes.php?version=1.2.15 273 | [CL1.2.14]: http://www.cacti.net/release_notes.php?version=1.2.14 274 | [CL1.2.11]: http://www.cacti.net/release_notes.php?version=1.2.11 275 | [CL1.2.10]: http://www.cacti.net/release_notes.php?version=1.2.10 276 | [CL1.2.9]: http://www.cacti.net/release_notes.php?version=1.2.9 277 | [CL1.2.8]: http://www.cacti.net/release_notes.php?version=1.2.8 278 | [CL1.2.7]: http://www.cacti.net/release_notes.php?version=1.2.7 279 | [CL1.2.6]: http://www.cacti.net/release_notes.php?version=1.2.6 280 | [CL1.2.5]: http://www.cacti.net/release_notes.php?version=1.2.5 281 | [CL1.2.4]: http://www.cacti.net/release_notes.php?version=1.2.4 282 | [CL1.2.3]: http://www.cacti.net/release_notes.php?version=1.2.3 283 | [CL1.2.2]: http://www.cacti.net/release_notes.php?version=1.2.2 284 | [CL1.2.1]: http://www.cacti.net/release_notes.php?version=1.2.1 285 | [CL1.2.0]: http://www.cacti.net/release_notes.php?version=1.2.0 286 | [cacti_changelog]: https://www.cacti.net/changelog.php 287 | [cacti_download]: http://www.cacti.net/downloads 288 | [spine_download]: http://www.cacti.net/downloads/spine 289 | [arch]: https://github.com/scline/docker-cacti/tree/master/docker-compose 290 | [docker_volume_help]: https://docs.docker.com/engine/tutorials/dockervolumes 291 | [cacti_forums]: http://forums.cacti.net 292 | [cws]: http://cacti.net 293 | -------------------------------------------------------------------------------- /backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script is to backup cacti files and settings. This will store files in /backups on the container and will store the following in a compressed file 4 | # - Cacti SQL Database 5 | # - Cacti Plugins 6 | # - Cacti RRD files, the graphs that make it all pretty :) 7 | 8 | echo "$(date +%F_%R) [Backup] Prepping workspace for backup." 9 | rm -rf /tmp/backup 10 | mkdir /tmp/backup 11 | 12 | # write note in cacti.log that a backup has started 13 | echo "$(date +%F_%R) [Backup] Cacti Backup Started!" >> /cacti/log/cacti.log 14 | 15 | # copy files for processing 16 | echo "$(date +%F_%R) [Backup] Cloning /cacti to temporary directory." 17 | cp -a /cacti /tmp/backup/ 18 | echo "$(date +%F_%R) [Backup] Cloning /spine to temporary directory." 19 | cp -a /spine /tmp/backup/ 20 | 21 | # mysqldump cacti.sql 22 | echo "$(date +%F_%R) [Backup] Performing a mysqldump of database ${DB_NAME} from host ${DB_HOST}." 23 | mysqldump -h ${DB_HOST} -u${DB_USER} -p${DB_PASS} ${DB_NAME} > /tmp/backup/cacti/cactibackup.sql 24 | 25 | # compress all the things 26 | echo "$(date +%F_%R) [Backup] Compressing backup files." 27 | tar -zcf $(date +%Y%m%d_%H%M%S)_cactibackup.tar.gz -C /tmp/backup/ . > /dev/null 2>&1 28 | 29 | # make sure backups directory exists, if not make it 30 | if [ ! -d "/backups" ]; then 31 | echo "$(date +%F_%R) [Backup] Backups directory does not exists, creating new one." 32 | mkdir /backups 33 | fi 34 | 35 | # move compressed backup file to /backups directory 36 | echo "$(date +%F_%R) [Backup] Moving backup files to /backups." 37 | mv *_cactibackup.tar.gz /backups 38 | 39 | # remove temporary backup workspace 40 | echo "$(date +%F_%R) [Backup] Cleaning up temporary files." 41 | rm -rf /tmp/backup 42 | 43 | # only keep X number of backups, env variable BACKUP_RETENTION passed by docker 44 | echo "$(date +%F_%R) [Backup] Removing backup files if more then ${BACKUP_RETENTION} files are present." 45 | 46 | # adding 1 to BACKUP_RETENTION for delete statement to work correctly, then remove any additional 47 | x=$((${BACKUP_RETENTION}+1)) 48 | rm -f $(ls -1t /backups/*_cactibackup.tar.gz | tail -n +$x) 49 | 50 | # write note in cacti.log that a backup is complete 51 | echo "$(date +%F_%R) [Backup] Cacti Backup Complete!" >> /cacti/log/cacti.log 52 | 53 | echo "$(date +%F_%R) [Backup] Complete!" 54 | -------------------------------------------------------------------------------- /cacti/cacti-1.2.25.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scline/docker-cacti/2b340ec18475163a5772fdf5c1b3b8e24a9ab721/cacti/cacti-1.2.25.tar.gz -------------------------------------------------------------------------------- /cacti/cacti-spine-1.2.25.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scline/docker-cacti/2b340ec18475163a5772fdf5c1b3b8e24a9ab721/cacti/cacti-spine-1.2.25.tar.gz -------------------------------------------------------------------------------- /configs/cacti.conf: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /cacti 3 | Alias /cacti /cacti 4 | RedirectMatch ^/$ /cacti 5 | 6 | Require all granted 7 | 8 | 9 | 10 | 11 | 12 | DocumentRoot /cacti 13 | Alias /cacti /cacti 14 | RedirectMatch ^/$ /cacti 15 | 16 | Require all granted 17 | 18 | SSLEngine On 19 | SSLCertificateFile /etc/ssl/certs/cacti.crt 20 | SSLCertificateKeyFile /etc/ssl/certs/cacti.key 21 | 22 | -------------------------------------------------------------------------------- /configs/config.php: -------------------------------------------------------------------------------- 1 | /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /configs/snmpd.conf: -------------------------------------------------------------------------------- 1 | snmpd.conf -------------------------------------------------------------------------------- /configs/spine.conf: -------------------------------------------------------------------------------- 1 | # +-------------------------------------------------------------------------+ 2 | # | Copyright (C) 2004-2019 The Cacti Group | 3 | # | | 4 | # | This program is free software; you can redistribute it and/or | 5 | # | modify it under the terms of the GNU Lesser General Public License | 6 | # | as published by the Free Software Foundation; either version 2.1 | 7 | # | of the License, or (at your option) any later version. | 8 | # | | 9 | # | This program is distributed in the hope that it will be useful, | 10 | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | # | GNU General Public License for more details. | 13 | # +-------------------------------------------------------------------------+ 14 | # | spine: a backend data gatherer for Cacti | 15 | # +-------------------------------------------------------------------------+ 16 | # | This poller would not have been possible without: | 17 | # | - Larry Adams (current development and enhancements) | 18 | # | - Rivo Nurges (rrd support, mysql poller cache, misc functions) | 19 | # | - RTG (core poller code, pthreads, snmp, autoconf examples) | 20 | # | - Brady Alleman/Doug Warner (threading ideas, implimentation details) | 21 | # +-------------------------------------------------------------------------+ 22 | # | Settings | 23 | # +-------------------------------------------------------------------------+ 24 | # | DB_Host 'localhost' or socket file for UNIX/Linux | 25 | # | IP Address for Windows | 26 | # | DB_Database Database name, typically 'cacti' | 27 | # | DB_Port The database port to use | 28 | # | DB_User The user to access the database, typically 'cactiuser' | 29 | # | DB_Pass The password for the Cacti user | 30 | # | SNMP_Clientaddr Bind SNMP to a specific address for sites that use | 31 | # | higher security levels | 32 | # | Cacti_Log Optional path to the Cacti log file | 33 | # +-------------------------------------------------------------------------+ 34 | # | Settings for Remote Polling | 35 | # +-------------------------------------------------------------------------+ 36 | # | RDB_Host The remote database hostname. | 37 | # | RDB_Database The remote database name, typically 'cacti' | 38 | # | RDB_Port The remote database port to use | 39 | # | RDB_User The remote database user, typically 'cactiuser' | 40 | # | RDB_Pass The remote database password. | 41 | # +-------------------------------------------------------------------------+ 42 | 43 | DB_Host %DB_HOST% 44 | DB_Database %DB_NAME% 45 | DB_User %DB_USER% 46 | DB_Pass %DB_PASS% 47 | DB_Port %DB_PORT% 48 | #DB_UseSSL 0 49 | #DB_SSL_Key 50 | #DB_SSL_Cert 51 | #DB_SSL_CA 52 | 53 | Cacti_Log /cacti/log/cacti.log 54 | 55 | RDB_Host %RDB_HOST% 56 | RDB_Database %RDB_NAME% 57 | RDB_User %RDB_USER% 58 | RDB_Pass %RDB_PASS% 59 | RDB_Port %RDB_PORT% 60 | #RDB_UseSSL 0 61 | #RDB_SSL_Key 62 | #RDB_SSL_Cert 63 | #RDB_SSL_CA -------------------------------------------------------------------------------- /docker-compose/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Docker Cacti Architecture 3 | ----------------------------------------------------------------------------- 4 | 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. 5 | 6 | 7 | ### Single Instance - cacti_single_install.yml 8 | This is likely the most common example to deploy a cacti instance. This is not using any external pollers and is self-contained on one server. There are two separate docker containers, one for the cacti service and another for the MySQL based database. The example docker-compose file will have cacti setup a new database during the initial installation. This takes about 5-10 minutes on first boot before the web UI would be available, after the initial setup the service is up within 15 seconds. 9 | 10 | ![Alt text](https://github.com/scline/docker-cacti/blob/master/document_images/single_host.png?raw=true "Single Host") 11 | 12 | *docker-compose.yml* 13 | ``` 14 | version: '3.5' 15 | services: 16 | 17 | 18 | cacti: 19 | image: "smcline06/cacti" 20 | container_name: cacti 21 | domainname: example.com 22 | hostname: cacti 23 | ports: 24 | - "80:80" 25 | - "443:443" 26 | environment: 27 | - DB_NAME=cacti_master 28 | - DB_USER=cactiuser 29 | - DB_PASS=cactipassword 30 | - DB_HOST=db 31 | - DB_PORT=3306 32 | - DB_ROOT_PASS=rootpassword 33 | - INITIALIZE_DB=1 34 | - TZ=America/Los_Angeles 35 | volumes: 36 | - cacti-data:/cacti 37 | - cacti-spine:/spine 38 | - cacti-backups:/backups 39 | links: 40 | - db 41 | 42 | 43 | db: 44 | image: "mariadb:10.3" 45 | container_name: cacti_db 46 | domainname: example.com 47 | hostname: db 48 | ports: 49 | - "3306:3306" 50 | command: 51 | - mysqld 52 | - --character-set-server=utf8mb4 53 | - --collation-server=utf8mb4_unicode_ci 54 | - --max_connections=200 55 | - --max_heap_table_size=128M 56 | - --max_allowed_packet=32M 57 | - --tmp_table_size=128M 58 | - --join_buffer_size=128M 59 | - --innodb_buffer_pool_size=1G 60 | - --innodb_doublewrite=ON 61 | - --innodb_flush_log_at_timeout=3 62 | - --innodb_read_io_threads=32 63 | - --innodb_write_io_threads=16 64 | - --innodb_buffer_pool_instances=9 65 | - --innodb_file_format=Barracuda 66 | - --innodb_large_prefix=1 67 | - --innodb_io_capacity=5000 68 | - --innodb_io_capacity_max=10000 69 | environment: 70 | - MYSQL_ROOT_PASSWORD=rootpassword 71 | - TZ=America/Los_Angeles 72 | volumes: 73 | - cacti-db:/var/lib/mysql 74 | 75 | 76 | volumes: 77 | cacti-db: 78 | cacti-data: 79 | cacti-spine: 80 | cacti-backups: 81 | ``` 82 | 83 | ### Single DB, Multi Node - cacti_multi_shared.yml 84 | This instance would most likely be used if multiple servers are in close (same network/cluster) and uptime is not an issue. One or more remote pollers hang off a beefy master-cacti instance. All cacti databases need to be named differently for this to work, also note that due to how spine + boost work the database instance will utilize a bit of ram (~1-4GB per remote poller) and settings should be tweaked in this example to reflect this. This setup would be favorable if CPU becomes a bottleneck on one or many servers. Adding remote pollers can offset the load greatly. RDD files don't appear to be stored on remote systems. 85 | 86 | ![Alt text](https://github.com/scline/docker-cacti/blob/master/document_images/single_db.png?raw=true "Single DB, Multiple Hosts") 87 | 88 | *docker-compose.yml (Server 01)* 89 | ``` 90 | version: '3.5' 91 | services: 92 | 93 | 94 | cacti-master: 95 | image: "smcline06/cacti" 96 | container_name: cacti_master 97 | domainname: example.com 98 | hostname: cactimaster 99 | depends_on: 100 | - db 101 | ports: 102 | - "80:80" 103 | - "443:443" 104 | environment: 105 | - DB_NAME=cacti_master 106 | - DB_USER=cactiuser 107 | - DB_PASS=cactipassword 108 | - DB_HOST=db 109 | - DB_PORT=3306 110 | - DB_ROOT_PASS=rootpassword 111 | - INITIALIZE_DB=1 112 | - TZ=America/Los_Angeles 113 | volumes: 114 | - cacti-master-data:/cacti 115 | - cacti-master-spine:/spine 116 | - cacti-master-backups:/backups 117 | links: 118 | - db 119 | 120 | 121 | db: 122 | image: "mariadb:10.3" 123 | container_name: cacti_db 124 | domainname: example.com 125 | hostname: db 126 | ports: 127 | - "3306:3306" 128 | command: 129 | - mysqld 130 | - --character-set-server=utf8mb4 131 | - --collation-server=utf8mb4_unicode_ci 132 | - --max_connections=200 133 | - --max_heap_table_size=128M 134 | - --max_allowed_packet=32M 135 | - --tmp_table_size=128M 136 | - --join_buffer_size=128M 137 | - --innodb_buffer_pool_size=1G 138 | - --innodb_doublewrite=ON 139 | - --innodb_flush_log_at_timeout=3 140 | - --innodb_read_io_threads=32 141 | - --innodb_write_io_threads=16 142 | - --innodb_buffer_pool_instances=9 143 | - --innodb_file_format=Barracuda 144 | - --innodb_large_prefix=1 145 | - --innodb_io_capacity=5000 146 | - --innodb_io_capacity_max=10000 147 | environment: 148 | - MYSQL_ROOT_PASSWORD=rootpassword 149 | - TZ=America/Los_Angeles 150 | volumes: 151 | - cacti-db:/var/lib/mysql 152 | 153 | 154 | volumes: 155 | cacti-db: 156 | cacti-master-data: 157 | cacti-master-spine: 158 | cacti-master-backups: 159 | ``` 160 | 161 | *docker-compose.yml (Server 02)* 162 | ``` 163 | version: '3.5' 164 | services: 165 | 166 | 167 | cacti-poller: 168 | image: "smcline06/cacti" 169 | container_name: cacti_poller 170 | domainname: example.com 171 | hostname: cactipoller 172 | ports: 173 | - "8080:80" 174 | - "8443:443" 175 | environment: 176 | - DB_NAME=cacti_poller 177 | - DB_USER=cactipolleruser 178 | - DB_PASS=cactipollerpassword 179 | - DB_HOST= 180 | - DB_PORT=3306 181 | - RDB_NAME=cacti_master 182 | - RDB_USER=cactiuser 183 | - RDB_PASS=cactipassword 184 | - RDB_HOST=db 185 | - RDB_PORT=3306 186 | - DB_ROOT_PASS=rootpassword 187 | - REMOTE_POLLER=1 188 | - INITIALIZE_DB=1 189 | - TZ=America/Los_Angeles 190 | volumes: 191 | - cacti-poller-data:/cacti 192 | - cacti-poller-spine:/spine 193 | - cacti-poller-backups:/backups 194 | 195 | 196 | volumes: 197 | cacti-poller-data: 198 | cacti-poller-spine: 199 | cacti-poller-backups: 200 | ``` 201 | 202 | ### Multi DB, Multi Node - cacti_multi.yml 203 | Likely used for large deployments or where multiple locations/datacenters are at play. One master server for settings and a single window into all monitoring while pollers in remote locations gather information and feed it back home. The limiting factor will be latency or disk IO on the master database since pollers will write data directly to it when gathering SNMP/scripts. RDD files don't appear to be stored on remote systems. 204 | 205 | ![Alt text](https://github.com/scline/docker-cacti/blob/master/document_images/multi_host.png?raw=true "Multiple Hosts and DB") 206 | 207 | *docker-compose.yml (Server 01)* 208 | ``` 209 | version: '3.5' 210 | services: 211 | 212 | 213 | cacti-master: 214 | image: "smcline06/cacti" 215 | container_name: cacti_master 216 | domainname: example.com 217 | hostname: cactimaster 218 | depends_on: 219 | - db-master 220 | ports: 221 | - "80:80" 222 | - "443:443" 223 | environment: 224 | - DB_NAME=cacti_master 225 | - DB_USER=cactiuser 226 | - DB_PASS=cactipassword 227 | - DB_HOST=db-master 228 | - DB_PORT=3306 229 | - DB_ROOT_PASS=rootpassword 230 | - INITIALIZE_DB=1 231 | - TZ=America/Los_Angeles 232 | volumes: 233 | - cacti-master-data:/cacti 234 | - cacti-master-spine:/spine 235 | - cacti-master-backups:/backups 236 | links: 237 | - db-master 238 | 239 | 240 | db-master: 241 | image: "percona:5.7.14" 242 | container_name: cacti_master_db 243 | domainname: example.com 244 | hostname: db-master 245 | ports: 246 | - "3306:3306" 247 | command: 248 | - mysqld 249 | - --character-set-server=utf8mb4 250 | - --collation-server=utf8mb4_unicode_ci 251 | - --max_connections=200 252 | - --max_heap_table_size=128M 253 | - --max_allowed_packet=32M 254 | - --tmp_table_size=128M 255 | - --join_buffer_size=128M 256 | - --innodb_buffer_pool_size=1G 257 | - --innodb_doublewrite=ON 258 | - --innodb_flush_log_at_timeout=3 259 | - --innodb_read_io_threads=32 260 | - --innodb_write_io_threads=16 261 | - --innodb_buffer_pool_instances=9 262 | - --innodb_file_format=Barracuda 263 | - --innodb_large_prefix=1 264 | - --innodb_io_capacity=5000 265 | - --innodb_io_capacity_max=10000 266 | environment: 267 | - MYSQL_ROOT_PASSWORD=rootpassword 268 | - TZ=America/Los_Angeles 269 | volumes: 270 | - cacti-db-master:/var/lib/mysql 271 | 272 | 273 | volumes: 274 | cacti-db-master: 275 | cacti-master-data: 276 | cacti-master-spine: 277 | cacti-master-backups: 278 | 279 | ``` 280 | 281 | *docker-compose.yml (Server 02)* 282 | ``` 283 | version: '3.5' 284 | services: 285 | 286 | 287 | cacti-poller: 288 | image: "smcline06/cacti" 289 | container_name: cacti_poller 290 | domainname: example.com 291 | hostname: cactipoller 292 | depends_on: 293 | - db-poller 294 | ports: 295 | - "8080:80" 296 | - "8443:443" 297 | environment: 298 | - DB_NAME=cacti_poller 299 | - DB_USER=cactiuser 300 | - DB_PASS=cactipassword 301 | - DB_HOST=db-poller 302 | - DB_PORT=3306 303 | - RDB_NAME=cacti_master 304 | - RDB_USER=cactiuser 305 | - RDB_PASS=cactipassword 306 | - RDB_HOST= 307 | - RDB_PORT=3306 308 | - DB_ROOT_PASS=rootpassword 309 | - REMOTE_POLLER=1 310 | - INITIALIZE_DB=1 311 | - TZ=America/Los_Angeles 312 | volumes: 313 | - cacti-poller-data:/cacti 314 | - cacti-poller-spine:/spine 315 | - cacti-poller-backups:/backups 316 | links: 317 | - db-poller 318 | 319 | 320 | db-poller: 321 | image: "mariadb:10.3" 322 | container_name: cacti_poller+db 323 | domainname: example.com 324 | hostname: db-poller 325 | command: 326 | - mysqld 327 | - --character-set-server=utf8mb4 328 | - --collation-server=utf8mb4_unicode_ci 329 | - --max_connections=200 330 | - --max_heap_table_size=128M 331 | - --max_allowed_packet=32M 332 | - --tmp_table_size=128M 333 | - --join_buffer_size=128M 334 | - --innodb_buffer_pool_size=1G 335 | - --innodb_doublewrite=ON 336 | - --innodb_flush_log_at_timeout=3 337 | - --innodb_read_io_threads=32 338 | - --innodb_write_io_threads=16 339 | - --innodb_buffer_pool_instances=9 340 | - --innodb_file_format=Barracuda 341 | - --innodb_large_prefix=1 342 | - --innodb_io_capacity=5000 343 | - --innodb_io_capacity_max=10000 344 | environment: 345 | - MYSQL_ROOT_PASSWORD=rootpassword 346 | - TZ=America/Los_Angeles 347 | volumes: 348 | - cacti-db-poller:/var/lib/mysql 349 | 350 | 351 | volumes: 352 | cacti-db-poller: 353 | cacti-poller-data: 354 | cacti-poller-spine: 355 | cacti-poller-backups: 356 | 357 | ``` 358 | -------------------------------------------------------------------------------- /docker-compose/cacti_multi.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | 4 | 5 | cacti-master: 6 | image: "smcline06/cacti" 7 | container_name: cacti_master 8 | domainname: example.com 9 | hostname: cactimaster 10 | depends_on: 11 | - db-master 12 | ports: 13 | - "80:80" 14 | - "443:443" 15 | environment: 16 | - DB_NAME=cacti_master 17 | - DB_USER=cactiuser 18 | - DB_PASS=cactipassword 19 | - DB_HOST=db-master 20 | - DB_PORT=3306 21 | - DB_ROOT_PASS=rootpassword 22 | - INITIALIZE_DB=1 23 | - TZ=America/Los_Angeles 24 | volumes: 25 | - cacti-master-data:/cacti 26 | - cacti-master-spine:/spine 27 | - cacti-master-backups:/backups 28 | links: 29 | - db-master 30 | 31 | 32 | cacti-poller: 33 | image: "smcline06/cacti" 34 | container_name: cacti_poller 35 | domainname: example.com 36 | hostname: cactipoller 37 | depends_on: 38 | - db-poller 39 | ports: 40 | - "8080:80" 41 | - "8443:443" 42 | environment: 43 | - DB_NAME=cacti_poller 44 | - DB_USER=cactiuser 45 | - DB_PASS=cactipassword 46 | - DB_HOST=db-poller 47 | - DB_PORT=3306 48 | - RDB_NAME=cacti_master 49 | - RDB_USER=cactiuser 50 | - RDB_PASS=cactipassword 51 | - RDB_HOST=db-master 52 | - RDB_PORT=3306 53 | - DB_ROOT_PASS=rootpassword 54 | - REMOTE_POLLER=1 55 | - INITIALIZE_DB=1 56 | - TZ=America/Los_Angeles 57 | volumes: 58 | - cacti-poller-data:/cacti 59 | - cacti-poller-spine:/spine 60 | - cacti-poller-backups:/backups 61 | links: 62 | - db-poller 63 | 64 | 65 | db-master: 66 | image: "percona:5.7.14" 67 | container_name: cacti_master_db 68 | domainname: example.com 69 | hostname: db-master 70 | ports: 71 | - "3306:3306" 72 | command: 73 | - mysqld 74 | - --character-set-server=utf8mb4 75 | - --collation-server=utf8mb4_unicode_ci 76 | - --max_connections=200 77 | - --max_heap_table_size=128M 78 | - --max_allowed_packet=32M 79 | - --tmp_table_size=128M 80 | - --join_buffer_size=128M 81 | - --innodb_buffer_pool_size=1G 82 | - --innodb_doublewrite=ON 83 | - --innodb_flush_log_at_timeout=3 84 | - --innodb_read_io_threads=32 85 | - --innodb_write_io_threads=16 86 | - --innodb_buffer_pool_instances=9 87 | - --innodb_file_format=Barracuda 88 | - --innodb_large_prefix=1 89 | - --innodb_io_capacity=5000 90 | - --innodb_io_capacity_max=10000 91 | environment: 92 | - MYSQL_ROOT_PASSWORD=rootpassword 93 | - TZ=America/Los_Angeles 94 | volumes: 95 | - cacti-db-master:/var/lib/mysql 96 | 97 | 98 | db-poller: 99 | image: "mariadb:10.3" 100 | container_name: cacti_poller+db 101 | domainname: example.com 102 | hostname: db-poller 103 | command: 104 | - mysqld 105 | - --character-set-server=utf8mb4 106 | - --collation-server=utf8mb4_unicode_ci 107 | - --max_connections=200 108 | - --max_heap_table_size=128M 109 | - --max_allowed_packet=32M 110 | - --tmp_table_size=128M 111 | - --join_buffer_size=128M 112 | - --innodb_buffer_pool_size=1G 113 | - --innodb_doublewrite=ON 114 | - --innodb_flush_log_at_timeout=3 115 | - --innodb_read_io_threads=32 116 | - --innodb_write_io_threads=16 117 | - --innodb_buffer_pool_instances=9 118 | - --innodb_file_format=Barracuda 119 | - --innodb_large_prefix=1 120 | - --innodb_io_capacity=5000 121 | - --innodb_io_capacity_max=10000 122 | environment: 123 | - MYSQL_ROOT_PASSWORD=rootpassword 124 | - TZ=America/Los_Angeles 125 | volumes: 126 | - cacti-db-poller:/var/lib/mysql 127 | 128 | 129 | volumes: 130 | cacti-db-master: 131 | cacti-db-poller: 132 | cacti-master-data: 133 | cacti-master-spine: 134 | cacti-master-backups: 135 | cacti-poller-data: 136 | cacti-poller-spine: 137 | cacti-poller-backups: 138 | -------------------------------------------------------------------------------- /docker-compose/cacti_multi_shared.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | 4 | 5 | cacti-master: 6 | image: "smcline06/cacti" 7 | container_name: cacti_master 8 | domainname: example.com 9 | hostname: cactimaster 10 | depends_on: 11 | - db 12 | ports: 13 | - "80:80" 14 | - "443:443" 15 | environment: 16 | - DB_NAME=cacti_master 17 | - DB_USER=cactiuser 18 | - DB_PASS=cactipassword 19 | - DB_HOST=db 20 | - DB_PORT=3306 21 | - DB_ROOT_PASS=rootpassword 22 | - INITIALIZE_DB=1 23 | - TZ=America/Los_Angeles 24 | volumes: 25 | - cacti-master-data:/cacti 26 | - cacti-master-spine:/spine 27 | - cacti-master-backups:/backups 28 | links: 29 | - db 30 | 31 | 32 | cacti-poller: 33 | image: "smcline06/cacti" 34 | container_name: cacti_poller 35 | domainname: example.com 36 | hostname: cactipoller 37 | depends_on: 38 | - db 39 | ports: 40 | - "8080:80" 41 | - "8443:443" 42 | environment: 43 | - DB_NAME=cacti_poller 44 | - DB_USER=cactipolleruser 45 | - DB_PASS=cactipollerpassword 46 | - DB_HOST=db 47 | - DB_PORT=3306 48 | - RDB_NAME=cacti_master 49 | - RDB_USER=cactiuser 50 | - RDB_PASS=cactipassword 51 | - RDB_HOST=db 52 | - RDB_PORT=3306 53 | - DB_ROOT_PASS=rootpassword 54 | - REMOTE_POLLER=1 55 | - INITIALIZE_DB=1 56 | - TZ=America/Los_Angeles 57 | volumes: 58 | - cacti-poller-data:/cacti 59 | - cacti-poller-spine:/spine 60 | - cacti-poller-backups:/backups 61 | links: 62 | - db 63 | 64 | 65 | db: 66 | image: "mariadb:10.3" 67 | container_name: cacti_db 68 | domainname: example.com 69 | hostname: db 70 | ports: 71 | - "3306:3306" 72 | command: 73 | - mysqld 74 | - --character-set-server=utf8mb4 75 | - --collation-server=utf8mb4_unicode_ci 76 | - --max_connections=200 77 | - --max_heap_table_size=128M 78 | - --max_allowed_packet=32M 79 | - --tmp_table_size=128M 80 | - --join_buffer_size=128M 81 | - --innodb_buffer_pool_size=1G 82 | - --innodb_doublewrite=ON 83 | - --innodb_flush_log_at_timeout=3 84 | - --innodb_read_io_threads=32 85 | - --innodb_write_io_threads=16 86 | - --innodb_buffer_pool_instances=9 87 | - --innodb_file_format=Barracuda 88 | - --innodb_large_prefix=1 89 | - --innodb_io_capacity=5000 90 | - --innodb_io_capacity_max=10000 91 | environment: 92 | - MYSQL_ROOT_PASSWORD=rootpassword 93 | - TZ=America/Los_Angeles 94 | volumes: 95 | - cacti-db:/var/lib/mysql 96 | 97 | 98 | volumes: 99 | cacti-db: 100 | cacti-master-data: 101 | cacti-master-spine: 102 | cacti-master-backups: 103 | cacti-poller-data: 104 | cacti-poller-spine: 105 | cacti-poller-backups: 106 | -------------------------------------------------------------------------------- /docker-compose/cacti_single_install.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | 4 | 5 | cacti: 6 | image: "smcline06/cacti" 7 | container_name: cacti 8 | domainname: example.com 9 | hostname: cacti 10 | ports: 11 | - "80:80" 12 | - "443:443" 13 | environment: 14 | - DB_NAME=cacti_master 15 | - DB_USER=cactiuser 16 | - DB_PASS=cactipassword 17 | - DB_HOST=db 18 | - DB_PORT=3306 19 | - DB_ROOT_PASS=rootpassword 20 | - INITIALIZE_DB=1 21 | - TZ=America/Los_Angeles 22 | volumes: 23 | - cacti-data:/cacti 24 | - cacti-spine:/spine 25 | - cacti-backups:/backups 26 | links: 27 | - db 28 | 29 | 30 | db: 31 | image: "mariadb:10.3" 32 | container_name: cacti_db 33 | domainname: example.com 34 | hostname: db 35 | ports: 36 | - "3306:3306" 37 | command: 38 | - mysqld 39 | - --character-set-server=utf8mb4 40 | - --collation-server=utf8mb4_unicode_ci 41 | - --max_connections=200 42 | - --max_heap_table_size=128M 43 | - --max_allowed_packet=32M 44 | - --tmp_table_size=128M 45 | - --join_buffer_size=128M 46 | - --innodb_buffer_pool_size=1G 47 | - --innodb_doublewrite=ON 48 | - --innodb_flush_log_at_timeout=3 49 | - --innodb_read_io_threads=32 50 | - --innodb_write_io_threads=16 51 | - --innodb_buffer_pool_instances=9 52 | - --innodb_file_format=Barracuda 53 | - --innodb_large_prefix=1 54 | - --innodb_io_capacity=5000 55 | - --innodb_io_capacity_max=10000 56 | environment: 57 | - MYSQL_ROOT_PASSWORD=rootpassword 58 | - TZ=America/Los_Angeles 59 | volumes: 60 | - cacti-db:/var/lib/mysql 61 | 62 | 63 | volumes: 64 | cacti-db: 65 | cacti-data: 66 | cacti-spine: 67 | cacti-backups: -------------------------------------------------------------------------------- /docker-compose/cacti_testing.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | services: 3 | 4 | 5 | cacti: 6 | build: 7 | context: . 8 | dockerfile: Dockerfile 9 | container_name: cacti_master 10 | domainname: example.com 11 | hostname: cactimaster 12 | depends_on: 13 | - db 14 | ports: 15 | - "80:80" 16 | - "443:443" 17 | environment: 18 | - DB_NAME=cacti_master 19 | - DB_USER=cactiuser 20 | - DB_PASS=cactipassword 21 | - DB_HOST=db 22 | - DB_PORT=3306 23 | - DB_ROOT_PASS=rootpassword 24 | - INITIALIZE_DB=1 25 | - TZ=America/Los_Angeles 26 | volumes: 27 | - cacti-data:/cacti 28 | - cacti-spine:/spine 29 | - cacti-backups:/backups 30 | links: 31 | - db 32 | restart: always 33 | 34 | 35 | db: 36 | image: "mariadb:10.3" 37 | container_name: cacti_db 38 | ports: 39 | - "3306:3306" 40 | command: 41 | - mysqld 42 | - --character-set-server=utf8mb4 43 | - --collation-server=utf8mb4_unicode_ci 44 | - --max_connections=200 45 | - --max_heap_table_size=128M 46 | - --max_allowed_packet=32M 47 | - --tmp_table_size=128M 48 | - --join_buffer_size=128M 49 | - --innodb_buffer_pool_size=1G 50 | - --innodb_doublewrite=ON 51 | - --innodb_flush_log_at_timeout=3 52 | - --innodb_read_io_threads=32 53 | - --innodb_write_io_threads=16 54 | - --innodb_buffer_pool_instances=9 55 | - --innodb_file_format=Barracuda 56 | - --innodb_large_prefix=1 57 | - --innodb_io_capacity=5000 58 | - --innodb_io_capacity_max=10000 59 | environment: 60 | - MYSQL_ROOT_PASSWORD=rootpassword 61 | - TZ=America/Los_Angeles 62 | volumes: 63 | - cacti-db:/var/lib/mysql 64 | restart: always 65 | 66 | 67 | cacti_remote_poller01: 68 | build: 69 | context: . 70 | dockerfile: Dockerfile 71 | container_name: cacti_poller01 72 | domainname: example.com 73 | hostname: cactipoller01 74 | depends_on: 75 | - db 76 | ports: 77 | - "8080:80" 78 | - "8443:443" 79 | environment: 80 | - DB_NAME=cacti_poller 81 | - DB_USER=cactipolleruser 82 | - DB_PASS=cactipollerpassword 83 | - DB_HOST=db 84 | - DB_PORT=3306 85 | - RDB_NAME=cacti_master 86 | - RDB_USER=cactiuser 87 | - RDB_PASS=cactipassword 88 | - RDB_HOST=db 89 | - RDB_PORT=3306 90 | - DB_ROOT_PASS=rootpassword 91 | - REMOTE_POLLER=1 92 | - INITIALIZE_DB=1 93 | - TZ=America/Los_Angeles 94 | links: 95 | - db 96 | restart: always 97 | 98 | 99 | volumes: 100 | cacti-db: 101 | cacti-data: 102 | cacti-spine: 103 | cacti-backups: 104 | -------------------------------------------------------------------------------- /document_images/multi_host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scline/docker-cacti/2b340ec18475163a5772fdf5c1b3b8e24a9ab721/document_images/multi_host.png -------------------------------------------------------------------------------- /document_images/single_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scline/docker-cacti/2b340ec18475163a5772fdf5c1b3b8e24a9ab721/document_images/single_db.png -------------------------------------------------------------------------------- /document_images/single_host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scline/docker-cacti/2b340ec18475163a5772fdf5c1b3b8e24a9ab721/document_images/single_host.png -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # Place uncompressed plugins here for automatic installation at build. -------------------------------------------------------------------------------- /restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # script to restore a cacti backup 4 | # ./restore.sh 5 | 6 | # check if argument has dependencies 7 | if [ -z $1 ]; then 8 | echo "restore.sh " 9 | exit 2 10 | fi 11 | 12 | # create temp workspace 13 | echo "$(date +%F_%R) [Restore] Prepping workspace for restore." 14 | rm -rf /tmp/restore 15 | mkdir /tmp/restore 16 | 17 | # preflight checks 18 | # database availablity check - http://stackoverflow.com/questions/4922943/test-from-shell-script-if-remote-tcp-port-is-open 19 | while ! timeout 1 bash -c 'cat < /dev/null > /dev/tcp/${DB_HOST}/${DB_PORT}'; do sleep 3; done 20 | echo "$(date +%F_%R) [Restore] Database check ok! - DB located at ${DB_HOST}:${DB_PORT}." 21 | 22 | # unzip backup file to temp directory 23 | echo "$(date +%F_%R) [Restore] Decompressing backup file $1." 24 | tar -xzf $1 -C /tmp/restore 25 | 26 | # cleanup active Cacti /rra folder 27 | echo "$(date +%F_%R) [Restore] Cleaning up current active instance." 28 | rm -rf /cacti/* 29 | rm -rf /spine/* 30 | 31 | # move Cacti directory to /cacti 32 | echo "$(date +%F_%R) [Restore] Moving Cacti files..." 33 | mv -f /tmp/restore/cacti/* /cacti/ 34 | 35 | # move Spine directory to /spine 36 | echo "$(date +%F_%R) [Restore] Moving Spine files..." 37 | mv -f /tmp/restore/spine/* /spine/ 38 | 39 | # fixing permissions 40 | echo "$(date +%F_%R) [Restore] Setting cacti file permissions." 41 | chown -R apache.apache /cacti/resource/ 42 | chown -R apache.apache /cacti/cache/ 43 | chown -R apache.apache /cacti/log/ 44 | chown -R apache.apache /cacti/scripts/ 45 | chown -R apache.apache /cacti/rra/ 46 | touch /cacti/include/vendor/csrf/csrf-secret.php 47 | chmod 644 /cacti/include/vendor/csrf/csrf-secret.php 48 | chown apache.apache /cacti/include/vendor/csrf/csrf-secret.php 49 | 50 | # fresh install db merge 51 | echo "$(date +%F_%R) [Restore] Merging cactibackup.sql file to database." 52 | mysql -h ${DB_HOST} -u${DB_USER} -p${DB_PASS} ${DB_NAME} < /cacti/cactibackup.sql 53 | 54 | # be nice and clean up 55 | echo "$(date +%F_%R) [Restore] Removing temp files." 56 | rm -rf /tmp/restore 57 | 58 | # write note in cacti.log that a restore is complete 59 | echo "$(date +%F_%R) [Restore] Cacti Restore $1 Complete!" >> /cacti/log/cacti.log 60 | 61 | echo "$(date +%F_%R) [Restore] Restore from $1 Complete!" 62 | -------------------------------------------------------------------------------- /settings/boost.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Boost Settings 3 | -- 4 | 5 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_poller_mem_limit', '1024'); 6 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_redirect', 'on'); 7 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_enable', 'on'); 8 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_interval', '60'); 9 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_max_records', '1000000'); 10 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_max_records_per_select', '50000'); 11 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_max_runtime', '1200'); 12 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_string_length', '2000'); 13 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_string_length', '2000'); 14 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_rrd_update_system_enable', 'on'); 15 | 16 | -- Boost PNG cache settings 17 | -- REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_png_cache_enable', ''); 18 | -- REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('boost_png_cache_directory', '/cacti/cache/boost/'); -------------------------------------------------------------------------------- /settings/data_source_profiles.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Enable 1 minute polling data source profile 3 | -- 4 | 5 | REPLACE INTO `%DB_NAME%`.`data_source_profiles` (`id`,`hash`,`name`,`step`,`heartbeat`,`x_files_factor`,`default`) VALUES('4', 'bba8b254a188680cf53a7f6a75721e29','1 Minute Polling','60','120','0.5','on'); 6 | 7 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_cf` (`data_source_profile_id`,`consolidation_function_id`) VALUES('4','1'); 8 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_cf` (`data_source_profile_id`,`consolidation_function_id`) VALUES('4','2'); 9 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_cf` (`data_source_profile_id`,`consolidation_function_id`) VALUES('4','3'); 10 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_cf` (`data_source_profile_id`,`consolidation_function_id`) VALUES('4','4'); 11 | 12 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_rra` (`id`, `data_source_profile_id`,`name`,`steps`,`rows`) VALUES('10','4','Daily','1','1440'); 13 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_rra` (`id`, `data_source_profile_id`,`name`,`steps`,`rows`) VALUES('11','4','Weekly','1','10080'); 14 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_rra` (`id`, `data_source_profile_id`,`name`,`steps`,`rows`) VALUES('12','4','Monthly (5 minute avg)','5','8760'); 15 | REPLACE INTO `%DB_NAME%`.`data_source_profiles_rra` (`id`, `data_source_profile_id`,`name`,`steps`,`rows`) VALUES('13','4','Yearly (1 hour avg)','60','8760'); 16 | 17 | REPLACE INTO `%DB_NAME%`.`data_source_profiles` (`id`,`hash`,`name`,`step`,`heartbeat`,`x_files_factor`,`default`) VALUES('1','d62c52891f4f9688729a5bc9fad91b18','System Default','300','600','0.5',''); -------------------------------------------------------------------------------- /settings/poller.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Poller settings 3 | -- 4 | 5 | -- How often to poll data in seconds 6 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('poller_interval', '60'); 7 | 8 | -- How often the cronjob is set to run 9 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('cron_interval', '300'); 10 | 11 | -- The maximum threads allowed per process. Using a higher number when using Spine will improve performance. Required settings are 10-15. Values above 50 are most often insane and may degrade preformance 12 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('max_threads', '1'); 13 | 14 | -- Number of instances to run 15 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('concurrent_processes', '1'); -------------------------------------------------------------------------------- /settings/spine.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Enable spine poller from docker installation 3 | -- 4 | 5 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine', '/spine/bin/spine'); 6 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('path_spine_config', '/spine/etc/spine.conf'); 7 | REPLACE INTO `%DB_NAME%`.`settings` (`name`, `value`) VALUES('poller_type', '2'); -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DB_PORT=${DB_PORT:-3306} 4 | 5 | # set server timezone 6 | echo "$(date +%F_%R) [Note] Setting server timezone settings to '${TZ}'" 7 | echo "date.timezone = ${TZ}" >> /etc/php.ini 8 | 9 | # set custom php.ini enviorments to follow Cacti Recommendations requirment 10 | sed -i "s/^\(memory_limit =\).*/\1 ${PHP_MEMORY_LIMIT}/" /etc/php.ini 11 | sed -i "s/^\(max_execution_time =\).*/\1 ${PHP_MAX_EXECUTION_TIME}/" /etc/php.ini 12 | 13 | if [ ! -z "${TZ}" ]; then 14 | rm /etc/localtime 15 | ln -s /usr/share/zoneinfo/${TZ} /etc/localtime 16 | else 17 | echo "Using default timezone since TZ is unset." 18 | fi 19 | 20 | # remove php-snmp if asked, required for snmpv3 to function correctly. Disabled by default 21 | if [ ${PHP_SNMP} = 0 ]; then 22 | echo "$(date +%F_%R) [PHP-SNMP] Removing php-snmp since ENV variable 'PHP_SNMP' is set to 0" 23 | yum remove -y --noautoremove php-snmp 24 | yum clean all 25 | else 26 | echo "$(date +%F_%R) [PHP-SNMP] Insalling php-snmp since ENV variable 'PHP_SNMP' is set to 1" 27 | yum install -y php-snmp 28 | yum clean all 29 | fi 30 | 31 | # verify if initial install steps are required, if lock file does not exist run the following 32 | if [ ! -f /cacti/install.lock ]; then 33 | echo "$(date +%F_%R) [New Install] Lock file does not exist - new install." 34 | 35 | # THIS WAS IN DOCKER-FILE 36 | # CACTI BASE INSTALL 37 | echo "$(date +%F_%R) [New Install] Extracting and installing Cacti files to /cacti." 38 | tar -xf /cacti_install/cacti-latest*.tar.gz -C /tmp 39 | mv /tmp/cacti-1*/* /cacti/ 40 | 41 | # SPINE BASE INSTALL 42 | echo "$(date +%F_%R) [New Install] Extracting and installing Spine files to /spine." 43 | tar -xf /cacti_install/cacti-spine-*.tar.gz -C /tmp 44 | cd /tmp/cacti-spine-* && \ 45 | ./bootstrap && \ 46 | ./configure --prefix=/spine && make && make install && \ 47 | chown root:root /spine/bin/spine && \ 48 | chmod +s /spine/bin/spine 49 | 50 | # BASE CONFIGS 51 | echo "$(date +%F_%R) [New Install] Copying templated configurations to Spine, Apache, and Cacti." 52 | cp /template_configs/spine.conf /spine/etc 53 | cp /template_configs/cacti.conf /etc/httpd/conf.d 54 | cp /template_configs/config.php /cacti/include 55 | 56 | # update cacti url path config, requested via https://github.com/scline/docker-cacti/issues/73 57 | echo "$(date +%F_%R) [New Install] Applying cacti URL enviromental variable to /etc/httpd/conf.d/cacti.conf" 58 | sed -i -e "s/Alias.*/ Alias \/${CACTI_URL_PATH} \/cacti/" \ 59 | -e "s/RedirectMatch.*/ RedirectMatch \^\/\$ \/${CACTI_URL_PATH}/" \ 60 | /etc/httpd/conf.d/cacti.conf 61 | 62 | # setup database credential settings 63 | echo "$(date +%F_%R) [New Install] Applying enviromental variables to configurations." 64 | sed -i -e "s/%DB_HOST%/${DB_HOST}/" \ 65 | -e "s/%DB_PORT%/${DB_PORT}/" \ 66 | -e "s/%DB_NAME%/${DB_NAME}/" \ 67 | -e "s/%DB_USER%/${DB_USER}/" \ 68 | -e "s/%DB_PASS%/${DB_PASS}/" \ 69 | -e "s/%DB_PORT%/${DB_PORT}/" \ 70 | -e "s/%RDB_HOST%/${RDB_HOST}/" \ 71 | -e "s/%RDB_PORT%/${RDB_PORT}/" \ 72 | -e "s/%RDB_NAME%/${RDB_NAME}/" \ 73 | -e "s/%RDB_USER%/${RDB_USER}/" \ 74 | -e "s/%RDB_PASS%/${RDB_PASS}/" \ 75 | -e "s/%CACTI_URL_PATH%/${CACTI_URL_PATH}/" \ 76 | /cacti/include/config.php \ 77 | /settings/*.sql \ 78 | /spine/etc/spine.conf 79 | 80 | # wait for database to initialize - http://stackoverflow.com/questions/4922943/test-from-shell-script-if-remote-tcp-port-is-open 81 | echo "$(date +%F_%R) [New Install] Waiting for database to respond, if this hangs please check MySQL connections are allowed and functional." 82 | while ! timeout 1 bash -c 'cat < /dev/null > /dev/tcp/${DB_HOST}/${DB_PORT}'; do sleep 3; done 83 | echo "$(date +%F_%R) [New Install] Database is up! - configuring DB located at ${DB_HOST}:${DB_PORT} (this can take a few minutes)." 84 | 85 | # if docker was told to setup the database then perform the following 86 | if [ ${INITIALIZE_DB} = 1 ]; then 87 | echo "$(date +%F_%R) [New Install] Container has been instructed to create new Database on remote system." 88 | # initial database and user setup 89 | echo "$(date +%F_%R) [New Install] CREATE DATABASE ${DB_NAME} /*\!40100 DEFAULT CHARACTER SET utf8 */;" 90 | mysql -h ${DB_HOST} --port=${DB_PORT} -uroot -p${DB_ROOT_PASS} -e "CREATE DATABASE ${DB_NAME} /*\!40100 DEFAULT CHARACTER SET utf8 */;" 91 | # allow cacti user access to new database 92 | echo "$(date +%F_%R) [New Install] GRANT ALL ON ${DB_NAME}.* TO '${DB_USER}' IDENTIFIED BY '*******';" 93 | mysql -h ${DB_HOST} --port=${DB_PORT} -uroot -p${DB_ROOT_PASS} -e "GRANT ALL ON ${DB_NAME}.* TO '${DB_USER}' IDENTIFIED BY '${DB_PASS}';" 94 | # allow cacti user super access to new database (required to merge cacti.sql table) 95 | echo "$(date +%F_%R) [New Install] GRANT SUPER ON *.* TO '${DB_USER}'@'%';" 96 | mysql -h ${DB_HOST} --port=${DB_PORT} -uroot -p${DB_ROOT_PASS} -e "GRANT SUPER ON *.* TO '${DB_USER}'@'%';" 97 | # allow required access to mysql timezone table 98 | echo "$(date +%F_%R) [New Install] GRANT SELECT ON mysql.time_zone_name TO '${DB_USER}' IDENTIFIED BY '*******';" 99 | mysql -h ${DB_HOST} --port=${DB_PORT} -uroot -p${DB_ROOT_PASS} -e "GRANT SELECT ON mysql.time_zone_name TO '${DB_USER}' IDENTIFIED BY '${DB_PASS}';" 100 | fi 101 | 102 | # fresh install db merge 103 | echo "$(date +%F_%R) [New Install] Merging vanilla cacti.sql file to database." 104 | mysql -h ${DB_HOST} --port=${DB_PORT} -u${DB_USER} -p${DB_PASS} ${DB_NAME} < /cacti/cacti.sql 105 | 106 | # if this is a remote poller dont do anything with scripts/templates or plugins. This is sourced from the master instance 107 | if [ ${REMOTE_POLLER} != 1 ]; then 108 | echo "$(date +%F_%R) [New Install] Installing supporting template files." 109 | cp -r /templates/resource/* /cacti/resource 110 | cp -r /templates/scripts/* /cacti/scripts 111 | 112 | echo "$(date +%F_%R) [New Install] Installing plugins." 113 | cp -r /cacti_install/plugins/* /cacti/plugins 114 | 115 | # install additional templates 116 | for filename in /templates/*.xml; do 117 | echo "$(date +%F_%R) [New Install] Installing template file $filename" 118 | php -q /cacti/cli/import_template.php --filename=$filename > /dev/null 119 | done 120 | fi 121 | 122 | # install additional settings 123 | for filename in /settings/*.sql; do 124 | echo "$(date +%F_%R) [New Install] Importing settings file $filename" 125 | mysql -h ${DB_HOST} --port=${DB_PORT} -u${DB_USER} -p${DB_PASS} ${DB_NAME} < $filename 126 | done 127 | 128 | # CLEANUP 129 | echo "$(date +%F_%R) [New Install] Removing temp Cacti and Spine installation files." 130 | rm -rf /tmp/* 131 | 132 | # create lock file so this is not re-ran on restart 133 | touch /cacti/install.lock 134 | echo "$(date +%F_%R) [New Install] Creating lock file, db setup complete." 135 | fi 136 | 137 | # copy configuration files in the event /cacti is being shared as a volume 138 | echo "$(date +%F_%R) [Apache] Validating httpd cacti configuration is present." 139 | if [ -f "/etc/httpd/conf.d/cacti.conf" ]; then 140 | echo "$(date +%F_%R) [Apache] /etc/httpd/conf.d/cacti.conf exist, nothing to do." 141 | else 142 | echo "$(date +%F_%R) [Apache] /etc/httpd/conf.d/cacti.conf does not exist, copying a new one over." 143 | cp /template_configs/cacti.conf /etc/httpd/conf.d/ 144 | # update cacti url path config, requested via https://github.com/scline/docker-cacti/issues/73 145 | echo "$(date +%F_%R) [Apache] Applying cacti URL enviromental variable to /etc/httpd/conf.d/cacti.conf" 146 | sed -i -e "s/Alias.*/ Alias \/${CACTI_URL_PATH} \/cacti/" \ 147 | -e "s/RedirectMatch.*/ RedirectMatch \^\/\$ \/${CACTI_URL_PATH}/" \ 148 | /etc/httpd/conf.d/cacti.conf 149 | fi 150 | 151 | # only generate certs if none exsist, this way users can provide there own 152 | if [ ! -f /etc/ssl/certs/cacti.key ] || [ ! -f /etc/ssl/certs/cacti.crt ]; then 153 | # generate self-signed certs for basic https functionality. 154 | echo "$(date +%F_%R) [Apache] Missing HTTPS certs, generating self-signed one's." 155 | openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \ 156 | -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \ 157 | -keyout /etc/ssl/certs/cacti.key -out /etc/ssl/certs/cacti.crt 158 | else 159 | echo "$(date +%F_%R) [Apache] /etc/ssl/certs/cacti.key and /etc/ssl/certs/cacti.crt exist, nothing to do." 160 | fi 161 | 162 | # correcting file permissions 163 | echo "$(date +%F_%R) [Note] Setting cacti file permissions." 164 | chown -R apache.apache /cacti/resource/ 165 | chown -R apache.apache /cacti/cache/ 166 | chown -R apache.apache /cacti/log/ 167 | chown -R apache.apache /cacti/scripts/ 168 | chown -R apache.apache /cacti/rra/ 169 | touch /cacti/include/vendor/csrf/csrf-secret.php 170 | chmod 644 /cacti/include/vendor/csrf/csrf-secret.php 171 | chown apache.apache /cacti/include/vendor/csrf/csrf-secret.php 172 | 173 | # remote poller tasks 174 | if [ ${REMOTE_POLLER} = 1 ]; then 175 | echo "$(date +%F_%R) [Remote Poller] This is slated to be a remote poller, updating cacti configs for these settings." 176 | sed -i -e "s/#\$rdatabase/\$rdatabase/" /cacti/include/config.php 177 | echo "$(date +%F_%R) [Remote Poller] Updating permissions in cacti directory for remote poller template." 178 | chown -R apache.apache /cacti 179 | 180 | # fix remote poller install check from https://github.com/Cacti/cacti/issues/3459 181 | echo "$(date +%F_%R) [Remote Poller] Manual hack to fix https://github.com/Cacti/cacti/issues/3459" 182 | sed -i -e "s/print json_encode/return json_encode/g" /cacti/install/functions.php 183 | fi 184 | 185 | # backup cron tasks 186 | if [ ${BACKUP_TIME} -gt 0 ]; then 187 | sed -i -e "s/%DB_HOST%/${DB_HOST}/" /var/spool/cron/apache 188 | fi 189 | 190 | # start cron service 191 | echo "$(date +%F_%R) [Note] Starting crond service." 192 | /usr/sbin/crond -n & 193 | 194 | # start snmp servics 195 | echo "$(date +%F_%R) [Note] Starting snmpd service." 196 | snmpd -Lf /var/log/snmpd.log & 197 | 198 | # start php-fpm 199 | echo "$(date +%F_%R) [Note] Starting php-fpm service." 200 | # make sure socket and pid files are all cleaned before starting 201 | mkdir /run/php-fpm 202 | rm -rf /run/php-fpm/* 203 | # change settings in php-fpm file due to https://github.com/scline/docker-cacti/issues/64 204 | sed -i -e "s/;listen.owner = nobody/listen.owner = apache/g" \ 205 | -e "s/;listen.group = nobody/listen.group = apache/g" \ 206 | -e "s/listen.acl_users = apache,nginx/;listen.acl_users = apache,nginx/g" \ 207 | /etc/php-fpm.d/www.conf 208 | php-fpm 209 | 210 | # start web service 211 | echo "$(date +%F_%R) [Note] Starting httpd service." 212 | rm -rf /run/httpd/httpd.pid 213 | httpd -DFOREGROUND 214 | -------------------------------------------------------------------------------- /templates/resource/script_queries/juniper-rpm-pktloss.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper RPM 3 | Queries a Juniper Router for RPM. 4 | /usr/bin/perl |path_cacti|/scripts/juniper-rpm.pl 5 | index 6 | query 7 | get 8 | |host_hostname| |host_snmp_community| 9 | num_indexes 10 | : 11 | ownertest 12 | alphabetic 13 | |chosen_order_field| 14 | 15 | 16 | 17 | Owner Test 18 | input 19 | query 20 | 21 | 22 | PacketLoss 23 | output 24 | pktloss 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /templates/resource/script_queries/juniper-rpm-rttjitter.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper RPM 3 | Queries a Juniper Router for RPM. 4 | /usr/bin/perl |path_cacti|/scripts/juniper-rpm.pl 5 | index 6 | query 7 | get 8 | |host_hostname| |host_snmp_community| 9 | num_indexes 10 | : 11 | ownertest 12 | alphabetic 13 | |chosen_order_field| 14 | 15 | 16 | 17 | Owner Test 18 | input 19 | query 20 | 21 | 22 | Average RTT 23 | output 24 | average 25 | 26 | 27 | Jitter 28 | output 29 | jitter 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /templates/resource/script_queries/juniper_bgp_prefix.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper BGP Peer Stats 3 | |path_php_binary| -q |path_cacti|/scripts/juniper_bgp_prefix.php 4 | |host_hostname| |host_snmp_version|:|host_snmp_port|:|host_snmp_timeout|:|host_ping_retries|:|host_max_oids|:|host_snmp_community|:|host_snmp_username|:|host_snmp_password|:|host_snmp_auth_protocol|:|host_snmp_priv_passphrase|:|host_snmp_priv_protocol|:|host_snmp_context| 5 | index 6 | query 7 | get 8 | ! 9 | hrPeerIndex 10 | numeric 11 | |chosen_order_field| 12 | 13 | 14 | 15 | Index 16 | input 17 | index 18 | 19 | 20 | BGP Peer IP 21 | input 22 | peerip 23 | 24 | 25 | Prefixes Received 26 | output 27 | received 28 | 29 | 30 | Prefixes Accepted 31 | output 32 | accepted 33 | 34 | 35 | Prefixes Rejected 36 | output 37 | rejected 38 | 39 | 40 | Prefixes Sent 41 | output 42 | sent 43 | 44 | 45 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/Juniper_Firewall_Filter.xml: -------------------------------------------------------------------------------- 1 | 2 | Get Juniper EX Switch Firewall Filter Stats 3 | .1.3.6.1.4.1.2636.3.5.2.1.8 4 | Index 5 | OID/REGEXP:^.*\.2636\.3\.5\.2\.1\.[0-9]{1,3}\.(.*)$ 6 | alphabetic 7 | |chosen_order_field| 8 | 9 | 10 | 11 | Index 12 | index 13 | walk 14 | input 15 | 16 | 17 | Firewall Name 18 | walk 19 | value 20 | input 21 | .1.3.6.1.4.1.2636.3.5.2.1.6 22 | 23 | 24 | Filter Name 25 | walk 26 | value 27 | input 28 | .1.3.6.1.4.1.2636.3.5.2.1.7 29 | 30 | 31 | Packets Filtered 32 | walk 33 | value 34 | output 35 | .1.3.6.1.4.1.2636.3.5.2.1.4 36 | 37 | 38 | Bytes Filtered 39 | walk 40 | value 41 | output 42 | .1.3.6.1.4.1.2636.3.5.2.1.5 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_if.xml: -------------------------------------------------------------------------------- 1 | 2 | F5 BigIP Interface statistics 3 | From F5 MIBS bigipsystem->sysNetwork->sysInterfaces->sysInterfaceStat 4 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1 5 | 6 | OID/REGEXP:^.{24}.{8,9}\.(.*) 7 | bigIPifIndex 8 | alphabetic 9 | 10 | 11 | 12 | Index 13 | index 14 | input 15 | 16 | 17 | Name 18 | walk 19 | value 20 | input 21 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1 22 | 23 | 24 | Status 25 | walk 26 | value 27 | input 28 | .1.3.6.1.4.1.3375.2.1.2.4.1.2.1.17 29 | 30 | 31 | Speed 32 | walk 33 | value 34 | input 35 | .1.3.6.1.4.1.3375.2.1.2.4.1.2.1.4 36 | 37 | 38 | Duplex 39 | walk 40 | value 41 | input 42 | .1.3.6.1.4.1.3375.2.1.2.4.1.2.1.5 43 | 44 | 45 | MAC Address 46 | walk 47 | value 48 | input 49 | .1.3.6.1.4.1.3375.2.1.2.4.1.2.1.6 50 | 51 | 52 | 53 | Packets In 54 | walk 55 | value 56 | output 57 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.2 58 | 59 | 60 | Packets Out 61 | walk 62 | value 63 | output 64 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.4 65 | 66 | 67 | Bytes In 68 | walk 69 | value 70 | output 71 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.3 72 | 73 | 74 | Bytes Out 75 | walk 76 | value 77 | output 78 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.5 79 | 80 | 81 | Multicast In 82 | walk 83 | value 84 | output 85 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.6 86 | 87 | 88 | Multicast Out 89 | walk 90 | value 91 | output 92 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.7 93 | 94 | 95 | Errors In 96 | walk 97 | value 98 | output 99 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.8 100 | 101 | 102 | Errors Out 103 | walk 104 | value 105 | output 106 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.9 107 | 108 | 109 | Drops In 110 | walk 111 | value 112 | output 113 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.10 114 | 115 | 116 | Drops Out 117 | walk 118 | value 119 | output 120 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.11 121 | 122 | 123 | Collisions 124 | walk 125 | value 126 | output 127 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.12 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_ifStat.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 Big-IP interface statistics 3 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1 4 | OID/REGEXP:^.*\.3375\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.(.*) 5 | ifIndex 6 | alphabetic 7 | 8 | 9 | Index 10 | index 11 | input 12 | 13 | 14 | Name 15 | walk 16 | value 17 | input 18 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1 19 | 20 | 21 | Bytes In 22 | walk 23 | value 24 | output 25 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.3 26 | 27 | 28 | Bytes Out 29 | walk 30 | value 31 | output 32 | .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.5 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_ltm_member.xml: -------------------------------------------------------------------------------- 1 | 2 | F5 BigIP LTM Pool Member Statistics 3 | From F5 MIBS bigipLocalTM->ltmPoolMemberStat 4 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.1 5 | OID/REGEXP:^.{30,31}\.(.*) 6 | ltmPoolMemberIndex 7 | alphabetic 8 | 9 | 10 | 11 | Index 12 | index 13 | input 14 | 15 | 16 | Name 17 | walk 18 | value 19 | input 20 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.1 21 | 22 | 23 | Address 24 | walk 25 | 26 | OID/REGEXP:^.*\.(.*\..*\..*\..*\..*)$ 27 | input 28 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.3 29 | 30 | 31 | Port 32 | walk 33 | value 34 | input 35 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.4 36 | 37 | 38 | 40 | 41 | Address 42 | walk 43 | value 44 | output 45 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.3 46 | 47 | 48 | 49 | Server Packets In 50 | walk 51 | value 52 | output 53 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.5 54 | 55 | 56 | Server Packets Out 57 | walk 58 | value 59 | output 60 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.7 61 | 62 | 63 | Server Bytes In 64 | walk 65 | value 66 | output 67 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.6 68 | 69 | 70 | Server Bytes Out 71 | walk 72 | value 73 | output 74 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.8 75 | 76 | 77 | Total Server Conns 78 | walk 79 | value 80 | output 81 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.10 82 | 83 | 84 | Current Server Conns 85 | walk 86 | value 87 | output 88 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.11 89 | 90 | 91 | 92 | PVA Packets In 93 | walk 94 | value 95 | output 96 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.12 97 | 98 | 99 | PVA Packets Out 100 | walk 101 | value 102 | output 103 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.14 104 | 105 | 106 | PVA Bytes In 107 | walk 108 | value 109 | output 110 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.13 111 | 112 | 113 | PVA Bytes Out 114 | walk 115 | value 116 | output 117 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.15 118 | 119 | 120 | Total PVA Conns 121 | walk 122 | value 123 | output 124 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.17 125 | 126 | 127 | Current PVA Conns 128 | walk 129 | value 130 | output 131 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.18 132 | 133 | 134 | 135 | Total PVA Assisted Conns 136 | walk 137 | value 138 | output 139 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.20 140 | 141 | 142 | Current PVA Assisted Conns 143 | walk 144 | value 145 | output 146 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.21 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_ltm_pool.xml: -------------------------------------------------------------------------------- 1 | 2 | F5 BigIP LTM Pool Statistics 3 | From F5 MIBS bigipLocalTM->ltmPoolStat 4 | .1.3.6.1.4.1.3375.2.2.5.1.2.1.1 5 | OID/REGEXP:^.{30,31}\.(.*) 6 | ltmPoolIndex 7 | alphabetic 8 | 9 | 10 | 11 | Index 12 | index 13 | input 14 | 15 | 16 | Name 17 | walk 18 | value 19 | input 20 | .1.3.6.1.4.1.3375.2.2.5.1.2.1.1 21 | 22 | 23 | Member Count 24 | walk 25 | value 26 | input 27 | .1.3.6.1.4.1.3375.2.2.5.1.2.1.23 28 | 29 | 30 | Enabled State 31 | walk 32 | value 33 | input 34 | .1.3.6.1.4.1.3375.2.2.5.5.2.1.3 35 | 36 | 37 | Availability State 38 | walk 39 | value 40 | input 41 | .1.3.6.1.4.1.3375.2.2.5.5.2.1.2 42 | 43 | 44 | 45 | Server Packets In 46 | walk 47 | value 48 | output 49 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.2 50 | 51 | 52 | Server Packets Out 53 | walk 54 | value 55 | output 56 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.4 57 | 58 | 59 | Server Bytes In 60 | walk 61 | value 62 | output 63 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.3 64 | 65 | 66 | Server Bytes Out 67 | walk 68 | value 69 | output 70 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.5 71 | 72 | 73 | Total Server Conns 74 | walk 75 | value 76 | output 77 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.7 78 | 79 | 80 | Current Server Conns 81 | walk 82 | value 83 | output 84 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.8 85 | 86 | 87 | 88 | PVA Packets In 89 | walk 90 | value 91 | output 92 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.9 93 | 94 | 95 | PVA Packets Out 96 | walk 97 | value 98 | output 99 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.11 100 | 101 | 102 | PVA Bytes In 103 | walk 104 | value 105 | output 106 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.10 107 | 108 | 109 | PVA Bytes Out 110 | walk 111 | value 112 | output 113 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.12 114 | 115 | 116 | Total PVA Conns 117 | walk 118 | value 119 | output 120 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.14 121 | 122 | 123 | Current PVA Conns 124 | walk 125 | value 126 | output 127 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.15 128 | 129 | 130 | 131 | Total PVA Assisted Conns 132 | walk 133 | value 134 | output 135 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.16 136 | 137 | 138 | Current PVA Assisted Conns 139 | walk 140 | value 141 | output 142 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.17 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_ltm_vs.xml: -------------------------------------------------------------------------------- 1 | 2 | F5 BigIP LTM Virtual Server Statistics 3 | From F5 MIBS bigipLocalTM->ltmVirtualServers 4 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.1 5 | OID/REGEXP:^.{31}\.(.*) 6 | ltmVSIndex 7 | alphabetic 8 | 9 | 10 | 11 | Index 12 | index 13 | input 14 | 15 | 16 | Name 17 | walk 18 | value 19 | input 20 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.1 21 | 22 | 23 | Address 24 | walk 25 | value 26 | input 27 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.3 28 | 29 | 30 | Mask 31 | walk 32 | value 33 | input 34 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.5 35 | 36 | 37 | Port 38 | walk 39 | value 40 | input 41 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.6 42 | 43 | 71 | 72 | 73 | Other Packets In 74 | walk 75 | value 76 | output 77 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.6 78 | 79 | 80 | Other Packets Out 81 | walk 82 | value 83 | output 84 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.8 85 | 86 | 87 | Other Bytes In 88 | walk 89 | value 90 | output 91 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.7 92 | 93 | 94 | Other Bytes Out 95 | walk 96 | value 97 | output 98 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.9 99 | 100 | 101 | Total Other Conns 102 | walk 103 | value 104 | output 105 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.11 106 | 107 | 108 | Current Other Conns 109 | walk 110 | value 111 | output 112 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.12 113 | 114 | 115 | 116 | Ephemeral Packets In 117 | walk 118 | value 119 | output 120 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.13 121 | 122 | 123 | Ephemeral Packets Out 124 | walk 125 | value 126 | output 127 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.15 128 | 129 | 130 | Ephemeral Bytes In 131 | walk 132 | value 133 | output 134 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.14 135 | 136 | 137 | Ephemeral Bytes Out 138 | walk 139 | value 140 | output 141 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.16 142 | 143 | 144 | Total Ephemeral Conns 145 | walk 146 | value 147 | output 148 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.18 149 | 150 | 151 | Current Ephemeral Conns 152 | walk 153 | value 154 | output 155 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.19 156 | 157 | 158 | 159 | PVA Packets In 160 | walk 161 | value 162 | output 163 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.20 164 | 165 | 166 | PVA Packets Out 167 | walk 168 | value 169 | output 170 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.22 171 | 172 | 173 | PVA Bytes In 174 | walk 175 | value 176 | output 177 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.21 178 | 179 | 180 | PVA Bytes Out 181 | walk 182 | value 183 | output 184 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.23 185 | 186 | 187 | Total PVA Conns 188 | walk 189 | value 190 | output 191 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.25 192 | 193 | 194 | Current PVA Conns 195 | walk 196 | value 197 | output 198 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.26 199 | 200 | 201 | 202 | Total PVA Assisted Conns 203 | walk 204 | value 205 | output 206 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.28 207 | 208 | 209 | Current PVA Assisted Conns 210 | walk 211 | value 212 | output 213 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.29 214 | 215 | 216 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_pm.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 Big-IP Load Balancer Pool Member Statistics 3 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.1.9 4 | OID/REGEXP:^.*\.3375\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.(.*)$ 5 | pmIndex 6 | alphabetic 7 | 8 | 9 | 10 | Index 11 | index 12 | input 13 | 14 | 15 | IP Address 16 | walk 17 | value 18 | input 19 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.3.9 20 | 21 | 22 | Service Port 23 | walk 24 | value 25 | input 26 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.4.9 27 | 28 | 29 | Packets In 30 | walk 31 | value 32 | output 33 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.5.9 34 | 35 | 36 | Packets Out 37 | walk 38 | value 39 | output 40 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.7.9 41 | 42 | 43 | Bytes In 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.6.9 48 | 49 | 50 | Bytes Out 51 | walk 52 | value 53 | output 54 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.8.9 55 | 56 | 57 | Connection Rate 58 | walk 59 | value 60 | output 61 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.10.9 62 | 63 | 64 | Concurrent Connections 65 | walk 66 | value 67 | output 68 | .1.3.6.1.4.1.3375.2.2.5.4.3.1.11.9 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_pool.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 Big-IP Load Balancer Pool Statistics 3 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.1 4 | OID/REGEXP:^.*\.3375\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.(.*)$ 5 | poolIndex 6 | alphabetic 7 | 8 | 9 | 10 | Index 11 | index 12 | input 13 | 14 | 15 | Name 16 | walk 17 | value 18 | input 19 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.1 20 | 21 | 22 | Packets In 23 | walk 24 | value 25 | output 26 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.2 27 | 28 | 29 | Packets Out 30 | walk 31 | value 32 | output 33 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.4 34 | 35 | 36 | Bytes In 37 | walk 38 | value 39 | output 40 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.3 41 | 42 | 43 | Bytes Out 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.5 48 | 49 | 50 | Maximum Connections 51 | walk 52 | value 53 | output 54 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.6 55 | 56 | 57 | Total Connections 58 | walk 59 | value 60 | output 61 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.7 62 | 63 | 64 | Concurrent Connections 65 | walk 66 | value 67 | output 68 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.8 69 | 70 | 71 | PVA Accelerated Packets In 72 | walk 73 | value 74 | output 75 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.9 76 | 77 | 78 | PVA Accelerated Packets Out 79 | walk 80 | value 81 | output 82 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.11 83 | 84 | 85 | PVA Accelerated Bytes In 86 | walk 87 | value 88 | output 89 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.10 90 | 91 | 92 | PVA Accelerated Bytes Out 93 | walk 94 | value 95 | output 96 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.12 97 | 98 | 99 | Maximum Accelerated Connections 100 | walk 101 | value 102 | output 103 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.13 104 | 105 | 106 | Total Accelerated Connections 107 | walk 108 | value 109 | output 110 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.14 111 | 112 | 113 | Concurrent Accelerated Connections 114 | walk 115 | value 116 | output 117 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.15 118 | 119 | 120 | Total Assisted Accelerated Connections 121 | walk 122 | value 123 | output 124 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.16 125 | 126 | 127 | Concurrent Assisted Accelerated Connections 128 | walk 129 | value 130 | output 131 | .1.3.6.1.4.1.3375.2.2.5.2.3.1.17 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_statProfiles.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 BIGIP Stats profiles 3 | Gets list and data within all Stats profiles 4 | 1.3.6.1.4.1.3375.2.2.6.19.1.2.1.1 5 | OID/REGEXP:.*1\.3\.6\.1\.4\.1\.3375\.2\.2\.6\.19\.1\.2\.1\.1(.*)$ 6 | 1.3.6.1.4.1.3375.2.2.6.19.1.2.1.1 7 | bigipStatIndex 8 | numeric 9 | |chosen_order_field| 10 | 11 | 12 | 13 | Index 14 | walk 15 | value 16 | input 17 | 1.3.6.1.4.1.3375.2.2.6.19.1.2.1.1 18 | 19 | 20 | Statname 21 | walk 22 | value 23 | input 24 | .1.3.6.1.4.1.3375.2.2.6.19.2.3.1.3 25 | 26 | 27 | StatCnt 28 | walk 29 | value 30 | output 31 | .1.3.6.1.4.1.3375.2.2.6.19.2.3.1.4 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_bigip_vs.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 Big-IP Load Balancer Virtual Server Statistics 3 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.1 4 | OID/REGEXP:^.*\.3375\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.(.*)$ 5 | vsIndex 6 | alphabetic 7 | 8 | 9 | 10 | Index 11 | index 12 | input 13 | 14 | 15 | Name 16 | walk 17 | value 18 | input 19 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.1 20 | 21 | 22 | IP Address 23 | walk 24 | value 25 | input 26 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.3 27 | 28 | 29 | Service Port 30 | walk 31 | value 32 | input 33 | .1.3.6.1.4.1.3375.2.2.10.1.2.1.6 34 | 35 | 36 | Packets In 37 | walk 38 | value 39 | output 40 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.6 41 | 42 | 43 | Packets Out 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.8 48 | 49 | 50 | Bytes In 51 | walk 52 | value 53 | output 54 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.7 55 | 56 | 57 | Bytes Out 58 | walk 59 | value 60 | output 61 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.9 62 | 63 | 64 | Connection Rate 65 | walk 66 | value 67 | output 68 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.11 69 | 70 | 71 | Concurrent Connections 72 | walk 73 | value 74 | output 75 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.12 76 | 77 | 78 | No Nodes Errors 79 | walk 80 | value 81 | output 82 | .1.3.6.1.4.1.3375.2.2.10.2.3.1.5 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_gtm_poolStat.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 GTM Pool Statistics 3 | .1.3.6.1.4.1.3375.2.3.6.1.2.1.1 4 | OID/REGEXP:^.*\.3375\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.(.*)$ 5 | gtmPoolIndex 6 | alphabetic 7 | 8 | 9 | 10 | 11 | Index 12 | index 13 | input 14 | 15 | 16 | 17 | Name 18 | walk 19 | value 20 | input 21 | .1.3.6.1.4.1.3375.2.3.6.1.2.1.1 22 | 23 | 24 | 25 | Preferred 26 | walk 27 | value 28 | output 29 | .1.3.6.1.4.1.3375.2.3.6.2.3.1.2 30 | 31 | 32 | 33 | Alternate 34 | walk 35 | value 36 | output 37 | .1.3.6.1.4.1.3375.2.3.6.2.3.1.3 38 | 39 | 40 | 41 | Fallback 42 | walk 43 | value 44 | output 45 | .1.3.6.1.4.1.3375.2.3.6.2.3.1.4 46 | 47 | 48 | 49 | Dropped 50 | walk 51 | value 52 | output 53 | .1.3.6.1.4.1.3375.2.3.6.2.3.1.5 54 | 55 | 56 | 57 | ReturnedToDNS 58 | walk 59 | value 60 | output 61 | .1.3.6.1.4.1.3375.2.3.6.2.3.1.7 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/f5_gtm_wip.xml: -------------------------------------------------------------------------------- 1 | 2 | Get F5 Big-IP Load Balancer Virtual Server Statistics 3 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.1 4 | OID/REGEXP:^.*\.3375\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.(.*)$ 5 | wipIndex 6 | alphabetic 7 | 8 | 9 | 10 | Index 11 | index 12 | input 13 | 14 | 15 | Name 16 | walk 17 | value 18 | input 19 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.1 20 | 21 | 22 | Requests 23 | walk 24 | value 25 | output 26 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.2 27 | 28 | 29 | Resolutions 30 | walk 31 | value 32 | output 33 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.3 34 | 35 | 36 | Persisted 37 | walk 38 | value 39 | output 40 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.4 41 | 42 | 43 | Preferred 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.5 48 | 49 | 50 | Alternate 51 | walk 52 | value 53 | output 54 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.6 55 | 56 | 57 | Fallback 58 | walk 59 | value 60 | output 61 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.7 62 | 63 | 64 | Dropped 65 | walk 66 | value 67 | output 68 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.8 69 | 70 | 71 | Explicit IP 72 | walk 73 | value 74 | output 75 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.9 76 | 77 | 78 | Return To DNS 79 | walk 80 | value 81 | output 82 | .1.3.6.1.4.1.3375.2.3.12.2.3.1.10 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_bgp_peer_state.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper - BGP Peer Information 3 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14 4 | OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$ 5 | Index 6 | numeric 7 | |chosen_order_field| 8 | 9 | 10 | 11 | Index 12 | walk 13 | index 14 | input 15 | 16 | 17 | 18 | Local IP 19 | walk 20 | value 21 | input 22 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.2 23 | OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ 24 | 25 | 26 | 27 | Local AS 28 | walk 29 | value 30 | input 31 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.9 32 | 33 | 34 | 35 | Peer IP 36 | walk 37 | value 38 | input 39 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.2 40 | OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$ 41 | 42 | 43 | 44 | Peer AS 45 | walk 46 | value 47 | input 48 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13 49 | 50 | 51 | 52 | Peer State 53 | walk 54 | value 55 | output 56 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.2 57 | 58 | 59 | 60 | 61 | Peer Status 62 | walk 63 | value 64 | input 65 | .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.3 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_fpc_stats.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper - FPC 3 | .1.3.6.1.4.1.2636.3.1.13.1.5.7 4 | OID/REGEXP:.*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$ 5 | Index 6 | numeric 7 | |chosen_order_field| 8 | 9 | 10 | 11 | Index 12 | walk 13 | index 14 | input 15 | 16 | 17 | 18 | 19 | Description 20 | walk 21 | value 22 | input 23 | .1.3.6.1.4.1.2636.3.1.13.1.5.7 24 | 25 | 26 | 27 | Temperature (C) 28 | walk 29 | value 30 | input 31 | .1.3.6.1.4.1.2636.3.1.13.1.7.7 32 | 33 | 34 | 35 | Operating State 36 | walk 37 | value 38 | output 39 | .1.3.6.1.4.1.2636.3.1.13.1.16.7 40 | 41 | 42 | 43 | Temperature 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.2636.3.1.13.1.7.7 48 | 49 | 50 | 51 | CPU Utilization 52 | walk 53 | value 54 | output 55 | .1.3.6.1.4.1.2636.3.1.13.1.8.7 56 | 57 | 58 | 59 | RAM Utilization 60 | walk 61 | value 62 | output 63 | .1.3.6.1.4.1.2636.3.1.13.1.11.7 64 | 65 | 66 | 67 | Max RAM 68 | walk 69 | value 70 | output 71 | .1.3.6.1.4.1.2636.3.1.13.1.15.7 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_pem_stats.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper - Power Supply 3 | .1.3.6.1.4.1.2636.3.1.13.1.5.2 4 | OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$ 5 | Index 6 | numeric 7 | |chosen_order_field| 8 | 9 | 10 | 11 | Index 12 | walk 13 | index 14 | input 15 | 16 | 17 | 18 | 19 | Description 20 | walk 21 | value 22 | input 23 | .1.3.6.1.4.1.2636.3.1.13.1.5.2 24 | 25 | 26 | 27 | Temperature (C) 28 | walk 29 | value 30 | input 31 | .1.3.6.1.4.1.2636.3.1.13.1.7.2 32 | 33 | 34 | 35 | Operating State 36 | walk 37 | value 38 | output 39 | .1.3.6.1.4.1.2636.3.1.13.1.16.2 40 | 41 | 42 | 43 | Temperature 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.2636.3.1.13.1.7.2 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_re_stats.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper - Routing Engine 3 | .1.3.6.1.4.1.2636.3.1.13.1.5.9 4 | OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$ 5 | Index 6 | numeric 7 | |chosen_order_field| 8 | 9 | 10 | 11 | Index 12 | walk 13 | index 14 | input 15 | 16 | 17 | 18 | 19 | Description 20 | walk 21 | value 22 | input 23 | .1.3.6.1.4.1.2636.3.1.13.1.5.9 24 | 25 | 26 | 27 | Temperature (C) 28 | walk 29 | value 30 | input 31 | .1.3.6.1.4.1.2636.3.1.13.1.7.9 32 | 33 | 34 | 35 | Operating State 36 | walk 37 | value 38 | output 39 | .1.3.6.1.4.1.2636.3.1.13.1.16.9 40 | 41 | 42 | 43 | Temperature 44 | walk 45 | value 46 | output 47 | .1.3.6.1.4.1.2636.3.1.13.1.7.9 48 | 49 | 50 | 51 | CPU Utilization 52 | walk 53 | value 54 | output 55 | .1.3.6.1.4.1.2636.3.1.13.1.8.9 56 | 57 | 58 | 59 | RAM Utilization 60 | walk 61 | value 62 | output 63 | .1.3.6.1.4.1.2636.3.1.13.1.11.9 64 | 65 | 66 | 67 | Max RAM 68 | walk 69 | value 70 | output 71 | .1.3.6.1.4.1.2636.3.1.13.1.15.9 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_srx_central_point.xml: -------------------------------------------------------------------------------- 1 | 2 | Get SRX CP Connection Stats 3 | Juniper SRX 3K Series CP Stats 4 | numeric 5 | 1.3.6.1.4.1.2636.3.39.1.12.1.4.1.1 6 | Index 7 | 8 | 9 | 10 | Index 11 | index 12 | input 13 | 14 | 15 | Cluster Names 16 | walk 17 | value 18 | input 19 | 1.3.6.1.4.1.2636.3.39.1.12.1.4.1.2 20 | 21 | 22 | Current Sessions 23 | walk 24 | value 25 | output 26 | .1.3.6.1.4.1.2636.3.39.1.12.1.4.1.3 27 | 28 | 29 | Total Sessions 30 | walk 31 | value 32 | output 33 | .1.3.6.1.4.1.2636.3.39.1.12.1.4.1.4 34 | 35 | 36 | Sessions Per Second 37 | walk 38 | value 39 | output 40 | .1.3.6.1.4.1.2636.3.39.1.12.1.4.1.5 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_srx_screens.xml: -------------------------------------------------------------------------------- 1 | 2 | Juniper SRX Screen Statisticss 3 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.1 4 | Index 5 | OID/REGEXP:^.*\.2636\.3\.39\.1\.8\.1\.1\.1\.1\.[0-9]{1,3}\.(.*)$ 6 | 7 | 8 | 9 | Index 10 | index 11 | input 12 | 13 | 14 | Zone Name 15 | walk 16 | value 17 | input 18 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.1 19 | 20 | 21 | Number of Interfaces 22 | walk 23 | value 24 | input 25 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.2 26 | 27 | 28 | TCP SYN flood 29 | walk 30 | value 31 | output 32 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.3 33 | 34 | 35 | IP tear drop 36 | walk 37 | value 38 | output 39 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.4 40 | 41 | 42 | IP source route option 43 | walk 44 | value 45 | output 46 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.5 47 | 48 | 49 | ICMP ping of death 50 | walk 51 | value 52 | output 53 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.6 54 | 55 | 56 | IP spoofing 57 | walk 58 | value 59 | output 60 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.7 61 | 62 | 63 | TCP land attack 64 | walk 65 | value 66 | output 67 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.8 68 | 69 | 70 | ICMP flood 71 | walk 72 | value 73 | output 74 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.9 75 | 76 | 77 | UDP flood 78 | walk 79 | value 80 | output 81 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.10 82 | 83 | 84 | TCP winnuke 85 | walk 86 | value 87 | output 88 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.11 89 | 90 | 91 | TCP port scan 92 | walk 93 | value 94 | output 95 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.12 96 | 97 | 98 | ICMP address sweep 99 | walk 100 | value 101 | output 102 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.13 103 | 104 | 105 | TCP SYN fragment 106 | walk 107 | value 108 | output 109 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.14 110 | 111 | 112 | TCP no flag 113 | walk 114 | value 115 | output 116 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.15 117 | 118 | 119 | IP unknown protocol 120 | walk 121 | value 122 | output 123 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.16 124 | 125 | 126 | IP bad options 127 | walk 128 | value 129 | output 130 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.17 131 | 132 | 133 | IP record route option 134 | walk 135 | value 136 | output 137 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.18 138 | 139 | 140 | IP timestamp option 141 | walk 142 | value 143 | output 144 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.19 145 | 146 | 147 | IP security option 148 | walk 149 | value 150 | output 151 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.20 152 | 153 | 154 | IP loose source route option 155 | walk 156 | value 157 | output 158 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.21 159 | 160 | 161 | IP strict source route option 162 | walk 163 | value 164 | output 165 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.22 166 | 167 | 168 | IP stream option 169 | walk 170 | value 171 | output 172 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.23 173 | 174 | 175 | ICMP fragment 176 | walk 177 | value 178 | output 179 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.24 180 | 181 | 182 | ICMP large packet 183 | walk 184 | value 185 | output 186 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.25 187 | 188 | 189 | TCP SYN FIN 190 | walk 191 | value 192 | output 193 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.26 194 | 195 | 196 | TCP FIN no ACK 197 | walk 198 | value 199 | output 200 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.27 201 | 202 | 203 | Source session limit 204 | walk 205 | value 206 | output 207 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.28 208 | 209 | 210 | Destination session limit 211 | walk 212 | value 213 | output 214 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.29 215 | 216 | 217 | TCP SYN-ACK-ACK proxy 218 | walk 219 | value 220 | output 221 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.30 222 | 223 | 224 | IP block fragment 225 | walk 226 | value 227 | output 228 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.31 229 | 230 | 231 | IPv6 extension header 232 | walk 233 | value 234 | output 235 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.42 236 | 237 | 238 | IPv6 extension hop by hop option 239 | walk 240 | value 241 | output 242 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.43 243 | 244 | 245 | IPv6 extension destination option 246 | walk 247 | value 248 | output 249 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.44 250 | 251 | 252 | IPv6 extension header limit 253 | walk 254 | value 255 | output 256 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.45 257 | 258 | 259 | IPv6 malformed header 260 | walk 261 | value 262 | output 263 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.46 264 | 265 | 266 | ICMPv6 malformed packet 267 | walk 268 | value 269 | output 270 | .1.3.6.1.4.1.2636.3.39.1.8.1.1.1.1.47 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_srx_security_policy.xml: -------------------------------------------------------------------------------- 1 | 2 | Get Juniper SRX Security Policy Stats 3 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1 4 | Index 5 | OID/REGEXP:^.*\.2636\.3\.39\.1\.4\.1\.1\.[0-9]{1,3}\.1\.[0-9]{1,3}\.(.*)$ 6 | 7 | 8 | 9 | Index 10 | index 11 | input 12 | 13 | 14 | From Zone 15 | walk 16 | value 17 | input 18 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1.1 19 | 20 | 21 | To Zone 22 | walk 23 | value 24 | input 25 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1.2 26 | 27 | 28 | Policy Name 29 | walk 30 | value 31 | input 32 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1.3 33 | 34 | 35 | Scheduler 36 | walk 37 | value 38 | input 39 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1.6 40 | 41 | 42 | Stats Availability 43 | walk 44 | value 45 | input 46 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.2.1.8 47 | 48 | 49 | Input Bytes 50 | walk 51 | value 52 | output 53 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.2 54 | 55 | 56 | Output Bytes 57 | walk 58 | value 59 | output 60 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.4 61 | 62 | 63 | Input Packets 64 | walk 65 | value 66 | output 67 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.6 68 | 69 | 70 | Output Packets 71 | walk 72 | value 73 | output 74 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.8 75 | 76 | 77 | Num Sessions 78 | walk 79 | value 80 | output 81 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.10 82 | 83 | 84 | Session Deleted 85 | walk 86 | value 87 | output 88 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.12 89 | 90 | 91 | Policy Lookups 92 | walk 93 | value 94 | output 95 | .1.3.6.1.4.1.2636.3.39.1.4.1.1.3.1.13 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /templates/resource/snmp_queries/juniper_srx_services_processing_unit.xml: -------------------------------------------------------------------------------- 1 | 2 | Get SRX SPU Stats 3 | Juniper SRX 3K Series CP/SPU Stats 4 | numeric 5 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.2 6 | OID/REGEXP:^.*\.([0-9]+)$ 7 | Index 8 | 9 | 10 | 11 | Index 12 | index 13 | input 14 | 15 | 16 | SPU Slot 17 | walk 18 | value 19 | input 20 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.2 21 | 22 | 23 | Cluster Names 24 | walk 25 | value 26 | input 27 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.11 28 | 29 | 30 | CPU Usage 31 | walk 32 | value 33 | output 34 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4 35 | 36 | 37 | Memory Usage 38 | walk 39 | value 40 | output 41 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.5 42 | 43 | 44 | Current Flow Session 45 | walk 46 | value 47 | output 48 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.6 49 | 50 | 51 | Max Flow Session 52 | walk 53 | value 54 | output 55 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.7 56 | 57 | 58 | Current Control Point Session 59 | walk 60 | value 61 | output 62 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.8 63 | 64 | 65 | Max Control Point Session 66 | walk 67 | value 68 | output 69 | .1.3.6.1.4.1.2636.3.39.1.12.1.1.1.9 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /templates/scripts/README.md: -------------------------------------------------------------------------------- 1 | placeholder file -------------------------------------------------------------------------------- /templates/scripts/f5-bigip-cpu-nice.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # This code is not supported by F5 Network and is offered under the GNU General Public License. Use at your own risk. 3 | 4 | use strict; 5 | use Net::SNMP qw(:snmp); 6 | 7 | my ($host, $snmp_comm); 8 | 9 | $host = $ARGV[0]; 10 | $snmp_comm = $ARGV[1]; 11 | chomp ($host , $snmp_comm); 12 | 13 | my $cpuIndex = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.2.1.48"; 14 | 15 | my $cpuUsageRatio5s = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.19.1.48."; 16 | my $cpuUsageRatio1m = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.27.1.48."; 17 | my $cpuUsageRatio5m = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.35.1.48."; 18 | 19 | my $gcpuUsageRatio5s = ".1.3.6.1.4.1.3375.2.1.1.2.20.21.0"; 20 | my $gcpuUsageRatio1m = ".1.3.6.1.4.1.3375.2.1.1.2.20.29.0"; 21 | my $gcpuUsageRatio5m = ".1.3.6.1.4.1.3375.2.1.1.2.20.37.0"; 22 | 23 | my ($session, $error) = Net::SNMP->session( 24 | -hostname => $host, 25 | -community => $snmp_comm, 26 | -port => 161, 27 | -version => 'snmpv2c', 28 | -nonblocking => 0 29 | ); 30 | 31 | if (!defined $session) { 32 | print "Received no SNMP response from $host\n"; 33 | print STDERR "Error: $error\n"; 34 | exit -1; 35 | } 36 | 37 | my $allCPU = $session->get_table ( -baseoid => $cpuIndex ); 38 | my %cpu_table = %{$allCPU}; 39 | my $x = 0; 40 | 41 | print "\n\nCPU Utilization:\t5s\t1m\t5m\n\n"; 42 | 43 | foreach my $key (sort keys %cpu_table) { 44 | my @oid_index = split(/\./, $key); 45 | my $ltm_cpu5s = $cpuUsageRatio5s . $oid_index[-1]; 46 | my $ltm_cpu1m = $cpuUsageRatio1m . $oid_index[-1]; 47 | my $ltm_cpu5m = $cpuUsageRatio5m . $oid_index[-1]; 48 | 49 | my $oid_ratios = $session->get_request( 50 | -varbindlist => 51 | [$ltm_cpu5s, $ltm_cpu1m, $ltm_cpu5m] ); 52 | 53 | print "\tCPU$x\t\t$oid_ratios->{$ltm_cpu5s}\t$oid_ratios->{$ltm_cpu1m}\t$oid_ratios->{$ltm_cpu5m}\n"; 54 | 55 | $x++; 56 | } 57 | 58 | my $oid_gratios = $session->get_request( 59 | -varbindlist => 60 | [$gcpuUsageRatio5s, $gcpuUsageRatio1m, $gcpuUsageRatio5m] ); 61 | 62 | print "\tGlobal\t\t$oid_gratios->{$gcpuUsageRatio5s}\t$oid_gratios->{$gcpuUsageRatio1m}\t$oid_gratios->{$gcpuUsageRatio5m}\n\n\n"; 63 | -------------------------------------------------------------------------------- /templates/scripts/f5_bigip_cpu.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # Originally contributed by James Kelty 3 | # Modified for v.10 by Jason Rahm 4 | # 5 | 6 | use Net::SNMP qw(:snmp); 7 | 8 | my $host = $ARGV[0]; 9 | my $snmp_comm = $ARGV[1]; 10 | 11 | ($time,$idle,$sleep) = &getValue($host,$snmp_comm); 12 | sleep(10); 13 | ($time1,$idle1,$sleep1) = &getValue($host,$snmp_comm); 14 | 15 | $time_delta = $time1 - $time; 16 | $idle_delta = $idle1 - $idle; 17 | $sleep_delta = $sleep1 - $sleep; 18 | 19 | $tmm_usage = &calcCPU($time_delta, $idle_delta, $sleep_delta); 20 | 21 | print "$tmm_usage"; 22 | 23 | sub getValue { 24 | 25 | use Net::SNMP qw(:snmp); 26 | 27 | my ($host,$snmp_comm) = (@_); 28 | my $tmmTotalCycles = '.1.3.6.1.4.1.3375.2.1.1.2.1.41.0'; 29 | my $tmmIdleCycles = '.1.3.6.1.4.1.3375.2.1.1.2.1.42.0'; 30 | my $tmmSleepCycles = '.1.3.6.1.4.1.3375.2.1.1.2.1.43.0'; 31 | 32 | my ($session,$error) = Net::SNMP->session( 33 | -hostname => $host, 34 | -community => $snmp_comm, 35 | -port => 161, 36 | -version => 'snmpv2c', 37 | -nonblocking => 0 38 | ); 39 | 40 | if (!defined $session) { 41 | print "Recieved no SNMP response from $host\n"; 42 | print STDERR "Error: $error\n"; 43 | exit -1; 44 | } 45 | 46 | my $polled_oids = $session->get_request( 47 | -varbindlist => [$tmmTotalCycles,$tmmIdleCycles,$tmmSleepCycles] 48 | ); 49 | 50 | my $total_time = $polled_oids->{$tmmTotalCycles}; 51 | my $total_idle = $polled_oids->{$tmmIdleCycles}; 52 | my $total_sleep = $polled_oids->{$tmmSleepCycles}; 53 | 54 | return($total_time,$total_idle,$total_sleep); 55 | } 56 | 57 | sub calcCPU { 58 | my ($timeDelta, $idleDelta, $sleepDelta) = @_; 59 | my $cpu_percentage = int((($timeDelta - ($idleDelta + $sleepDelta)) / $timeDelta )*100 +.5); 60 | return($cpu_percentage); 61 | } 62 | -------------------------------------------------------------------------------- /templates/scripts/f5_bigip_cpun.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # This code is not supported by F5 Network and is offered under the GNU General Public License. Use at your own risk. 3 | 4 | #use strict; 5 | use Net::SNMP qw(:snmp); 6 | 7 | my ($host, $snmp_comm); 8 | 9 | $host = $ARGV[0]; 10 | $snmp_comm = $ARGV[1]; 11 | chomp ($host , $snmp_comm); 12 | 13 | #my $cpuID = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.3.1.48"; 14 | my $cpuIndex = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.2.1.48"; 15 | 16 | my $cpuUsageRatio5s = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.19.1.48."; 17 | my $cpuUsageRatio1m = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.27.1.48."; 18 | my $cpuUsageRatio5m = ".1.3.6.1.4.1.3375.2.1.7.5.2.1.35.1.48."; 19 | 20 | my $gcpuUsageRatio5s = ".1.3.6.1.4.1.3375.2.1.1.2.20.21.0"; 21 | my $gcpuUsageRatio1m = ".1.3.6.1.4.1.3375.2.1.1.2.20.29.0"; 22 | my $gcpuUsageRatio5m = ".1.3.6.1.4.1.3375.2.1.1.2.20.37.0"; 23 | 24 | my ($session, $error) = Net::SNMP->session( 25 | -hostname => $host, 26 | -community => $snmp_comm, 27 | -port => 161, 28 | -version => 'snmpv2c', 29 | -nonblocking => 0 30 | ); 31 | 32 | if (!defined $session) { 33 | print "Received no SNMP response from $host\n"; 34 | print STDERR "Error: $error\n"; 35 | exit -1; 36 | } 37 | 38 | my $allCPU = $session->get_table ( -baseoid => $cpuIndex ); 39 | my %cpu_table = %{$allCPU}; 40 | my $x = 0; 41 | 42 | foreach my $key (sort keys %cpu_table) { 43 | @oid_index = split(/\./, $key); 44 | my $ltm_cpu5s = $cpuUsageRatio5s . $oid_index[-1]; 45 | my $ltm_cpu1m = $cpuUsageRatio1m . $oid_index[-1]; 46 | my $ltm_cpu5m = $cpuUsageRatio5m . $oid_index[-1]; 47 | 48 | my $oid_ratios = $session->get_request( 49 | -varbindlist => 50 | [$ltm_cpu5s, $ltm_cpu1m, $ltm_cpu5m] ); 51 | 52 | print "CPU$x\_5s:$oid_ratios->{$ltm_cpu5s} CPU$x\_1m:$oid_ratios->{$ltm_cpu1m} CPU$x\_5m:$oid_ratios->{$ltm_cpu5m} "; 53 | $x++; 54 | } 55 | 56 | my $oid_gratios = $session->get_request( 57 | -varbindlist => 58 | [$gcpuUsageRatio5s, $gcpuUsageRatio1m, $gcpuUsageRatio5m] ); 59 | 60 | print " Global_5s:$oid_gratios->{$gcpuUsageRatio5s} Global_1m:$oid_gratios->{$gcpuUsageRatio1m} Global_5m:$oid_gratios->{$gcpuUsageRatio5m}"; 61 | -------------------------------------------------------------------------------- /templates/scripts/juniper-rpm.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | #This Script find the and monitor Juniper RPM tests. 4 | #the problem with this mib is that the index is based on SnmpAdminString where each word is prefix with its length and the word is in ascii Decimal format 5 | #any qestions or bugs to nitzan.tzelniker@gmail.com 6 | 7 | #use warnings; 8 | use strict; 9 | 10 | my $node = $ARGV[0]; 11 | my $comm = $ARGV[1]; 12 | my $action1 = $ARGV[2]; 13 | my $action2 = $ARGV[3]; 14 | my $theindex = $ARGV[4]; 15 | 16 | 17 | 18 | my $snmppath = "/usr/bin/snmpwalk"; 19 | my $snmpget = "/usr/bin/snmpget"; 20 | my $version = "2c"; 21 | my $jnxRpmResCalcAverage = '.1.3.6.1.4.1.2636.3.50.1.3.1.5'; 22 | my $jnxRpmResCalcPkToPk = '.1.3.6.1.4.1.2636.3.50.1.3.1.6'; 23 | my $jnxRpmResSumPercentLost = '.1.3.6.1.4.1.2636.3.50.1.2.1.4'; 24 | my @index; 25 | my $owner; 26 | my $test; 27 | my @Tests; 28 | 29 | sub indexes { 30 | my $queryOrIndex = shift; 31 | 32 | my @Index = `$snmppath -On -v $version $node -c $comm $jnxRpmResCalcAverage`; 33 | 34 | foreach (@Index) { 35 | 36 | if ($_ =~m/^\.1\.3\.6\.1\.4\.1\.2636\.3\.50\.1\.3\.1\.5\.(\d+).*\.1\.1 \= Gauge32.*$/i){ #Find the length of the owner string 37 | if ($_ =~m/^\.1\.3\.6\.1\.4\.1\.2636\.3\.50\.1\.3\.1\.5\.(\d+)((\.\d+){$1})\.(\d+).*\.1\.1 \= Gauge32.*$/i){ #Find the owner string and the length of te Test string 38 | if ($_ =~m/^\.1\.3\.6\.1\.4\.1\.2636\.3\.50\.1\.3\.1\.5\.(\d+)((\.\d+){$1})\.(\d+)((\.\d+){$4})\.1\.1 \= Gauge32.*$/i){ # Find the Test string 39 | my $owner = oid_to_ascii($2); 40 | my $test = oid_to_ascii($5); 41 | if ($queryOrIndex eq "query"){ 42 | push @Tests , "$owner.$test:$owner.$test\n"; 43 | } 44 | elsif ($queryOrIndex eq "index"){ 45 | push @Tests, "$owner.$test\n" ; 46 | } 47 | } 48 | } 49 | } 50 | } 51 | return @Tests 52 | } 53 | sub get_average { 54 | my $index_value = shift; 55 | my @values = split /\./,$index_value; 56 | my $lengthOwnerOid = length ($values[0]); 57 | my $lengthTestOid = length ($values[1]); 58 | my $ownerOid = ascii_to_oid($values[0]); 59 | my $testOid = ascii_to_oid($values[1]); 60 | my $oidIndex = $lengthOwnerOid . $ownerOid . '.' . $lengthTestOid . $testOid; 61 | my @rtt = split (/ /,`$snmpget -Ov -v $version $node -c $comm $jnxRpmResCalcAverage.$oidIndex.2.1`); 62 | return $rtt[1]; 63 | } 64 | sub get_jitter { 65 | my $index_value = shift; 66 | my @values = split /\./,$index_value; 67 | my $lengthOwnerOid = length ($values[0]); 68 | my $lengthTestOid = length ($values[1]); 69 | my $ownerOid = ascii_to_oid($values[0]); 70 | my $testOid = ascii_to_oid($values[1]); 71 | my $oidIndex = $lengthOwnerOid . $ownerOid . '.' . $lengthTestOid . $testOid; 72 | my @jitter = split (/ /,`$snmpget -Ov -v $version $node -c $comm $jnxRpmResCalcPkToPk.$oidIndex.2.1`); 73 | return $jitter[1]; 74 | } 75 | 76 | sub get_pktloss { 77 | my $index_value = shift; 78 | my @values = split /\./,$index_value; 79 | my $lengthOwnerOid = length ($values[0]); 80 | my $lengthTestOid = length ($values[1]); 81 | my $ownerOid = ascii_to_oid($values[0]); 82 | my $testOid = ascii_to_oid($values[1]); 83 | my $oidIndex = $lengthOwnerOid . $ownerOid . '.' . $lengthTestOid . $testOid; 84 | my @pktloss = split (/ /,`$snmpget -Ov -v $version $node -c $comm $jnxRpmResSumPercentLost.$oidIndex.2`); 85 | return $pktloss[1]; 86 | } 87 | 88 | ARGUMENTS: { 89 | if ($action1 eq "index") { print indexes("index") ; last ARGUMENTS; } 90 | if ($action1 eq "query") { print indexes("query") ; last ARGUMENTS; } 91 | if ($action2 eq "average") { print get_average("$theindex") ; last ARGUMENTS; } 92 | if ($action2 eq "jitter") { print get_jitter("$theindex") ; last ARGUMENTS; } 93 | if ($action2 eq "pktloss") { print get_pktloss("$theindex") ; last ARGUMENTS; } 94 | 95 | 96 | print "usage:\n\n./juniper-rpm.pl IP COMMUNITY index\n./juniper-rpm.pl IP COMMUNITY query \n./juniper-rpm.pl IP COMMUNITY get {average|jitter|pktloss} index_oid\n"; 97 | } 98 | 99 | sub oid_to_ascii ($) 100 | { 101 | ## Convert each two-digit hex number back to an ASCII character. 102 | (my $str = shift) =~ s/([0-9]{1,3})/chr($1)/eg; 103 | my @noDotArry = split(/\./,$str); 104 | $str = join ('',@noDotArry); 105 | return $str; 106 | } 107 | 108 | sub ascii_to_oid($) 109 | { 110 | my @chars = split(//,shift); 111 | my $oid = ''; 112 | foreach (@chars){ 113 | $oid .= '.' . ord ($_); 114 | } 115 | return $oid; 116 | } 117 | 118 | exit; 119 | -------------------------------------------------------------------------------- /templates/scripts/juniper_bgp_prefix.php: -------------------------------------------------------------------------------- 1 | This script is only meant to run at the command line."); 7 | } 8 | 9 | $no_http_headers = true; 10 | 11 | include(dirname(__FILE__)."/../include/global.php"); 12 | include(dirname(__FILE__)."/../lib/snmp.php"); 13 | 14 | $oids = array( 15 | "index" => ".1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14", 16 | "peerip" => ".1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14", 17 | "received" => ".1.3.6.1.4.1.2636.5.1.1.2.6.2.1.7", 18 | "accepted" => ".1.3.6.1.4.1.2636.5.1.1.2.6.2.1.8", 19 | "rejected" => ".1.3.6.1.4.1.2636.5.1.1.2.6.2.1.9", 20 | "sent" => ".1.3.6.1.4.1.2636.5.1.1.2.6.2.1.10", 21 | ); 22 | $xml_delimiter = "!"; 23 | 24 | $hostname = $_SERVER["argv"][1]; 25 | $snmp_auth = $_SERVER["argv"][2]; 26 | $cmd = $_SERVER["argv"][3]; 27 | 28 | /* support for SNMP V2 and SNMP V3 parameters */ 29 | $snmp = explode(":", $snmp_auth); 30 | $snmp_version = $snmp[0]; 31 | $snmp_port = $snmp[1]; 32 | $snmp_timeout = $snmp[2]; 33 | $ping_retries = $snmp[3]; 34 | $max_oids = $snmp[4]; 35 | 36 | $snmp_auth_username = ""; 37 | $snmp_auth_password = ""; 38 | $snmp_auth_protocol = ""; 39 | $snmp_priv_passphrase = ""; 40 | $snmp_priv_protocol = ""; 41 | $snmp_context = ""; 42 | $snmp_community = ""; 43 | 44 | if ($snmp_version == 3) { 45 | $snmp_auth_username = $snmp[6]; 46 | $snmp_auth_password = $snmp[7]; 47 | $snmp_auth_protocol = $snmp[8]; 48 | $snmp_priv_passphrase = $snmp[9]; 49 | $snmp_priv_protocol = $snmp[10]; 50 | $snmp_context = $snmp[11]; 51 | }else{ 52 | $snmp_community = $snmp[5]; 53 | } 54 | 55 | 56 | /* process index requests */ 57 | if ($cmd == "index") { 58 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 59 | 60 | foreach ($return_arr as $arr) { 61 | print $arr["value"] . "\n"; 62 | } 63 | 64 | /* process query requests */ 65 | } elseif ($cmd == "query") { 66 | $arg = $_SERVER["argv"][4]; 67 | 68 | if ($arg == "peerip") { 69 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 70 | foreach ($return_arr as $arr) { 71 | $temp = explode(".", $arr["oid"]); 72 | $peer["ip"] = $temp[22] . "." . $temp[23] . "." . $temp[24] . "." . $temp[25]; 73 | print $arr["value"] . "!" . $peer["ip"] . "\n"; 74 | } 75 | } elseif ($arg == "received") { 76 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 77 | foreach ($return_arr as $arr) { 78 | 79 | $return_arr2 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . "." . $arr["value"], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 80 | foreach ($return_arr2 as $arr2) { 81 | if ($arr2["value"]) { 82 | print $arr["value"] . "!" . $arr2["value"] . "\n"; 83 | } 84 | } 85 | } 86 | } elseif ($arg == "accepted") { 87 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 88 | foreach ($return_arr as $arr) { 89 | 90 | $return_arr3 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . "." . $arr["value"], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 91 | foreach ($return_arr3 as $arr3) { 92 | if ($arr3["value"]) { 93 | print $arr["value"] . "!" . $arr3["value"] . "\n"; 94 | } 95 | } 96 | } 97 | } elseif ($arg == "rejected") { 98 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 99 | foreach ($return_arr as $arr) { 100 | 101 | $return_arr4 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . "." . $arr["value"], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 102 | foreach ($return_arr4 as $arr4) { 103 | if ($arr4["value"]) { 104 | print $arr["value"] . "!" . $arr4["value"] . "\n"; 105 | } 106 | } 107 | } 108 | } elseif ($arg == "sent") { 109 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 110 | foreach ($return_arr as $arr) { 111 | 112 | $return_arr5 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . "." . $arr["value"], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 113 | foreach ($return_arr5 as $arr5) { 114 | if ($arr5["value"]) { 115 | print $arr["value"] . "!" . $arr5["value"] . "\n"; 116 | } 117 | } 118 | } 119 | } elseif ($arg == "index") { 120 | $return_arr = cacti_snmp_walk($hostname, $snmp_community, $oids['index'], $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 121 | 122 | foreach ($return_arr as $arr) { 123 | print $arr["value"] . "!" . $arr["value"] . "\n"; 124 | } 125 | } 126 | 127 | /* process prefix requests */ 128 | } elseif ($cmd == "get") { 129 | $arg = $_SERVER["argv"][4]; 130 | $index = $_SERVER["argv"][5]; 131 | 132 | if ($arg == "received") { 133 | $return_arr2 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 134 | foreach ($return_arr2 as $arr) { 135 | if ($arr["value"] >= 0) { 136 | print $arr["value"]; 137 | } 138 | } 139 | } 140 | elseif ($arg == "accepted") { 141 | $return_arr3 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 142 | foreach ($return_arr3 as $arr) { 143 | if ($arr["value"] >= 0) { 144 | print $arr["value"]; 145 | } 146 | } 147 | } 148 | elseif ($arg == "rejected") { 149 | $return_arr4 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 150 | foreach ($return_arr4 as $arr) { 151 | if ($arr["value"] >= 0) { 152 | print $arr["value"]; 153 | } 154 | } 155 | } 156 | elseif ($arg == "sent") { 157 | $return_arr5 = cacti_snmp_walk($hostname, $snmp_community, $oids[$arg] . ".$index", $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, $ping_retries, $max_oids, SNMP_POLLER); 158 | foreach ($return_arr5 as $arr) { 159 | if ($arr["value"] >= 0) { 160 | print $arr["value"]; 161 | } 162 | } 163 | } 164 | } 165 | ?> -------------------------------------------------------------------------------- /templates/scripts/ss_multicpu_avg.php: -------------------------------------------------------------------------------- 1 | $value) { 39 | $load += $value['value']; 40 | } 41 | 42 | $load = $load/count($array); 43 | 44 | 45 | return("load:$load\n"); 46 | } 47 | ?> -------------------------------------------------------------------------------- /upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # script to upgrade a cacti instance to latest, if you want a specific version please update the following download links 4 | cacti_download_url=http://www.cacti.net/downloads/cacti-latest.tar.gz 5 | spine_download_url=http://www.cacti.net/downloads/spine/cacti-spine-latest.tar.gz 6 | 7 | # create temp workspace 8 | echo "$(date +%F_%R) [Upgrade] Prepping workspace for restore." 9 | rm -rf /tmp/update 10 | mkdir /tmp/update 11 | mkdir /tmp/update/spine 12 | mkdir /tmp/update/cacti 13 | 14 | # download and uncompress cacti 15 | echo "$(date +%F_%R) [Upgrade] Downloading Cacti from $cacti_download_url" 16 | wget --no-check-certificate -qO- $cacti_download_url | tar xzC /tmp/update/cacti 17 | 18 | # download and uncompress spine 19 | echo "$(date +%F_%R) [Upgrade] Downloading Spine from $spine_download_url" 20 | wget --no-check-certificate -qO- /tmp/update $spine_download_url | tar xzC /tmp/update/spine/ 21 | 22 | # if not a remote poller, update cacti bits 23 | if [ ${REMOTE_POLLER} != 1 ]; then 24 | echo "$(date +%F_%R) [Upgrade] System not marked as remote poller, updating cacti." 25 | 26 | # cacti install 27 | echo "$(date +%F_%R) [Upgrade] Installing new version of Cacti." 28 | cp -Rf /tmp/update/cacti/*/* /cacti 29 | 30 | # fixing permissions 31 | echo "$(date +%F_%R) [Restore] Setting cacti file permissions." 32 | chown -R apache.apache /cacti/resource/ 33 | chown -R apache.apache /cacti/cache/ 34 | chown -R apache.apache /cacti/log/ 35 | chown -R apache.apache /cacti/scripts/ 36 | chown -R apache.apache /cacti/rra/ 37 | touch /cacti/include/vendor/csrf/csrf-secret.php 38 | chmod 644 /cacti/include/vendor/csrf/csrf-secret.php 39 | chown apache.apache /cacti/include/vendor/csrf/csrf-secret.php 40 | 41 | # copy templated config files, makes sed command easier 42 | echo "$(date +%F_%R) [Upgrade] Copying config templates for Cacti." 43 | cp -f /template_configs/config.php /cacti/include 44 | 45 | # cacti settings 46 | echo "$(date +%F_%R) [Upgrade] Updating cacti settings." 47 | sed -i -e "s/%DB_HOST%/${DB_HOST}/" \ 48 | -e "s/%DB_PORT%/${DB_PORT}/" \ 49 | -e "s/%DB_NAME%/${DB_NAME}/" \ 50 | -e "s/%DB_USER%/${DB_USER}/" \ 51 | -e "s/%DB_PASS%/${DB_PASS}/" \ 52 | -e "s/%DB_PORT%/${DB_PORT}/" \ 53 | -e "s/%RDB_HOST%/${RDB_HOST}/" \ 54 | -e "s/%RDB_PORT%/${RDB_PORT}/" \ 55 | -e "s/%RDB_NAME%/${RDB_NAME}/" \ 56 | -e "s/%RDB_USER%/${RDB_USER}/" \ 57 | -e "s/%RDB_PASS%/${RDB_PASS}/" \ 58 | -e "s/%CACTI_URL_PATH%/${CACTI_URL_PATH}/" \ 59 | /cacti/include/config.php 60 | 61 | # attempt db upgrade via cli 62 | echo "$(date +%F_%R) [Upgrade] Attempting to update database via CLI." 63 | php /cacti/cli/upgrade_database.php 64 | 65 | fi 66 | 67 | # bootstrap, compile, and install spine 68 | echo "$(date +%F_%R) [Upgrade] Compile + Installing new version of Spine." 69 | cd /tmp/update/spine/* && \ 70 | ./bootstrap && \ 71 | ./configure --prefix=/spine && make && make install && \ 72 | chown root:root /spine/bin/spine && \ 73 | chmod +s /spine/bin/spine 74 | 75 | # copy templated config files, makes sed command easier 76 | echo "$(date +%F_%R) [Upgrade] Copying config templates for Spine." 77 | cp -f /template_configs/spine.conf /spine/etc 78 | 79 | # cacti settings 80 | echo "$(date +%F_%R) [Upgrade] Updating spine settings." 81 | sed -i -e "s/%DB_HOST%/${DB_HOST}/" \ 82 | -e "s/%DB_PORT%/${DB_PORT}/" \ 83 | -e "s/%DB_NAME%/${DB_NAME}/" \ 84 | -e "s/%DB_USER%/${DB_USER}/" \ 85 | -e "s/%DB_PASS%/${DB_PASS}/" \ 86 | -e "s/%DB_PORT%/${DB_PORT}/" \ 87 | -e "s/%RDB_HOST%/${RDB_HOST}/" \ 88 | -e "s/%RDB_PORT%/${RDB_PORT}/" \ 89 | -e "s/%RDB_NAME%/${RDB_NAME}/" \ 90 | -e "s/%RDB_USER%/${RDB_USER}/" \ 91 | -e "s/%RDB_PASS%/${RDB_PASS}/" \ 92 | /spine/etc/spine.conf 93 | 94 | # cacti settings 95 | echo "$(date +%F_%R) [Upgrade] Cleaning temp files." 96 | rm -rf /tmp/update 97 | 98 | # write note in cacti.log that a upgrade is complete 99 | echo "$(date +%F_%R) [Upgrade] Cacti upgrade complete!" >> /cacti/log/cacti.log 100 | 101 | echo "$(date +%F_%R) [Upgrade] Upgrade complete, please log into cacti to finish." 102 | --------------------------------------------------------------------------------