cacti-release-1.2.26/000077500000000000000000000000001454067461500143175ustar00rootroot00000000000000cacti-release-1.2.26/.github/000077500000000000000000000000001454067461500156575ustar00rootroot00000000000000cacti-release-1.2.26/.github/FUNDING.yml000066400000000000000000000043601454067461500174770ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ # These are supported funding model platforms github: [cacti, netniV] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] cacti-release-1.2.26/.github/ISSUE_TEMPLATE/000077500000000000000000000000001454067461500200425ustar00rootroot00000000000000cacti-release-1.2.26/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000016101454067461500225320ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: '' labels: 'bug,unverified' assignees: '' --- # Describe the bug A clear and concise description of what the bug is. ## To Reproduce Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error ## Expected behavior A clear and concise description of what you expected to happen. ## Screenshots If applicable, add screenshots to help explain your problem. ## Desktop (please complete the following information) - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] ## Smartphone (please complete the following information) - Device: [e.g. iPhone6] - OS: [e.g. iOS8.1] - Browser [e.g. stock browser, safari] - Version [e.g. 22] ## Additional context Add any other context about the problem here. cacti-release-1.2.26/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000012521454067461500235670ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for this project title: '' labels: 'enhancement' assignees: '' --- # Feature Request ## Is your feature request related to a problem? Please describe A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ## Describe the solution you'd like A clear and concise description of what you want to happen. ## Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. ## Additional context Add any other context or screenshots about the feature request here. cacti-release-1.2.26/.github/workflows/000077500000000000000000000000001454067461500177145ustar00rootroot00000000000000cacti-release-1.2.26/.github/workflows/oldissues.yml000066400000000000000000000071061454067461500224550ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ name: "Maintain old issues" on: schedule: - cron: '0 0 * * *' jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 60 days-before-close: 7 remove-stale-when-updated: true exempt-issue-labels: 'pinned, security, enhancement, future release' stale-issue-label: 'outdated' stale-issue-message: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. exempt-pr-labels: 'pinned, security, enhancement, future release' stale-pr-label: 'outdated' stale-pr-message: > This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. lock: runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v2.0.0 with: github-token: ${{ github.token }} repo-token: ${{ secrets.GITHUB_TOKEN }} issue-lock-inactive-days: '90' issue-exclude-created-before: '' issue-exclude-labels: 'future release' issue-lock-labels: '' # issue-lock-comment: > # This issue tracker has been automatically locked since there # has not been any recent activity after it was closed. Please # open a new issue for related bugs. # issue-lock-reason: 'resolved' issue-lock-reason: '' pr-lock-inactive-days: '90' pr-exclude-created-before: '' pr-exclude-labels: 'future release' pr-lock-labels: '' # pr-lock-comment: > # This pull request has been automatically locked since there # has not been any recent activity after it was closed. Please # open a new issue for related bugs. pr-lock-reason: '' process-only: '' debug-run: truecacti-release-1.2.26/.github/workflows/syntax.yml000066400000000000000000000235021454067461500217670ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ name: Cacti Commit Audit on: push: branches: [ 1.2.x ] pull_request: branches: [ 1.2.x ] permissions: contents: read concurrency: group: build-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: check: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] #ubuntu-20.04.04 currently php: ['5.4','7.0','7.4', '8.0', '8.1', '8.2'] experimental: [false] services: mysql: image: mysql:latest env: MYSQL_DATABASE: cacti MYSQL_HOST: 127.0.0.1 MYSQL_USER: cactiuser MYSQL_PASSWORD: cactiuser MYSQL_ROOT_PASSWORD: cactiroot ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 name: PHP ${{ matrix.php }} Test on ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v3 - name: Install PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring #optional ini-values: "post_max_size=256M, max_execution_time=60, date.timezone=America/New_York" #optional - name: Check PHP version run: php -v - name: Checkout Thold Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_thold' - name: Checkout Monitor Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_monitor' - name: Checkout MacTrack Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_mactrack' - name: Checkout FlowView Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_flowview' - name: Checkout Audit Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_audit' - name: Checkout Syslog Plugin uses: GuillaumeFalourd/clone-github-repo-action@v2 with: owner: 'Cacti' repository: 'plugin_syslog' - name: Move Plugins to Plugin Directory run: | mv plugin_thold ${{ github.workspace }}/plugins/thold mv plugin_monitor ${{ github.workspace }}/plugins/monitor mv plugin_mactrack ${{ github.workspace }}/plugins/mactrack mv plugin_audit ${{ github.workspace }}/plugins/audit mv plugin_flowview ${{ github.workspace }}/plugins/flowview mv plugin_syslog ${{ github.workspace }}/plugins/syslog # With syslog we have to enable batch installs using the lines below cd ${{ github.workspace }}/plugins/syslog cp -p config.php.dist config.php sed -i 's/\/\/\$syslog_install_options/\$syslog_install_options/g' config.php - name: Check PHP syntax run: if find ${{ github.workspace }} -name '*.php' -exec php -l {} 2>&1 \; | grep -iv 'no syntax errors detected'; then exit 1; fi - name: Install php-fpm if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests env: version: ${{ matrix.php }} run: | sudo service php$version-fpm start sudo service php$version-fpm status - name: Test php-fpm if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests env: version: ${{ matrix.php }} run: | # Copy php-fpm to a directory in PATH sudo cp /usr/sbin/php-fpm$version /usr/bin/php-fpm php-fpm -v - name: Install Apache and tools if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: sudo apt-get install apache2 snmp rrdtool - name: Enable Proxy FCGI if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: sudo a2enmod proxy_fcgi setenvif actions alias - name: Configure Apache Site if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cat ${{ github.workspace }}/tests/tools/cacti.conf | sed -r 's#GITHUB_WORKSPACE#${{ github.workspace }}#g' > /tmp/cacti.conf sudo cp /tmp/cacti.conf /etc/apache2/sites-available/000-default.conf - name: Open permissions for testing purposes if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: sudo chmod -R 777 ${{ github.workspace}} - name: Restart Apache2 if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: sudo systemctl restart apache2 - name: Create and Initialize Database if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests env: MYSQL_AUTH_USR: '--defaults-file=~/.my.cnf' run: | echo -e "[client]\nuser = root\npassword = cactiroot\nhost = 127.0.0.1\n" >> ~/.my.cnf cat ~/.my.cnf mysql $MYSQL_AUTH_USR -e 'CREATE DATABASE IF NOT EXISTS cacti;' mysql $MYSQL_AUTH_USR -e "CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser';" mysql $MYSQL_AUTH_USR -e "GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost';" mysql $MYSQL_AUTH_USR -e "FLUSH PRIVILEGES;" mysql $MYSQL_AUTH_USR cacti < ${{ github.workspace }}/cacti.sql mysql $MYSQL_AUTH_USR -e "INSERT INTO settings (name, value) VALUES ('path_php_binary', '/bin/php')" cacti - name: Prime Cacti config.php File if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cat ${{ github.workspace }}/include/config.php.dist | sed -r "s/localhost/127.0.0.1/g" > ${{ github.workspace }}/include/config.php sudo chmod 777 ${{ github.workspace }}/include/config.php cat ${{ github.workspace}}/include/config.php - name: Check install code for validity if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cd ${{ github.workspace }} sudo php -q tests/tools/check_install_code.php - name: Check that all CLI scripts have a valid --version flag if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cd ${{ github.workspace }} sudo bash tests/tools/check_cli_version.sh - name: Install Cacti through the CLI if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cd ${{ github.workspace }} sudo php cli/install_cacti.php --accept-eula --install --force - name: Install and Enable Plugins if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cd ${{ github.workspace }} sudo php cli/plugin_manage.php --plugin=thold --plugin=monitor --plugin=mactrack --plugin=audit --plugin=flowview --plugin=syslog --install --enable --allperms - name: Check all pages using recursive wget if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: | cd ${{ github.workspace }} echo -e "[client]\nuser = root\npassword = cactiroot\nhost = 127.0.0.1\n" > ${{ github.workspace }}/.my.cnf sudo tests/tools/check_all_pages.sh - name: View contents of logs if: ${{ '5.4' != matrix.php && '7.0' != matrix.php }} # removed old php from page tests run: sudo cat ${{ github.workspace }}/log/cacti.log # - name: Validate composer.json and composer.lock # run: composer validate --strict # - name: Cache Composer packages # id: composer-cache # uses: actions/cache@v3 # with: # path: vendor # key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} # restore-keys: | # ${{ runner.os }}-php- # # - name: Install dependencies # run: composer install --prefer-dist --no-progress # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" # Docs: https://getcomposer.org/doc/articles/scripts.md # - name: Run test suite # run: composer run-script test cacti-release-1.2.26/.gitignore000066400000000000000000000063701454067461500163150ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ # # For any folder that ignores all subcontent (/**), you # must MANUALLY use 'git add' to include a file as source # controlled. This is to prevent addition of local specific # content bleeding into cacti's main sources. # # Example # ------- # The themes and scripts folders ignore all contents # beneath them unless that content was already source controlled # so to add a new theme, or script, make sure to use 'git add' # before commiting changes. # # Themes # ------ # Themes have a special case where a theme folder that is # included in a cacti release has all content considered as # maintainable and as such are prefixed with an exclamation # mark (!include/theme/mytheme = do not ignore mytheme) # # Ignore vim swap files *.swp *.rnd # Ignore Cacti config include/config.php # Ignore Cacti log files/folders log/** # Ignore Cacti rrd files/folders rra/** # Ignore Cacti cache files/folders cache/** *.cache # Ignore Cacti plugin files/folders plugins/** # Ignore Cacti script files/folders scripts/** # Ignore Custom Cacti theme folders include/themes/* # Ignore custom stylesheet (applied on all themes) include/themes/custom.css # Do not ignore standard Cacti theme folders !include/themes/cacti !include/themes/carrot !include/themes/classic !include/themes/dark !include/themes/hollyberry !include/themes/modern !include/themes/paper-plane !include/themes/paw !include/themes/raspberry !include/themes/sunrise !include/themes/midwinter # Ignore any mac DS_Store files .DS_Store # Ignore .well-known folders (certbot) .well-known # Ignore language files locales/po/*.mo # Ignore CSRF secret file include/vendor/csrf/csrf-secret.php # Ignore visual studio code .vscode/** # Ignore vendor folders include/vendor/* vendor/* cacti-release-1.2.26/.mdl_style.rb000066400000000000000000000041321454067461500167160ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ # customize style guide all rule "MD010", code_blocks: false rule "MD013", code_blocks: false, tables: false rule "MD029", style: "ordered" rule "MD046", style: "fenced" # Lesser rules exclude_rule "MD010" # hard tabs #exclude_rule "MD013" # line length # Rule Exclusions exclude_rule "MD001" # Headers are useful in other ways exclude_rule "MD024" # Headers with same name are useful, but break link labeling (Rework needed on affected files before enabling this rule) exclude_rule "MD041" # YAML header is being flagged as not the first exclude_rule "MD046" # seems broken cacti-release-1.2.26/.mdlrc000066400000000000000000000031251454067461500154220ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ # mdl cli configuration style ".mdl_style.rb" verbose false cacti-release-1.2.26/CHANGELOG000066400000000000000000010405611454067461500155400ustar00rootroot00000000000000Cacti CHANGELOG 1.2.26 -security#GHSA-xwqc-7jc4-xm73: XSS vulnerability when importing a template file -security#GHSA-pfh9-gwm6-86vp: RCE vulnerability when managing links -security#GHSA-vr3c-38wh-g855: SQL Injection vulnerability when managing poller devices -security#GHSA-wc73-r2vw-59pr: XSS vulnerability when adding new devices -security#GHSA-q7g7-gcf6-wh4x: XSS vulnerability when viewing data sources in debug mode -security#GHSA-w85f-7c4w-7594: SQL Injection vulnerability when managing SNMP Notification Receivers -issue#5464: When viewing data sources, an undefined variable error may be seen -issue#5478: Improvements for Poller Last Run Date -issue#5481: Attempting to edit a Data Query that does not exist throws warnings and not an GUI error -issue#5483: Improve PHP 8.1 support when adding devices -issue#5485: Viewing Data Query Cache can cause errors to be logged -issue#5489: Preserve option is not properly honoured when removing devices at command line -issue#5490: Infinite recursion is possible during a database failure -issue#5492: Monitoring Host CPU's does not always work on Windows endpoints -issue#5493: Multi select drop down list box not rendered correctly in Chrome and Edge -issue#5494: Selective Plugin Debugging may not always work as intended -issue#5495: During upgrades, Plugins may be falsely reported as incompatible -issue#5496: Plugin management at command line does not work with multiple plugins -issue#5502: Improve PHP 8.1 support for incrementing only numbers -issue#5503: Allow the renaming of guest and template accounts -issue#5514: DS Stats issues warnings when the RRDfile has not been initialized -issue#5527: When upgrading, missing data source profile can cause errors to be logged -issue#5534: When deleting a single Data Source, purge historical debug data -issue#5542: Improvements to form element warnings -issue#5554: Some interface aliases do not appear correctly -issue#5555: Aggregate graph does not show other percentiles -issue#5561: Settings table updates for large values reverted by database repair -issue#5564: When obtaining graph records, error messages may be recorded -issue#5565: Unable to change a device's community at command line -issue#5572: Increase timeout for RRDChecker -issue#5573: When viewing a graph, option to edit template may lead to incorrect URL -issue#5581: When upgrading, failures may occur due to missing color table keys -issue#5583: On installation, allow a more appropriate template to be used as the default -issue#5585: When data input parameters are allowed to be null, allow null -issue#5586: CSV Exports may not always output data correctly -issue#5589: When debugging a graph, long CDEF's can cause undesirable scrolling -issue#5590: Secondary LDAP server not evaluated when the first one has failed -issue#5602: When adding a device, using the bulk walk option can make version information appear -issue#5609: When parsing a Data Query resource, an error can be reported if no direction is specified -issue#5612: Database reconnection can cause errors to be reported incorrectly -issue#5613: fix returned value if $sau is empty -feature#5577: Add Aruba switch, Aruba controller and HPE iLO templates -feature#5597: Add OSCX 6x00 templates 1.2.25 -security#GHSA-77rf-774j-6h3p: Protect against Insecure deserialization of filter data -security#GHSA-gx8c-xvjh-9qh4: Protect against Cross-Site Scripting vulnerability when creating new graphs -security#GHSA-6r43-q2fw-5wrg: Protect against Unauthenticated SQL Injection when viewing graphs -security#GHSA-6jhp-mgqg-fhqg: Protect against SQL Injection when saving data with sql_save() -security#GHSA-g6ff-58cj-x3cp: Protect against Authenticated command injection when using SNMP options -security#GHSA-q4wh-3f9w-836h: Protect against Authenticated SQL injection vulnerability when managing graphs -security#GHSA-gj95-7xr8-9p7g: Protect against Authenticated SQL injection vulnerability when managing reports -security#GHSA-v5w7-hww7-2f22: Protect against SQL Injection when using regular expressions -security#GHSA-4pjv-rmrp-r59x: Protect against Open redirect in change password functionality -security#GHSA-rwhh-xxm6-vcrv: Protect against Cross-Site Scripting vulnerability with Device Name when managing Data Sources -security#GHSA-24w4-4hp2-3j8h: Protect against Cross-Site Scripting vulnerability with Device Name when administrating Reports -security#GHSA-5hpr-4hhc-8q42: Protect against Cross-Site Scripting vulnerability with Device Name when editing Graphs whilst managing Reports -security#GHSA-vqcc-5v63-g9q7: Protect against Cross-Site Scripting vulnerability with Device Name when managing Data Sources -security#GHSA-9fj7-8f2j-2rw2: Protect against Cross-Site Scripting vulnerability with Device Name when debugging data queries -security#GHSA-6hrc-2cfc-8hm7: Protect against Cross-Site Scripting vulnerability with Data Source Name when managing Graphs -security#GHSA-hrg9-qqqx-wc4h: Protect against Cross-Site Scripting vulnerability with Data Source Name when debugging Data Queries -security#GHSA-r8qq-88g3-hmgv: Protect against Cross-Site Scripting vulnerability with Data Source Information when managing Data Sources -security#GHSA-rf5w-pq3f-9876: Protect against Privilege escalation when Cacti installed using Windows Installer defaults -issue#2959: When rebuilding the Poller Cache from command line, allow it to be multi-threaded -issue#4045: When searching tree or list views, the URL does not update after changes -issue#5254: When creating a Data Source Template with a specific snmp port, the port is not always applied -issue#5255: When a Data Query references a file, the filename should be trimmed to remove spurious spaces -issue#5258: THold plugin may not always install or upgrade properly -issue#5259: RRD file structures are not always updated properly, if there are more Data Sources in the Data Template than the Graph Template -issue#5263: When reindexing devices, errors may sometimes be shown -issue#5272: Boost may loose data when the database server is overloaded -issue#5275: Boost can sometimes output unexpected or invalid values -issue#5277: Boost should not attempt to start if there are no items to process -issue#5279: Rebuilding the poller cache does not always work as expected -issue#5282: Host CPU items may not work poll as expected when on a remote data collector where hmib is also enabled -issue#5283: When creating new graphs, invalid offset errors may be generated -issue#5291: When importing packages, SQL errors may be generated -issue#5298: When managing plugins from command line, the --plugin option is not properly handled -issue#5299: When automating an install of Cacti, error messages can be appear -issue#5300: When performing automated install of a plugin, warnings can be thrown -issue#5315: Automation references the wrong table name causing errors -issue#5317: Data Source Info Mode produces invalid recommendations -issue#5319: Data Source Debug 'Run All' generates too many log messages -issue#5323: The description of rebuild poller cache in utilities does not display properly -issue#5324: When reindexing a device, debug information may not always display properly -issue#5329: Upon displaying a form with errors, the session error fields variable isn't cleared -issue#5333: MariaDB clusters will no longer support exclusive locks -issue#5336: RRDtool can fail to update when sources in Data Template and Graph Template data sources do not match -issue#5338: Compatibility improvements for Boost under PHP 8.x -issue#5342: When searching the tree, increase the time before querying for items -issue#5347: Device Location drop down does not always populate correctly -issue#5354: When viewing Realtime graphs, undefined variable errors may be reported -issue#5355: SNMP Uptime is not always ignored for spikekills -issue#5356: Improve detection of downed Devices -issue#5360: When reporting missing functions from Plugins, ensure messages do not occur too often -issue#5364: When starting the Cacti daemon, database errors may be reported when there is no problem -issue#5366: When reporting from RRDcheck, ensure prefix is in the correct casing -issue#5371: Improve Orphaned Data Source options and display -issue#5372: Parsing the PHP Configuration may sometimes produce errors -issue#5376: Security processes attempt to check for a user lockout even if there is no user logged in -issue#5377: When attempting to edit a tree, the search filter for Graphs remains disabled -issue#5381: When reindexing, a Data Source that could be un-orphaned may not always be unorphaned -issue#5382: When parsing a date value, there could be more than 30 chars -issue#5384: Untemplated Data Sources can fail to update due to lack of an assigned Graph -issue#5386: When processing items to check, do not include disabled hosts -issue#5390: When saving a Data Source Template, SQL errors may be reported -issue#5392: When importing a Template, errors may be recorded -issue#5402: Some display strings have invalid formatting that cannot be parsed -issue#5403: When filtering with regular expressions, the 'does not match' option does not always function as expected -issue#5409: When enabling a plugin, sometimes it can appear as if nothing happens -issue#5413: Ensure the Rows Per Page option shows limitations set by configuration -issue#5414: Plugins are unable to modify fields in the setting 'Change Device Settings' -issue#5417: When reporting emails being sent, ensure BCC addresses are also included -issue#5420: Improve compatibility of SNMP class trim handling under PHP 8.x -issue#5426: When importing legacy Data Query Templates, the Template can become unusable -issue#5427: Provide ability to raise an event when extending the settings form -issue#5434: Prevent unsupported SQL Mode flags from being set -issue#5439: The DSStats summary does not always display expected values -issue#5440: When performing a fresh install, device classification may be missing. -issue#5446: Duplication functions for Graph/Template and Data Source/Template do not return and id -issue#5447: Duplication of Device Templates should be an API call -issue#5450: Unable to convert database to latin1 instead of utf8 if desired -issue#5451: When creating Graphs, the process may become slower over time as more items exist -issue#5452: When a bulk walk size is set to automatic, this is not always set to the optimal value -issue#5453: Update copyright notice on import packages -issue#5454: When viewing Orphan Graphs, SQL errors may be reported -issue#5457: When reindexing hosts from command line, ensure only one process runs at once -issue#5458: When a Data Query has no Graphs, it may not be deletable -issue#5459: When duplicating a Graph Template, provide an option to not duplicate Data Query association -issue#5460: When duplicating a Data Template errors can appear in the Cacti log -issue#5462: When importing a Package, previewing makes unexpected changes to Cacti Templates -issue#5466: When enabling boost on a fresh install, an error may be reported -issue#5467: Improve compatibility for backtrace logging under PHP 8.x -issue#5475: Improve compatibility for Advanced Ping under PHP 8.x -feature#5375: Provide new templates for Fortigate and Aruba Cluster to be available during install -feature#5393: Provide new template for SNMP Printer to be available during install -feature#5418: When importing devices, allow a device classification to be known -feature#5442: Extend length of maximum name in settings table -feature#5444: Extend length of maximum name in user settings table -feature#5448: Data Queries do not have a Duplication function -feature#5252: Upgrade d3.js v7.8.2 and billboard.js v3.7.4 -feature#5358: Upgrade ua-parser.js to version 1.0.35 -feature#5397: Update Cisco Device Template to include HSRP graph template -feature: New hook for device template change 'device_template_change' 1.2.24 -issue#5127: Unable to import Local Linux Machine template -issue#5134: Maximum Memory shows -1 instead of Unlimited -issue#5135: RRDcleaner and RRDcheck share the same filter details causing errors -issue#5136: When passed a null value, number_format_i18n() can return a invalid number -issue#5137: When attempting to update structured paths, SQL errors can occur -issue#5140: Compatibility changes for SNMP under PHP 8.2 -issue#5142: Fix issues with permission model and warnings -issue#5143: When a Device has zero Graphs or Data Sources, it does not display a value -issue#5145: Changing SNMP settings to None leaves Bulk Walk Maximum Repititions visible -issue#5147: Language handlers may not always be loaded properly -issue#5150: Wrong parameters are shown for the Import Package script -issue#5151: Templates appear to lose their suggested name values -issue#5159: When editing a tree, the tree can not be set to published -issue#5160: Translations on debian 'bookworm' systems may cause server errors -issue#5161: Switching language in the settings does not immediately become active -issue#5166: Plugin permissions may sometimes appear in the wrong section -issue#5167: Graph template for NetSNMP lmsensors missing -issue#5168: Import Package is misleading when reviewing Device Template Changes -issue#5169: Device failure and recovery dates can be misleading -issue#5170: Prevent remote polling functionality from running on main poller -issue#5174: When adding a new device, location is not being saved -issue#5180: Audit Database has issues with storage engine compare -issue#5181: When working with remote data collectors, some errors may be logged -issue#5182: Graph Image does not have check for Remote Agent -issue#5184: When a user has been deleted, checking permissions can cause errors -issue#5185: Repair Database does not prune old Poller Item Records -issue#5187: When calling plugin functions, errors can appear if they are not present -issue#5188: When filtering Device Templates, valid matches are not always shown -issue#5190: When using Gradient Support GPRINT Text Format is misaligned -issue#5194: CSRF directory needs to be writeable for creating the csrf-secret.php file -issue#5195: When removing spikes, errors can be recorded for NaN samples -issue#5196: Gradient support can break Graphs containing special characters -issue#5197: Unable to obtain realtime graph from remote poller -issue#5198: Compability Improvements for PHP Diff under PHP 8.x -issue#5199: When trying to obtain data, cacti should not long Transport Read errors -issue#5200: Compatibility improvements for Classic Tab images under PHP 8.x -issue#5201: Weathermaps can have issues rendering with some themes -issue#5202: When importing packages, Graph Size does not get updated to Graph Templates -issue#5203: Host Mib Device package can cause errors with NetSNMP scripts -issue#5204: Compatibility improvements for Audit Database under PHP 8.x -issue#5205: When using Diff Viewer, rendering is not always correct under certain themes -issue#5207: Compatibility improvements for Installer under PHP 8.x -issue#5208: Some i18n strings are not properly translated -issue#5209: When disabling a user, no log is recorded -issue#5211: When creating a new graph, undefined variable errors may be recorded -issue#5214: Basic Auth is timing out and logging users off automatically -issue#5223: When using callback form functions, name and id field may not be correctly set -issue#5224: When poller runtime is exceeded, time should be display as a rounded number -issue#5227: When debugging a data source, errors may be shown if no RRDfile created yet -issue#5232: Polling can appear delayed due to early statistics gathering -issue#5236: When viewing a graph, Edit Graph Template link may open wrong url -issue#5238: Searching for Poller Items can generates SQL Errors -issue#5239: Bulk Walk Maximum Repetitions may sometimes be ignored -issue#5241: Balance Process Load does not always apply properly -issue#5243: Template Export missing Graph Template columns `multiple` and `test_source` -issue#5245: Add additional security to the unserialize function -issue#5247: Rebuilding Poller Cache from Utilities does not respect poller interval due to lack or ordering 1.2.23 -security#4920: Add .htaccess file to scripts folder -security#5119: CVE-2022-46169 Unauthenticated Command Injection in Remote Agent -issue#4418: When using Single Sign-on Frameworks, revocation is not always detected in callbacks -issue#4682: New templates are not installed during the update -issue#4738: Improve PHP 8.1 support for Installer CLI -issue#4888: The database audit script fails to run properly on MySQL 8.0.29 -issue#4889: Increase host query performance by removing check for NULL -issue#4892: When many hosts go offline, Recache Event can be constantly logged -issue#4893: Real Time Counter can become stuck and does not count down -issue#4896: When remote poller is in offline mode, GUI can become inaccesible and poller can timeout -issue#4897: Technical support page on remote poller shows max connections of Main poller -issue#4903: Correct incompatibility between MySQL 8.x and Automation regular expressions -issue#4904: The recommendation for innodb_buffer_pool_instances is incorrect for MySQL 8 and MariaDB < 10.5 -issue#4905: Using colons in labels can break graphs with gradients -issue#4917: Real Time Counter can become stuck and does not count down -issue#4921: Some Aggregate graphs can be denied access incorrectly -issue#4923: Unable to duplicate a Graph template -issue#4927: Unable to audit the database if database password contains a bracket -issue#4934: Upgrade phpseclib to 2.0.37 -issue#4935: The 'Net-SNMP - Device I/O' template incorrectly sets a maximum value of zero -issue#4940: When sorting by hostname, database errors can be reported -issue#4941: When boost is running, graphs can appear broken -issue#4944: Packages should be signed with SHA256 as SHA1 is considered deprecated -issue#4947: When creating a Data Template, ensure that the default max value is always 'U' and not '0' -issue#4951: Plugins may not work correctly with Multi-Poller setups -issue#4960: Setting context for connections throws error in PHP 8.x -issue#4963: Wen calculating 95th percentile, floor() maybe used instead of ceil() incorrectly -issue#4964: Tree search does not correct hide non-matching tree objects -issue#4966: Device Template filters should show on used templates -issue#4971: MIB Parser can sometimes cause errors in later PHP versions -issue#4978: Boost may sometimes lose the Time Zone unexpectedly -issue#4980: Setting business hours can cause PHP errors -issue#4988: When creating RRD File, more data sources than expected may be defined -issue#4990: When viewing Links, errors can be generated -issue#4991: Updating a Data Template does not switch rrd_heartbeat properly for all sources leading to empty graphs -issue#4993: Data Debug Troubleshooter does not pick up invalid RRD_heartbeat settings -issue#4996: When managing graphs, Graphs can be listed multiple times incorrectly -issue#5001: Data Debug troubleshooter reports false positives with Missing Data Sources -issue#5006: Errors can occur when attempting to remove items from CDEF or VDEF's -issue#5012: When upgrading database at command line, some PHP errors may be seen -issue#5013: Automatically set Bulk Walk size when missing on a host -issue#5015: Upgrade for 1.2.21 reporting unknown status -issue#5017: SNMP Agent can cause unexpected errors due to implicit rounding -issue#5018: When using 'Remember me', session can still be forced to end unexpectedly -issue#5024: Escape char not properly replaced in snmp strings -issue#5028: Cacti User Stats script can throw errors unexpectedly -issue#5029: Searching for a plugin by name does not always work -issue#5030: Installer shows innodb unset in MariaDB 10.10+ -issue#5033: Improve PHP 8.1 support with Installer -issue#5034: RRD Proxy Server not supported by CLI script "structure_rra_paths.php" -issue#5041: Custom themes may cause errors if they do not contain all required CSS/JS files -issue#5057: When adding a device rule in automation, depreciated filters may be reported -issue#5066: Graph watermark is not escaped properly, leading to broken graphs -issue#5068: Improve PHP 8.2 support with Installer -issue#5084: When viewing trees, runtime errors may be recorded -issue#5088: When running script host_update_template.php, reindex method may incorrectly be changed to uptime -issue#5089: When numeric regex validation fails, no backtrace is logged -issue#5096: When the SNMP Agent is enabled, certain objects can result in errors appearing -issue#5097: RRDtool Utilities should not appear on Remote Data Collectors -issue#5101: When a remote poller fails, the recovery process may also fail -issue#5102: When in Recovery Mode, plugins that are designed to work remotely stop working -issue#5103: When Remote Data Collector changes status, a full page refresh or logout should occur -issue#5105: ss_host_disk.php php issue after upgrade PHP 8.1 (from 7.4) -issue#5107: Block installation if PHP has session.auto_start enabled -issue#5111: During boost processing, some DS Stats functions can cause errors -feature#1100: Structured path not created when using remote poller and Update On-Demand -feature#1392: Notify Admins that page errors exist even when using dynamic callbacks -feature#2239: Allow Import and Export to be more selective -feature#2485: Importing Template requires you to upload the same file after previewing -feature#2548: Add Head/Tail filtering of log for more efficient searches -feature#2567: The innodb sort buffer should be optimized for large tables -feature#2747: Allow more sorting options when managing Graphs -feature#2871: Report when RRA's heartbeat is below the data source profile's interval -feature#3131: Add utility feature to reindex hosts with bad indexes -feature#3578: Allow Re-indexing of Devices to be Scheduled -feature#4025: When importing a Template or Package, allow the user to ignore template and use the system default dimensions -feature#4239: On "Graph Utility View" add the name of and a link to the graph template which the graph is based on -feature#4417: Support execution of custom functions at poller bottom for remote pollers -feature#4754: The script ss_fping.php should timeout based on the host -feature#4762: Allow Package Import to be selective -feature#4786: Windows install does not support SVG rendering -feature#4820: When importing, make it possible to only import certain components -feature#4841: Move the `cactid` function `db_check_reconnect()` to `lib/database.php` for other service oriented scripts -feature#4874: Add support for Business Hours -feature#4890: Add multi threading for Poller recache script -feature#4899: Allow script server to be told when the main database when offline or in recovery -feature#4901: Make the script server accept arguments in the standard way -feature#4902: Increase compatibility with MySQL 8.x -feature#4907: Add lmSensors to the Net-SNMP Device Template -feature#4926: Allow the user to override Cacti's built-in Time Zone detection -feature#4943: Add ability to periodically check RRDfiles for errors in batch -feature#4948: When security cookie times out, redirection does not always occur properly -feature#4955: Provide memory tuning based upon MySQL Tuner recommendations -feature#4956: The function `db_check_reconnect()` should be able to work with any connection -feature#4957: Add Device Template categories to match the classes of the Package Plugin -feature#4965: When unlocking a tree, entire page should not need rebuilding -feature#4967: Make adding Associated Graph Templates and Data Queries easier to use -feature#4989: Improve table performance by caching 'Total Rows' using a hash -feature#5009: Allow SNMP Value OIDs to be parsed using regular expressions -feature: Adding ESXi Device Template -feature: Upgrade jQuery to version 3.6.1 -feature: Upgrade jQueryUI to version 1.13.2 -feature: Upgrade billboard.js to version 3.6 -feature: Introduce exec() function with timeout 1.2.22 -security#4834: When creating new graphs, cross site injection is possible -issue#4768: When creating user from template, multiple Domain FullName and Mail are not propagated -issue#4791: Nectar Aggregate 95th emailed report broken -issue#4796: Boost may not find archive tables correctly -issue#4802: Users may be unable to change their password when forced during a login -issue#4803: Net-SNMP Memory Graph Template has Wrong GPRINT -issue#4806: Search in tree view unusable on larger installations -issue#4808: Increased bulk insert size to avoid partial inserts and potential data loss. -issue#4810: Call to undefined function boost_debug in Cacti log -issue#4814: When no guest template is set, login cookies are not properly set -issue#4817: Later RRDtool releases do not need to check last_update time -issue#4818: Regex filters are not always long enough -issue#4819: Domains based LDAP and AD Fullname and Email not auto-populated -issue#4822: Cacti polling and boost report the wrong number of Data Sources when Devices are disabled -issue#4823: When editing Graph Template Items there are cases where VDEF's are hidden when they should be shown -issue#4831: Database SSL setting lacks default value -issue#4837: Update default path cacti under *BSD -issue#4840: Web Basic authentication not creating template user -issue#4846: Unable to change the Heartbeat of a Data Source Profile -issue#4849: Tree Search Does Not Properly Search All Trees -issue#4850: When structured paths are setup, RRDfiles may not always be created when possible -issue#4851: When parsing the logs, caching would help speed up processing -issue#4853: Deprecation warnings when attempting real-time Graphs with PHP8.1 -issue#4860: Custom Timespan is lost when clicking other tree branches -issue#4863: Non device based Data Sources not being polled -issue#4865: When Resource XML file inproperly formatted, graph creation can fail with errors -issue#4866: Update code style to support PHP 8 requirements -issue#4867: In Graph Management, filtering for "Device: None" shows all graphs -issue#4871: Realtime popup window experiences issues on some browsers -issue#4873: Auth settings do not always properly reflect the options selected -issue#4880: MySQL can cause cacti to become stalled due to locking issues -issue#4882: Boost process can get hung under rare conditions until the poller times out -issue#4884: Exporting graphs under PHP 8 can cause errors -issue#4887: Host table has wrong default for disabled and deleted columns -feature#4533: RRD storage paths do not scale properly -feature#4820: When importing, make it possible to only import certain components -feature#4825: Update change_device script to include new features -feature#4827: Make help pages use latest online version wherever possible -feature#4832: Cacti should show PHP INI locations during install -feature#4833: Detect PHP INI values that are different in the INI vs running config -feature#4870: Added Gradient Color support for AREA charts -feature#4872: Update CDEF functions for RRDtool -feature#4881: When boost is running, it's not clear which processes are running and how long they have to complete 1.2.21 -issue#4531: Correct duplicate keys within database -issue#4614: Add support for hooks during polling loop or at poller end -issue#4683: When adding a device, errors may be reported whilst updating templates -issue#4684: When creating RRD error image, font may not exist -issue#4685: Correct issues with corrupted Cacti Packages -issue#4687: Poller output not empty all the time -issue#4688: When running under PHP 5.4, certain operators are not valid -issue#4689: Package Import generates errors when you try to import directory or non-file -issue#4693: Correct issues with Heartbeat definitions under PHP 8.x -issue#4695: When importing packages, hash types are not properly processed -issue#4697: Login problem -issue#4698: When creating a device, unexpected poller down message may be shown -issue#4701: Editing a new user or user group may cause errors -issue#4705: Unable to automatically login using Remember Me option -issue#4707: Unable to duplicate graph templates due to missing column -issue#4716: Correct issues with Data Source Edit under PHP 8.x -issue#4719: Browsers may reject CactiTimeZone and CactiDateTime cookies due to SameSite requirements -issue#4721: Some JavaScript and image files URL are broken under midwinter theme -issue#4722: When upgrading from pre 1.x, various errors may be seen -issue#4726: When running under Fedora, issues may be seen with snmp values -issue#4729: Add ability for Template and Package Installs to update Suggested Name Values/Patterns -issue#4732: When using audit tool, text/mediumtext columns may not be properly processed -issue#4735: When changing data source profiles, errors may be shown -issue#4736: Update PHP recommendations to meet current expectations -issue#4743: When viewing graphs, fontawesome may not always been found -issue#4744: When using automation, numeric values may be treated as strings -issue#4748: When saving a device, errors may be generated -issue#4756: Importing very old Data Input Methods generate dependency warnings -issue#4757: Correct issues with Boost running under PHP 8.x -issue#4763: Unable to login locally when LDAP authentication enabled -feature#4720: Add a CLI script to install/enable/disable/uninstall plugins -feature#4740: Add log message when purging DS stats and poller repopulate 1.2.20 -security#4562: When using LDAP, authentication process may be bypassed -security#4576: Device, Graph, Graph Template, and Graph Items may be vulnerable to XSS issues -security#4579: Lockout policies are not properly applied to LDAP and Domain Users -security#4593: When using 'remember me' option, incorrect realm may be selected -security#4678: User and Group maintenance are vulnerable to SQL attacks -security#4679: Color Templates are vulnerable to XSS attack -issue#3816: When replicating data during installation/upgrade, system may appear to hang -issue#4363: Graph Template Items may have duplicated entries -issue#4435: Unable to Save Graph Settings -issue#4449: Script Server may crash if an OID is missing or unavailable -issue#4451: When system-wide polling is disabled, remote pollers may fail to sync changed settings -issue#4455: When updating poller name, duplicate name protection may be over zealous -issue#4457: Titles may show "Missing Datasource" incorectly -issue#4458: Checking for MIB Cache can cause crashes -issue#4460: Polling cycles may not always complete as expected -issue#4461: When viewing graph data, non-numeric values may appear -issue#4472: Utilities view has calculation errors when there are no data sources -issue#4475: Add support for PHP 8 -issue#4477: Remote pollers do not force connection when online -issue#4479: Rebuild Poller Cache CLI script should have filter options -issue#4480: Saving a bad Data Template can damage Data Sources -issue#4481: Reports still use Legacy attributes, despite having a format file -issue#4482: Graph Automation slowed by in-efficient index selection -issue#4491: When rebuilding poller cache, SNMP settings do not properly update -issue#4492: When an OID starts with space, SNMP returns undefined data -issue#4495: Datasource Statistics may obtain invalid data for some rebooted devices -issue#4498: When attempting to calculate width, some input elements may cause console errors -issue#4500: Datasource Statistics may not scale properly on larger systems -issue#4508: Changing Multi-Device SNMP settings may not work as expected -issue#4509: Updating Items for a Graph Template may be slow on larger systems -issue#4511: When using the time-based view, SVG Graphs may not resize properly -issue#4512: When using API calls, graphs without data sources may be unremovable -issue#4516: Add additional information to help when creating graphs from templates -issue#4519: When remote host poll fails, poller ID may not be found and cause errors -issue#4521: Backtraces Logged in Cacti 1.2.x Branch - Gettext Translation -issue#4522: When entering custom input, layout issues may be seen -issue#4528: When creating a device, default setting for Device Threads may be ignored -issue#4529: Primary Admin account notifications may not work in certain cases -issue#4530: On larger systems, user interface for reporting may become unusable -issue#4536: When using Web Basic Authentication, user is always mapped as guest. -issue#4539: When handling plugin dependancies, notices may not be displayed properly -issue#4540: Certain account types should not allow their enabled status to be changed -issue#4543: Emails sent multiple times to the same address can be rejected -issue#4545: Reports Tab always shows 'Administration' despite a users permissions -issue#4546: When unauthorized, user may be redirected instead of notified -issue#4547: Add debug options to LDAP for diagnostic purposes -issue#4548: Rounding causes errors with variable substitution -issue#4549: Boost may become disabled due to an invalid path -issue#4551: Add support for PHP 8 -issue#4552: Error messages are not always cleared, resulting in duplicated messages. -issue#4554: Add support for Automation under PHP 8 -issue#4557: When selecting a Consolidation Function, errors may be reported -issue#4563: Breadcrumbs not always display the correct path -issue#4564: When clicking tabs, page may not always respond -issue#4567: Editing current user should prevent changes of account status -issue#4568: Authentication cache does not always use the correct realm -issue#4569: When editing users or groups, template permissions may not work as intended -issue#4571: When changing authentication method, unneeded settings may not be hidden -issue#4572: When basic authentication is used, login screen should not be seen -issue#4573: On larger systems, permission checks may render system unusable -issue#4575: When you delete a user, cookie data is not automatically removed -issue#4577: When editing current user, last administrator may be removed -issue#4578: The Cacti login algorithm is complicated to understand due to too much strait line code -issue#4580: When using Web Basic Authentication, users may be seen as guests -issue#4586: When viewing graphs, excess database queries may occur -issue#4587: Settings may be read more often than required -issue#4588: Unable to save host with multi-byte characters -issue#4589: When updating tables, ensure engine, row_format and charset -issue#4594: When selecting font, attempt to use system-based font before internally supplied version -issue#4597: Selective Device Debug does not work with Remote Data Collectors -issue#4598: Plugin tab does not stay visible when main poller is offline -issue#4603: When failing back to PHP GetText, module is not always selected -issue#4607: Configuration file may be improperly moved into the resource cache -issue#4609: When handling sessions, user agent may not always be present -issue#4610: When hiding disabled devices, some may still be shown -issue#4611: When replicating to remote pollers, plugins are not always properly sync'd -issue#4612: When using cookie authentication, Same Site support does not always work properly -issue#4613: Newer versions of MySQL/MariaDB may prevent structure replication changes -issue#4614: Add support for hooks during polling loop or at poller end -issue#4615: Plugin status on a Remote Data Collector may not always be detectable -issue#4616: When performing certain plugin actions, replication should be forced to Remote Collectors -issue#4617: When removing a plugin, removed tables are not removed from remote pollers -issue#4618: When plugin exceed runtimes, they should not be automatic disabled -issue#4620: When using CLI, Remote Data Collector scripts may connect to the wrong database -issue#4623: Boost does not operate as it should in certain situations -issue#4624: System uptime may be missing under certain circumstances -issue#4629: When removing many Graphs and Data Sources, polling cycles may overrun -issue#4630: Session data is not always started correctly -issue#4632: When creating a Datasource, Input Field Checking is not always enforced -issue#4634: When using Basic Authentication, the Logout Everywhere button should not be shown -issue#4645: When format file does not exist, changing certain settings may result in errors -issue#4651: Device Description is not consistent in Poller Cache view -issue#4652: After repopulating graph, navigation to check cumbersome -issue#4654: When saving a data template, replication may cause errors -issue#4658: When upgrading from pre-1.0, tree information may not properly update -issue#4659: When moving a device between pollers, errors may occur -issue#4666: Add date calculation support for PHP 8 -issue#4671: Add poller sleeping support for PHP 8 -issue#4672: When editing Reports, drag and drop may not function as intended -issue#4680: When data drive is full, viewing a Graph can result in errors -feature#4574: On larger systems, permissions may need alternative methods -feature#4631: When creating a Data Source Profile, allow additional choices for Heartbeat -feature#4636: Upgrade jQueryMulti-select to 3.0.1 -feature#4637: Change select all options to use Font Awesome icons -feature#4641: Improve spine performance by storing the total number of system snmp_ports in use -feature#4663: Prevent Template User Accounts from being Removed -feature#4664: When managing by users, allow filtering by Realm -feature#4665: Allow plugins to supply template account names -feature#4667: When viewing logs, additional message types should be filterable -feature#4668: When creating a Graph Template Item, allow filtering by Data Template -feature#4669: Allow language handler to be selected via UI -feature#4673: Updated Device packages for Synology, Citrix NetScaler, Cisco ASA/Cisco -feature#4674: Add Advanced Ping Graph Template to initial Installable templates -feature#4675: Add LDAP Debug Mode option -feature#4676: Allow Reports to include devices not on a Tree -feature#4677: Allow Basic Authentication to display custom failure message 1.2.19 -security#4356: Further fixes for grave character security protection -issue: Over aggressive escaping causes menu visibility issues on Create Device page -issue#3787: Add SHA256 and AES256 security levels for SNMP polling -issue#4289: Import graph template(Preview Only) show color_id new value as a blank area -issue#4341: Editing graphs can cause errors due to missing sequence -issue#4342: When hovering over a Tree Graph, row shows same highlighting as Graph Edit screen -issue#4343: When RealTime is not active, console errors may appear -issue#4347: Race conditions may occur when multiple RRDtool processes are running -issue#4352: Creating graphs from templates may sometimes result in errors -issue#4353: When duplicating reports, errors may occur -issue#4375: Boost may be blocked by overflowing poller_output table -issue#4378: Template import may be blocked due to unmet dependency warnings with snmp ports -issue#4381: Newer MySQL versions may error if committing a transaction when not in one -issue#4382: SNMP Agent may not find a cache item -issue#4383: Correct issues running under PHP 8.x -issue#4391: When polling is disabled, boost may crash and creates many arch tables -issue#4396: When poller runs, memory tables may not always be present -issue#4400: Removal of redunant code -issue#4403: Timezones may sometimes be incorrectly calculated -issue#4404: Allow monitoring IPv6 with interface graphs -issue#4408: When a data source uses a Data Input Method, those without a mapping should be flagged -issue#4410: When RRDfile is not yet created, errors may appear when displaying the graph -issue#4419: Cacti missing key indexes that result in Preset pages slowdowns -issue#4420: Data Sources page shows no name when Data Source has no name cache -issue#4421: db_update_table function can not alter table from signed to unsigned -issue#4422: data remains in poller_output table even if it's flushed to rrd files -issue#4423: Parameter list for lib/database.php:db_connect_real() is not correct in 3 places -issue#4424: Offset is a reserved word in MariaDB 10.6 affecting Report -issue#4425: Rendering large trees slowed due to lack of permission caching -issue#4428: Error on interpretation of snmpUtime, when to big -issue#4431: Applying right axis formatting creates an error-image -issue#4435: Unable to Save Graph Settings from the Graphs pages -issue#4437: Graph Template Cache is nullified too often when Graph Automation is running -issue#4438: When Adding a Data Query to a Device, no Progress Spinner is shown -issue#4439: New Browser Breaks Plugins that depend on non UTC date time data -issue#4440: Undefined index: timeout_exceed /lib/poller.php on line: 1953 -issue#4442: When testing remote poller connectivity Errors occour -issue#4443: When renaming poller errors occour -issue#4444: Removing spikes by Variance does not appear to be working beyond the first RRA -issue#4445: LDAP API lacks timeout options leading to bad login experiences -issue#4525: When using CMD for polling, pipes are not properly referenced for PHP scripts -feature: Add a normal/wrap class for general use -feature: Limit File Types available for Template Import operations -feature#1573: Cacti does not provide an option of providing a client side certificate for LDAP/AD authentication -feature#3113: Support Stronger Encryption Available Starting in Net-SNMP v5.8 -feature#4299: Allow Cacti to use multiple possible LDAP servers -feature#4344: Add a 15 minute polling/sampling interval -feature#4385: Provide additional admin email notifications -feature#4390: Add warnings for undesired changes to plugin hook return values -feature#4409: When creating a Graph, make testing the Data Sources optional by Template -feature#4412: Update phpseclib to 2.0.33 -feature#4413: Update jstree.js to 3.3.12 -feature#4414: Improve performance of Cacti poller on heavily loaded systems -feature#4426: MariaDB recommendations need some tuning for recent updates 1.2.18 -security#4261: Lack of escaping on template import can lead to XSS exposure under 'midwinter' theme (CVE-2020-14424) -security#4276: Real time graphs can expose XSS issue -security#4282: Session IDs are not always recreated when logging out under PHP 5 -issue#4250: Unable to create graphs due to Data Source verification failure -issue#4254: When poller first runs, time since last run produces an error -issue#4259: Data Template caching does not update and causes errors -issue#4263: Graphs with multiple data sources can no longer display percenticles -issue#4266: Incomplete items from a previous polling session may be updated twice -issue#4267: Unnecessary warnings appear when host name is not resolved -issue#4269: Installation Wizard can become stuck when creating graphs for default device -issue#4271: Continued timeout of registered processes -issue#4272: Unexpected errors may appear when using hostnames without a DNS domain -issue#4273: When adding a device from command line, testing of data sources can cause errors to be recorded -issue#4274: When you start to zoom a graph, the auto graph refresh should be disabled -issue#4279: Default Setting "Device Threads" will not be saved correctly -issue#4284: Whilst upgrading, errors in upgrade scripts prevent properly execution -issue#4293: Tree search does not take hosts belonging to a site into account -issue#4294: Tables outside of pre-built list that need fixing, cause bad unknown column errors -issue#4295: If a page contains multiple tables, a larger table can cause small ones to lose columns -issue#4297: Unable to search using regular expressions when trying to filter graphs -issue#4312: When using CMD.PHP as the poller, warnings can appear if you only use a subset of data input types -issue#4314: When disabling the snmpagent, you can introduce significant delay to data collection -issue#4315: Reduce repeatative warnings when resources are exhausted -issue#4316: Remove Spikes CLI interface is unable to provide localized spike, gap fill or float operations -issue#4321: Earlier versions of RRDTool do not correctly ignore previous updates -issue#4324: Date/Time format of replacement field on graph cannot be changed -issue#4325: When editing graph items, make identifying rows easier -issue#4326: When using large lists, ensure selection is visible in dropdown menus -issue#4330: Automation attempts to call undefined debug function -issue#4333: Under FreeBSD, allow ping to work properly for IPv6 -issue#4367: Report owner - show at least the username when the full name is empty -feature#4258: Update phpseclib to 2.0.31 -feature#4283: Content Security Policy may block Plugin functionality -feature#4317: Allow the Cacti administrator to perform bulk gap filling and floating in parallel -feature#4322: Update pace.js to version 1.2.4 1.2.17 -security#4019: Incorrect handling of fields led to potential XSS issues -security#4022: SQL Injection was possible due to incorrect validation order (CVE-2020-35701) -security#4035: Various XSS issues with HTML Forms handling -issue: CLI scripts should not have a max allowed runtime -issue: Normalize plugin hooks between user_admin.php and user_group_admin.php -issue#1052: TimeZones are not handled correctly with Daylight Savings changes -issue#3392: Allow plugins to customize device listing page -issue#3879: Allow Graph/Data Source with custom fields to prompt during manual creation -issue#3908: When poller overruns the script server can throw errors upon shutdown -issue#3936: Editing a graph created from Aggregate Graph can fail -issue#3945: CSV export can show NaN for date if TimeZone does not match system -issue#3969: SNMPv3 Password field does not correctly limit to size of database field -issue#3976: Font colors are being overridden leading to display issues -issue#3977: Database upgrade may fail when using upgrade_database.php -issue#3978: Input Validation was not handled correctly when displaying graph trees -issue#3981: Missing API include leads to runtime errors in Automation -issue#3985: Collation was not always handled correctly in the database library -issue#3988: Automation raises errors when default snmp options is set to none -issue#3990: PHP Information was not being displayed properly under Tech Support -issue#3999: Ensure database audit code attempts to use passwordless options before sending credentials -issue#4001: Ensure Cacti can support PHP 8 -issue#4002: Pollers may sometimes not recover properly once they go offline -issue#4005: When viewing Realtime Graphs, validation errors may be seen for Size parameter -issue#4008: Massive decrease in poller performance due to unset variable -issue#4009: Ensure number format functions are consistent for i18n usage -issue#4021: Increase maximum number of device threads -issue#4031: Secondary filters on Data Collectors and Data Profiles do not work as expected -issue#4033: Action Icons changed to be consistent with admin UI -issue#4036: During discovery, Automation can throw unexpected errors due to null values -issue#4038: When creating new graphs, a second click is required even if not needed -issue#4042: RRD Updates can become disabled when saving performance options -issue#4043: Boost can become unresponsive when large number of archive tables exist -issue#4049: Enable sensitive graph information to be hidden from standard users -issue#4050: When showing table conversion script, the example path can be displayed incorrectly -issue#4056: Rename "Show Exceptions" checkbox to "Only Show Exceptions" which more actually reflects its function -issue#4060: When attempting to get client address, incorrect information may be returned -issue#4061: When getting date format, default options are not always honored -issue#4066: Enable Boost to utilize multiple processes -issue#4067: Disable BOOST image caching when using Graph Zoom features -issue#4068: When viewing graphs, individual graph sizes can be ignored in favour of global default -issue#4070: Summary data can fail to calculate when the RRDfile lacks the Data Source -issue#4073: Zoom functionality can fail when a graph has lost focus. -issue#4074: Realtime Images are not always adhering to defined format -issue#4075: LDAP Settings lead to confusion when setting up LDAP authentication -issue#4076: MariaDB tuning link points to a dead URL within System Utilities -issue#4077: If user has no permissions assigned and tries to login, a redirect loop occours -issue#4079: When checking current timestamps, make audit replace mysql function usage with preferred CURRENT_TIMESTAMP variable -issue#4080: Cacti regular expression searching does not quote expressions -issue#4082: RRDtool version detection not working for RRDproxy setup -issue#4083: RRDCleaner does not support RRDproxy -issue#4086: Large system performance negatively impacted due to $spikekill_templates behavior -issue#4092: On large systems, Primary ID usage on heavily used tables will overflow due to default MySQL variable size -issue#4095: When viewing Plugins page, icons can sometimes be misaligned -issue#4098: Graphs and Data Sources lists can become unresponsive on very large systems -issue#4100: When viewing User Admins, a division by zero error can sometimes be seen -issue#4105: Allow admins to define bulk walk repetition sizes -issue#4109: Realtime graphing can sometimes cause gaps in historic data -issue#4110: Graph Variables are not always parsed correctly leading to errors in log files -issue#4116: Upgrading large trees from 0.8.x to 1.x is slow -issue#4117: Script server throws errors if a command line argument includes a backslash -issue#4119: Implicit flushing is not always enabled, depending on OS, resulting in Script Server result issues -issue#4121: LDAP search filter cannot be configured if too many OUs or filters are nested -issue#4122: Automation causes SQL syntax errors when invalid operations are present -issue#4125: On completing the installation wizard, an internal server error can sometimes be observed -issue#4126: Deleting a damaged graph can sometimes led to removal of valid graphs too -issue#4127: When updating Trees, graph titles are calculated too often leading to unresponsiveness -issue#4130: On large systens, Graph creation can become unresponsive due to large number of data sources -issue#4131: A design flaw makes importing new Graph Template slow on large systems -issue#4134: MIB Caching does not always work as expected -issue#4135: On large Cacti installs, editing Data Templates is slow -issue#4136: When repairing database at command line, no option exists to skip table checks and force Data Source repair -issue#4141: Unusually long comments do not wrap when viewing graphs, and haven't in this CHANGELOG entry either -issue#4143: Prevent some false positive scenarios when detection orphan graphs -issue#4147: Poller items are evaluated too quickly when mixed polling cycles are used -issue#4148: Ensure automatic refresh of cacti log view works consistently -issue#4149: Ensure utilities show correct information when in offline mode -issue#4161: Data source template names should be shown in the respective "suggested values" sections -issue#4162: Allow Persistent Connections to MariaDB/MySQL to be configured -issue#4164: Unable to easily track Cacti login sessions when using database sessions -issue#4166: Auto-select text when focusing auto complete elements -issue#4169: Ensure Log Viewer 'Go' and 'Clear' buttons behave as expected -issue#4170: Enable full name tooltips for Alias/Description columns -issue#4173: Ensure Console menu icons are properly aligned -issue#4174: When using replication, ensure binary logging can be disabled -issue#4175: When syncing Templates, prevent false 'Damaged Graph' notifications from appearing -issue#4177: Simplify Graph/Template authorization searches when not using restricted mode -issue#4179: Correct class usage on Graph Sidebar Icons to be consistent -issue#4180: Remove logoff option when using basic authentication -issue#4181: Ensure realm names are more consistent -issue#4182: Allow Automatic Graph Creation to utilise Data Templates with Overriden Values -issue#4183: Processes can be terminated early due to incorrect timeout calculation -issue#4184: Ensure error logging is consistent when using CMD processor instead of spine -issue#4185: Updating Signal Handling to recommended standards for PHP 7.1+ -issue#4186: When editing a Fixed String on Tree Rule it is improperly displayed as "Unknown" -issue#4187: Provide more direct method fo navigating to Data Source from Graph -issue#4188: Replacement variable names are difficult to find for Aggregate Graphs and Templates -issue#4189: Allow links from a page to its specific documentation -issue#4190: Augmenting roles can incorrectly link to roles instead of realms in rare cases -issue#4192: Devices search can return a black screen if device name contains the hash/pound # character -issue#4193: Allow command line reindex to work with disabled devices -issue#4195: When search text includes # character, filtering does not always work as expected -issue#4197: When attempting to do a rollback on versions, the installer will not restart -issue#4199: Allow Cacti administrator to define a min refresh interval to prevent graph gaps -issue#4205: When removing Data-query Associated Graph Templates, it deletes the graphs Templates from bottom to top -issue#4206: When a report was delayed, the report's time is incorrectly changed -issue#4215: Poller recovery starts multiple processes and fails to recover properly -issue#4223: Parallel boost restart due to timeout can result in errors. -issue#4227: When remote poller is in offline mode, data is written to more tables than necessary -issue#4228: Under specific circumstances, redirection issues can occur after login -issue#4229: When no snmp option is set, automation can incorrectly report a number of issues -issue#4232: Database TLS configuration requires client certificates as well -issue#4233: Potential typos and incomplete parameter lists for database connection variables -issue#4241: Tree sort mechanism does not take sites into account -issue#4251: Caching of Graph Titles can be incorrect -feature: Add Theme 'Midwinter' -feature: Update phpseclib to version 2.0.30 -feature#645: Modify automation to test for data before creating graphs -feature#3513: Add hooks for plugins to show customize graph source and customize template url -feature#3572: Missing prompts during automation's device creation leads to blank data -feature#4012: Allow CSRF security key to be refreshed at command line -feature#4013: Allow remote pollers statistics to be cleared -feature#4113: Allow user to be automatically logged out after admin defined period -feature#4176: When replicating, ensure Cacti can detect and verify replica servers -feature#4210: Replace c3.js with billboard.js 1.2.16 -issue#3704: When generating a report, the Cascade to Branches function does not as expected -issue#3859: When viewing graphs, automatic refresh so not always work as expected -issue#3898: Realtime graph pop up counter bug -issue#3903: Undefined variable errors may occur when creating a new datasource -issue#3907: The cli-based installer does not exit with a non-zero exit code when error occurs -issue#3912: When an export is complete, sometimes the progress bar remains -issue#3915: When enabling many devices, a threshold can be reached causing a slowdown in the process -issue#3916: When performing actions against Devices, replicated device information could sometimes be lost -issue#3917: When using API to rename a tree node, backtrace may be incorrectly shown -issue#3919: When searching, valid pages can sometimes be shown as empty -issue#3920: When exporting data from graphs, not all data was properly included -issue#3924: Graph Templates filter is not updated after new graph created -issue#3926: Username and password on the login page is not visible in Classic theme -issue#3929: Improve wording of concurrent process and thread settings -issue#3930: Location filter should remove blank entries -issue#3931: When syncing data collectors, a reindex event may be triggered unnecessarily -issue#3932: Automation Networks allows discovery of invalid IP addresses -issue#3933: When changing permissions of the current user, they don't take effect immediately -issue#3935: When reindexing a device, an incorrect page was sometimes displayed -issue#3942: When repairing database, audit_database.php does not add missing columns -issue#3948: Spine 1.2.15 - Spine Encountered An Unhandled Exception Signal Number: '6' [11, Resource temporarily unavailable] (Spine thread) -issue#3949: Log page should not be empty if no log info exists -issue#3953: During upgrade, there are times when realms can be duplicated leading to SQL errors -issue#3957: When using ping.php, UDP response times are not interpreted properly -issue#3960: Improve warning you get when attempting to view a log file you don't have access to -issue#3962: When replicating files, scripts are not marked as executable -issue#3963: When creating plugin tables, collation is not set properly -feature: Update c3.js to version 0.7.20 -feature: Update Chart.js to version 2.9.4 -feature: Update phpseclib to version 2.0.29 -feature: Update PHPMailer to version 6.1.8 -feature: Use LSB shebang notation for cli scripts -feature: Add support for cactid daemon based launcher -feature#3923: Add ability to hide the Graph Drilldown icons -feature#3943: Add hooks for plugins to show custom Graph Source and custom Template URL (List View) 1.2.15 -issue#3643: When editing Maximum OIDs Per Get Request, blank value can cause errors -issue#3656: Boost may run more often than it should -issue#3693: Recache Event Loop can cause Interface Graphs to show gaps -issue#3703: When searching Graph Tree's, non matching devices remain visible -issue#3711: Page validation errors may occur when opening real time graphs -issue#3722: External Links do not always open if they are still open from previous usage -issue#3730: Cultural changes to various word usage -issue#3741: Replicate deleted device status instead of poller sync -issue#3743: Description field allows more characters entered than is stored -issue#3747: When installing or upgrading, LDAP functions may not always be included properly -issue#3748: Unable to remove discovered device -issue#3753: When installing or upgrading, PHP recommendations may not always return a valid value -issue#3755: Graph Templates has duplicate SQL delete statement -issue#3759: When syncing to remote poller, missing function errors may occur -issue#3760: When removing devices from remote pollers, devices may reappear without details -issue#3761: When removing devices, array errors may sometimes be recorded -issue#3763: Variable injection does not always work as expected -issue#3764: Editing Data Queries with multiple data templates can give errors about Suggested values -issue#3767: Progress bar does not provide enough visual information during long page loads -issue#3768: Some themes do not allow for a way to see which user is currently signed in -issue#3769: When viewing tables, allow users to force all columns to be visible -issue#3770: Column sizing is being lost between pages refreshes -issue#3771: When viewing input methods table, no ID is shown to help identify which method is being viewed -issue#3775: Filters do not always respect using keyboard to initiate searching -issue#3778: When exporting a data query, an invalid column name error can sometimes be shown -issue#3781: When checking if a view is allowed, having no session can result in errors -issue#3782: When removing devices via the CLI, undefined variable errors may be seen -issue#3786: Real Time Graphs may cause invalid index errors -issue#3790: On newer versions of MySQL/MariaDB, 'system' keyword can cause issues -issue#3793: Plugin setup can generate errors when reading options via system function -issue#3809: Plugin version numbers can be unexpectedly truncated -issue#3815: When PHP Session is set to autostart, an error can be reported as Cacti attempts to start it -issue#3820: When removing multiple items, selection process does not always work -issue#3821: When exporting colors, the indicator is not always removed upon completion -issue#3825: Unable to pass tree and leaf ID to 'graph_button' hook -issue#3827: When performing maintenance, various errors may sometimes be seen -issue#3828: When Guest User setting is active, current user is not always properly set -issue#3831: When installing Cacti, minor errors in text can be seen -issue#3835: Numbers are not always formatted properly when there are no decimal places -issue#3836: When viewing Real Time Graphs, an undefined index error may be recorded -issue#3844: Minor memory leaks and refresh issues when zooming on graphs -issue#3847: Real Time Graphs may sometimes fail due to folder permissions -issue#3849: Navigation can sometimes occur unexpectedly due to background timers -issue#3850: Trees management screen not reporting correct number of trees -issue#3858: Tree sequences can sometimes skip numbers during resorting -issue#3862: Guest user selection should not allow setting the currently logged in user -issue#3864: Links in Table Headers do not show clearly when in modern theme -issue#3868: Under some cases tree logic leads to undefined index errors -issue#3869: Cacti Data Debug can show errors if the Data Source is damaged or has been removed -issue#3871: When importing a data query, an invalid column name error can sometimes be shown -issue#3874: When using shift functions on graphs, negative values are not allowed -issue#3881: Correct issue when file is unreadable reporting no file was specified -issue#3883: Orphaned Plugins have no option to be removed -issue#3884: Update MySQL recommendations for Character Set and Colation -issue#3888: Correct sorting of IP addresses to be numeric not alpha -issue#3890: Saving a device should not always repopulate the poller cache -feature: Update FontAwesome to Version 5.14 1.2.14 -issue#3676: Device not showing up in device page but showing up in Monitor tab -issue#3678: More or Equal incorrect highlighting max_heap_table_size and tmp_table_size -issue#3694: Spikekill `percent` is converted from percent to decimal twice, making it 1/100 of the true size -issue#3713: When sorting data debug checks by user, no results are shown and errors recorded -issue#3719: When tooltip is too long, the scroll bar exists, and cannot be scrolled, which makes the tooltip be hided -issue#3723: Improper escaping of error message leads to XSS during template import preview -issue#3728: Invalid uptime is not handled properly -issue#3737: Poller functions may not run if 'processes' table is missing -feature#3615: Poller keeps using old IP address for a device 1.2.13 -security#3544: jQuery XSS vulnerabilities require vendor package update (CVE-2020-11022 / CVE-2020-11023) -security#3549: Lack of escaping on some pages can lead to XSS exposure (CVE-2020-23226) -security#3582: Update PHPMailer to 6.1.6 (CVE-2020-13625) -security#3622: SQL Injection vulnerability due to input validation failure when editing colors (CVE-2020-14295) -security#3628: Lack of escaping on template import can lead to XSS exposure -issue#3517: When generating reports, function looping can occur resulting in 100% cpu usage -issue#3525: When viewing Graphs, zoom functionality prevents drag and drop of image -issue#3527: When using 95th Percentiles, undefined index errors can be generated -issue#3532: When using Realtime, if no graph contents are present an error is generated -issue#3533: When exporting data, Start date for RRDfile does not match start date of first data row -issue#3536: When using Navigation Menu, Show/Hide in Response mode does not always work -issue#3538: When using Realtime, race conditions between browser and function loading can occur -issue#3543: When exporting CSV data, Unicode prefix is not properly set -issue#3551: Authentication can fail when using Web Basic Authentication and Template User -issue#3553: When attempting to view an aggregate graph that does not exist, many errors are generated -issue#3563: Current orphan handling disrupts graphing transient indexes -issue#3566: Automation incorrectly attempts to use MacTrack to duplicate options -issue#3567: When Boost runs, locks are not always released properly and crash is detected -issue#3569: Invalid font results in large number of log entries -issue#3571: Correct various runtime errors due to incorrect message variables -issue#3574: Saving Graph Template Items take a long time on large systems -issue#3577: Hosts are being incorrectly filtered when first displaying with filter set to all -issue#3579: Graphs can incorrectly show as 'Empty Graph' -issue#3581: Realtime graph window is not resizing properly -issue#3588: Validation warnings are generated when viewing/editing devices -issue#3594: Automation hangs for certain schedule types -issue#3595: Template to Device sync text is not consistent -issue#3596: When importing template, resources aren't checked properly -issue#3597: Template to Device sync provides no feedback -issue#3598: When editing graphs and graph templates, back button results in broken page -issue#3599: When downgrading, templates are fully selected for install -issue#3601: When a device is down, instate can show wrong time -issue#3607: When session timeout occurs, subsequent authorized access to areas can become blocked -issue#3611: Allow CHANGELOG to be viewable from the GUI -issue#3613: When modifying trees, devices and graphs lists ignore Autocomplete Rows setting -issue#3614: When section tabs wrap, the title of the first section can become obscured -issue#3624: When previewing graphs, sometimes the images fail to appear -issue#3629: Log files are not rotated properly on remote pollers -issue#3631: Command line scripts do not allow an unlimited runtime causing timeouts -issue#3632: When mysql connection fails, various unexpected errors are recorded -issue#3635: Automate generates undefined index errors when communicating with remote pollers -issue#3639: When updating a device, duplicate entry errors occur when inserting to the database -issue#3646: Adding datasource fails from CLI due to missing function -issue#3651: Editing any item on an Aggregate Graph that has been converted to a normal graph breaks entire graph -issue#3655: Rare race condition between Boost and Poller can result in unexpected missing table errors -issue#3659: When viewing logs, unexpected 'needle' errors can be seen on rare occasions -issue#3663: Disabling a Data Collector can cause unexpected errors -issue#3668: When Input Field is in error, message reports field will be highlighted which is incorrect -issue#3669: When adding an Input Field, the Input Method can be renamed unexpected -issue#3673: Spikekill does not receive correct `avgnan` value when launching from GUI -issue#3676: Device not showing up in device page but showing up in Monitor tab -issue#3681: Item movement arrows do not properly align on all themes -issue#3682: When in 'Time Graph View' mode, Zoom features do not work correctly -feature#3611: Allow CHANGELOG to be viewable from the GUI -feature#3647: When adding datasource fails from CLI, created Datasource ID should be printed -feature#3666: Update jstree.js to 3.3.10 -feature#3688: Update phpseclib to 2.0.28 1.2.12 -security#3467: Lack of escaping of color items can lead to XSS exposure (CVE-2020-7106) -issue#3422: When Graph Item is not linked to a data source, Comments do not always get variables substituted correctly -issue#3424: Hosts are being incorrectly filtered when no location filter is set -issue#3427: When exporting to a CSV with unicode characters, contents can become garbled -issue#3429: When using SNMP v3, Automation can report extraneous warnings -issue#3432: Rare race condition exists when both boost and dsstats enabled -issue#3434: When attempting to exploit Cacti using alert, unexpected errors can be seen -issue#3436: Unable to login due to incorrect default of Cookie Domains in config.php.dist -issue#3438: When upgrading to 1.2.11, installer can appear to stop at 42% -issue#3447: SNMP Issues on recent version of PHP -issue#3449: When viewing the installation wizard's directory permission step, items are overlapping unexpectedly -issue#3450: When installing Cacti under XAMPP and PHP 7.4, exceptions are being recorded and installation fails -issue#3452: New Content-Security-Policy prevents External Links from being opened -issue#3454: Cacti's Reports are not displaying messages correctly -issue#3457: Graphs can not properly handle negative axis values -issue#3459: When installing a new remote poller, connection tests can incorrectly fail -issue#3460: Addtional changes to allow plugin folder/display names to be handled better -issue#3462: Increase default memory limit for cli scripts to prevent runtime memory issues -issue#3463: When listing VDEF's, selecting 'has graph' can cause unexpected exceptions in logs -issue#3468: Graph rules cannot be created for automation -issue#3474: The SSL option to set the SSL_CA should be optional for Client Connections -issue#3477: Boost leaking memory when a large number of Data Sources disabled -issue#3478: Reindexing can sometimes run longer than expected -issue#3479: When viewing the Data Query table interface, the Data Input Method should be right aligned -issue#3483: When recording log entries, cacti should default to hyphenated date format -issue#3484: When editing SNMP v3 passwords, previous setting is not obfuscated -issue#3488: In automation, when viewing an 'SNMP option set', the private passphrase is in clear -issue#3495: When installing templates, default 'all' selection will reset all existing graphs, removing customisations -issue#3496: Graph Items can show a double percent sign incorrectly -issue#3502: When viewing Graphs, can not switch between list, preview and tree submodes -issue#3504: Viewing graphs before the poller has run for the first time can produce unexpected errors -issue#3505: When viewing graph previews, clicking Go or Refresh prevents calendars from working -issue#3506: After successfully logging in, a user can become automatically logged out again -issue#3507: Changes to JavaScript's Storage API cause exceptions to be thrown -issue#3510: Only guests can actually guest only pages, logged in users are denied access incorrectly -issue#3512: When plugins update, registered files list cannot always be updated -issue#3520: When viewing graphs, shifting time does not work when using non-english languages -issue#3576: LDAP Authentication succeeds, but login fails due to bad session handling -issue#3629: Log files are not rotated properly on remote pollers -feature#3480: Created 'custom_denied' hook to allow customisation of permission denied notifications -feature#3498: Update js.storage.js to 1.1.0 -feature#3499: Update jstree.js to 3.3.9 -feature#3500: Update phpseclib to 2.0.27 1.2.11 -security#1566: Add SameSite support for cookies -security#1985: Cookie should be properly verified against password -security#3342: CSRF at Admin Email -security#3343: Improper Access Control on disabling a user. -security#3414: Update to jQuery 3.4.1 to resolve XSS issues with jQuery 3.3.1 -issue#2265: When attempting to save Graph field, query_ifSpeed is not properly validated -issue#2400: Allow ability to duplicate site settings -issue#2428: Make plugins non-case sensitive for folder names, whilst allowing nicer display names -issue#2580: When running DSSTATS, system isn't properly detecting that another is already running -issue#2853: Discovered Devices filtering do not include snmp description or name -issue#3231: Allow user to unlock a tree that has been locked for editing by another -issue#3237: Report gets resent every poller cycle -issue#3247: Language source files do not update "PO-Revision-Date" attribute -issue#3261: Automation rules aren't run for new devices on remote data collectors -issue#3296: Bad PHP memory limit values can result in failed upgrades -issue#3299: When using php-snmp and setting SNMPv3, warning is now shown as library does not support it properly -issue#3303: When installing under Windows OS, path expansion is not converted to PHP required format -issue#3310: When using 32-bit OS, automation errors can be seen due to subnet mask calculations -issue#3312: Console menu does not auto-expand for graph item editor page -issue#3313: When installing, multiple issues can be seen due to bad packages -issue#3314: Script Server has invalid debug code left in -issue#3317: Warnings can appear from CSRF Magic library due to multiple token values being found -issue#3319: Errors can occur upgrading from 0.8.x due to incorrectly detected data source profile id -issue#3322: When searching for LDAP accounts, allow recursive searching -issue#3330: Packages that are not properly formatted can cause installation issues -issue#3334: When upgrading from 0.8.x Automation SNMP Options should be populated -issue#3335: Unable to hide Device based Aggregate Graphs on Tree -issue#3336: Plugins need the ability to relax some content security policies in order to work properly -issue#3340: Undefined variable warning can appear when using 95th percentile graphs -issue#3341: MoTranslator does not appear to be handing null values properly -issue#3345: When attempting to refresh datetime picker, unexpected results can appear -issue#3346: When attempting to rewrite octet strings, extra space breaks pattern matching -issue#3348: When attempting to handle Orphans and/or Sync Graphs, results are not as expected -issue#3349: Prevent setting the PHP variable max_input_vars since it is read only -issue#3350: When editing a data source template, inconsistent results can be seen due to database query -issue#3355: When viewing raw graph data via the GUI, values are not always calculated correctly -issue#3357: Tree Search textbox resizes to 0 in some cases -issue#3360: When using guest accounts, after several timeouts result in refreshes, guest becomes logged out -issue#3363: The current user and user group permissions pages are not responsive -issue#3367: When Data Queries timeout, data is removed from the Host SNMP Cache table causing issues -issue#3368: Saving a Graph Template Item fails due to missing includes -issue#3373: When logging in via LDAP, ActiveDirectory would sometimes report insufficient access -issue#3375: When polling more often than default period of collecting data, distribution of collected data was not occurring -issue#3376: Improve speed when recovering from a poller from offline state -issue#3378: When attempting to check whether to include MoTranslator, typo makes it appear unavailable -issue#3380: php error when trigger threshold sendmail -issue#3386: Second data collector shows as running when its has no items to gather -issue#3387: Minor corrections to CSRF Magic -issue#3388: Naming of CLI programs does not always match name used within syntax usage advice -issue#3390: Incorrect breadcrumb bar if current tab is not "Graphs" -issue#3402: Cacti scores low on performance audit on lighthouse audit -issue#3408: CSRF Secret path is not passed properly when attempting to initialize secret -issue#3409: Issues with navigation link activations to other base Cacti pages -issue#3410: Zoom looses focus in advanced mode while crossing chart border -issue#3411: When upgrading a primary server, full synchronization is not happening as expected -issue#3412: When upgrading a primary server, automation templates are removed -issue#3413: When upgrading and choosing to upgrade your packages, installer finishes without package data in log -feature#1551: Allow system uptime to be a variable for use with graphs -feature#1990: Plugin Realm should have a 'role' to help maintain changes between plugins -feature#2110: Add Refresh Interval to Data Collectors display -feature#2156: Add Location based filtering -feature#2236: Allow for Purging of Data Source Statistics from the GUI -feature#2268: Restore ability to duplicate a data profile -feature#2534: Enhance table navigation bars to support systems with larger number of items -feature#2688: Increase length of Graph Item 'value' field to support pango-markup better -feature#3304: Allow Basic Auth Accounts to be mapped by CSV file -feature#3366: Make form elements under checkbox_groups flow using flex grid style -feature#3374: Set the domain attribute to secure cookies for the 'remember me' option -feature#3403: Enhance the "Graph Debug Mode" to display RRDtool Command lengths and excess warnings 1.2.10 -security#3285: When guest users have access to realtime graphs, remote code could be executed (CVE-2020-8813) -issue#3240: When using User Domains, global template user is used instead of the configured domain template user -issue#3245: Unix timestamps after Sep 13 2020 are rejected as graph start/end arguments -issue#3246: When upgrading with remote collectors, sync status does not always return properly -issue#3250: When PHP memory limit is set to -1, recommendation value fails -issue#3253: Upgrade can stall when checking permissions on csrf-secret.php -issue#3254: Installer shows script owner rather than running user for suggested chown command -issue#3266: When setting User Groups to 'Defer to the User', setting can lead to user being told they have no permissions -issue#3269: When searching Graphs under a Chinese language, an unexpected error as sometimes shown -issue#3274: When editing a tree, multiple device drag/drop does not work -issue#3276: When spine aborts, script server can be left wanting or generating unnecessary logs -issue#3277: When boost does not find an initial time, numeric errors can be raised -issue#3281: When changing Graph Template options, incorrect image format may be selected -issue#3282: Graph's can be sized incorrectly if image is SVG format -issue#3283: When setting a file path, valid characters not recognised properly -issue#3287: When using graph template 'Cacti Stats - User Logins', an incorrect count of invalid users can be seen -issue#3288: When on Device page, pressing 'Go' on the filter caused Device New menu pick to appear -issue#3289: When using CMD.PHP, poller id is not always shown properly -issue#3290: When using CMD.PHP, inconsistent device logging levels may occur -issue#3298: When initialising fields in JavaScript, text/textarea elements have width set to zero if it is hidden by parent -issue#3302: Editing a Graph Template does not show the Data Template name 1.2.9 -security#3191: Lack of escaping on some pages can lead to XSS exposure (CVE-2020-7106) -security#3201: Remote Code Execution due to input validation failure in Performance Boost Debug Log (CVE-2020-7237) -issue#2937: Devices still show in lists despite being deleted -issue#3038: When editing an aggregate on smaller screens, layout may not be correct -issue#3136: Upgrade may fail between 1.2.7 and 1.2.8 if incompatible database format used -issue#3142: Chrome sets graphs tree navigation view to width 0px -issue#3146: Unable to create aggregate graphs on new installations -issue#3149: After refresh of page, tooltips stop working -issue#3150: When using Time Graph View, Zooming can cause errors -issue#3151: Passing glue string after array is deprecated in PHP 7.4 -issue#3155: Aggregate does not correctly follow color template when reordered -issue#3156: On new installs, gprint_format was missing from table aggregate_graphs -issue#3157: Back button not working properly with Classic theme -issue#3158: Classic theme show only 3 tabs on mobile device. Don't show Console menu -issue#3159: PHP Memory is not correctly identified when value is not in megabytes -issue#3161: When the poller_output_boost table is missing, recreate it before a poller run -issue#3163: When using RPMlint, Free Software Foundation address is shown to be incorrect -issue#3165: Zoom looses its focus after all graphs on page rendered -issue#3166: When changing zoom level, graphs are resized inappropriately at the end -issue#3167: Installer should initialize the csrf-secret.php file automatically -issue#3168: sqltable_to_php.php script does not pick up row_format -issue#3177: Remove legacy plugin hook that presents potential 3rd party security issues -issue#3178: The change password page is not displaying the rules -issue#3180: Receiving undefined index errors when working with some Data Queries -issue#3181: When configuration file is unreadable, Cacti shows database connection errors if non defaults are needed -issue#3182: When a database connection error occurs, there is no way to report actual error -issue#3184: Improve program path detection by using system path and PHP_BINDIR -issue#3193: Starting with MySQL 5.7 some sql_mode variables are required for some plugins -issue#3196: Minimize use of eval() in JavaScript due to emerging Content-Security-Context guidelines -issue#3200: Unable to mass change Graph Template image format in mass -issue#3206: Converted aggregate graph cannot be edited -issue#3209: Error occurs when Creating New Graphs through Automatically Added Devices using Sync Device Template -issue#3216: When editing a Data Source Profile size is shown as 'N/A' -issue#3224: When removing graphs by command line, regex is not properly validated when empty -issue#3225: Unable to Import Templates due to invalid dependency hash -issue#3226: When processing secpass login, failed logins are not recorded -issue#3228: Login page does not remember the last realm used by user -issue#3232: When editing HRULE and VRULE items, color selector was not presented -issue#3233: When working with non-templated graphs, it can be difficult to determine what items represent -issue#3235: Transient errors may occur with table poller_output_boost_arch 1.2.8 -security#3025: CVE-2019-17357 When viewing graphs, some input variables are not properly checked (SQL injection possible) -security#3026: CVE-2019-17358 When deserializating data, ensure basic sanitization has been performed -security#3066: When using HTTPS, secure cookie to prevent potential weakness -issue#1228: Any tree or branch with a long name force main content off screen -issue#2133: Long snmp_indexes are being cut off -issue#2888: Long hostnames cause template filter to go off page -issue#2987: Changing Color Template does not update Aggregate -issue#2989: Allow Remote Data Collectors to maintain their own path variables -issue#2991: Cacti Statistics device template can generate unexpected errors -issue#2995: When editing a report, column setting may be ignored incorrectly -issue#2996: When editing a user, graph options do not properly reflect previously saved settings -issue#2998: Session performance issues due to excessive use for database storage -issue#2999: Blank arguments can lead to extra spaces in script arguments -issue#3006: Boost generates undefined variables warning during poller run -issue#3011: i18n logging does not check write permission exists -issue#3012: When viewing realtime graphs, some input variables are not properly checked -issue#3013: Allow legends to be modified for Aggregate Graphs -issue#3017: Automation network range with spaces fails validation -issue#3019: User selected language is not always adhered to -issue#3021: Tree view cuts off at the bottom of page on modern theme -issue#3023: When clicking highlighted tab, side panel is not always shown/hidden correctly -issue#3027: Aggregate Graph re-ordering does not work -issue#3028: When zooming a graph, unable to reach edge of graph without losing focus -issue#3030: Pace continues to run even after a page is finished rendering -issue#3032: Graphs may select MAX instead of AVERAGE as consolidation function even if there is no item with MAX present. -issue#3035: When editing a tree, can not remove entries due to CSS bug -issue#3037: When emptying poller output using cli, debug functions are not properly included -issue#3039: Allow packagers to be able to specify an alternate location of csrf-secret.php file -issue#3040: When running automation, discovery can still run even if cancelled -issue#3041: When running automation, scans do not always respond to being cancelled -issue#3042: When running automation, scan can fail when selecting remote pollers -issue#3045: When viewing Aggregate Graphs, an error due to undefined referrer may occur -issue#3047: When saving settings, ignore remote pollers who have not checked in recently -issue#3050: When viewing graph trees, some input variables are not properly checked -issue#3052: When editing CDEF's, slow database performance can occur -issue#3053: When viewing graph thumbnails, some input variables are not properly checked -issue#3055: During install/upgrade, database tests are not performed correctly -issue#3059: When using nth_percentile, correct value is not always returned if using MAX consolidation -issue#3060: When upgrading from older MySQL databases, format is not changed from compact to dynamic -issue#3061: When running automation, allow SNMP to be used as a ping method -issue#3068: When administrating users, some input variables are not properly checked -issue#3070: Improve database logging when a crashed table is encountered -issue#3073: Automation network range does not always produce the correct start/end values -issue#3078: When viewing graph debug from remote data collector, File Not Found warnings can appear incorrectly -issue#3079: Allow domain names to be stripped from a device's long description -issue#3080: Remote Agent throws warnings that graph_nolegend has not been sanitized -issue#3085: When editing a poller, ensure each listening IP is unique -issue#3081: External Links are not showing a glyph when they appear on the Console menu -issue#3089: When viewing graphs in realtime, undefined variable can be logged for 95th Percentile graphs -issue#3099: Graph template 'Linux - Memory Usage' has the wrong unit on its vertical_label -issue#3101: Polling times can be slightly inconsistent due -issue#3104: When viewing graphs, a byref error can be seen in the error logs -issue#3105: When viewing hosts, some input variables are not properly checked -issue#3111: When adding devices via command line, bad SNMP versions are not reported -issue#3112: When zooming on Graphs, too many requests are being made causing slowness -issue#3114: Support for USB devices that change name due to their hosts restarting -issue#3118: When converting tables, the dynamic row format should be selected -issue#3119: Main Data Collector should perform a Full Sync whenever it is installed/upgraded -issue#3120: Correct issues causing incompatibility with PHP 7.4 -issue#3121: When converting tables during install, show what will be changed -issue#3123: Named colors table is not properly imported/upgraded -issue#3124: When a second data collector is added, boost is not enabled automatically -issue#3128: i18n handler checks for existence of wrong mo file -issue#3129: Logout repeated occurs even when already logged out -issue#3132: Installer fails to continue if automation range is array of networks -issue#3098: Support percent sign(%) in graph gprint item like legend area. -feature#3077: Allow disabling remote poller resource cache replication to support upgrade testing 1.2.7 -security#2964: CVE-2019-16723 Security issue allows to view all graphs -issue#1181: When opening the Scheduler, it may appear off screen when opened near the bottom of a window -issue#2894: When using Remote Data Collectors, database information and recommendations may show Incorrect values -issue#2895: When using data sources from different RRDs, Percentile calculation may be incorrect -issue#2899: When displaying a form, variable substitution may not always work as expected -issue#2922: When running a data query, the result may come back as undefined -issue#2925: When using consolidation functions, retrieving the first step can cause errors -issue#2926: When editing a graph, variable validation errors may prevent changes from being saved -issue#2929: Boost performance may become poor even in single server mode -issue#2930: RRDtool can generate errors to standard output which can corrupt images -issue#2932: When RRDTool generates an error creating an image, it is not always reportedly properly -issue#2936: Installer will loop when number of tables exceeds PHP's max_input_vars limit -issue#2938: Under CentOS packages, upgrade_database.php script uses incorrect location for DB upgrade scripts -issue#2940: Images are not always properly sized until the page size changes -issue#2949: Order icons may not be properly aligned -issue#2951: Allow legends to be modified for Aggregate Graphs -issue#2958: Drop down autocomplete lists do not always open as expected -issue#2961: When syncing device templates, undefined function may be raised -issue#2963: When running ss_cpoller script, avgTime incorrect returns maxTime -issue#2966: Realtime popup windows do not always honor settings -issue#2967: When using Spikekill, gap and range fill are not operating as expected -issue#2970: When a user edits their profile, buttons may appear as unusable whilst still being enabled -issue#2973: User menu does not always display properly on mobile devices -issue#2974: Script Server can raise unexpected warnings when 'arg_num_indexes' set but not found in data source -issue#2975: Datasource Debug does not properly handle European numbers in certain circumstances -issue#2976: Boost messages should be stored in their own log file -issue#2977: Data updates with past timestamps can cause boost errors -issue#2978: Moving hosts between data collectors is slow -issue#2979: Multi Output Fields are not parsed correctly -issue#2984: When checking SQL fields, value was not always primed -issue#2986: Selecting 'Devices' menu pick closes 'Management' menu -feature#2943: Allow all Data Queries of a device to be re-indexed at once -feature#2952: If device is down or threshold breached, highlight in tree view -feature#2985: Update phpseclib to 2.0.23 1.2.6 -issue#2794: Graph template not saved on graph edit -issue#2825: "innodb_doublewrite = off" possibly dangerous recommendation -issue#2829: PHP recommendations always see memory limit as unlimited -issue#2830: Disabled Top/Bottom external links should not be displayed -issue#2832: Install/Upgrade log does not show anything -issue#2833: Undefined index can occur when data source does not have an snmp_index -issue#2834: Boost performance drops on very large systems -issue#2835: When creating graphs and inneficient query is causing long creation times -issue#2837: Sunrise theme does not render checkboxes 100% correctly -issue#2838: jQueryMultiselect does not match upstream due to forking -issue#2839: Non regular expression search filters don't support international characters -issue#2841: Total count is wrong after searching for External Link pages -issue#2843: DSStats reruns Daily Aggregation every minute -issue#2844: Autocomplete settings for passwords are not properly defined -issue#2845: Data Template can't be edited when it is in use -issue#2846: Allow tooltips for section headers with 'question' icon -issue#2847: Permanently convert an Aggregate to a regular graph -issue#2848: Aggregate graphs get clipped due to incorrect date range -issue#2856: Aggregate issues with very long RRDtool command lines -issue#2857: When trying to find the best index to use, a 'must implement Countable' warning appears -issue#2860: When testing remote poller connections during install, undefined variable warning can occur -issue#2862: Automation does not calculate network information correctly for single hosts -issue#2866: Add poller ID to subject for admin notifications -issue#2869: When creating aggregates from Graphs, JavaScript issues can occur -issue#2872: Add support for MySQL 8 and use of grouping as name for a column -issue#2875: Undefined variable when removing spikes in some cases -issue#2877: When attempting to send report, undefined function 'get_tinespan' messages appear -issue#2878: Function get_magic_quotes_gpc() is now deprecated in PHP 7.4 -issue#2879: Switching from authPriv to authNoPriv produces error when saving -issue#2884: Replication continues to occur when poller has been disabled -issue#2891: Script server script ss_fping.php generates error when not called by script server -issue#2901: Poller overrun warning message is badly worded -issue#2902: Mailer incorrectly reports it is sending to noone -issue#2903: PHP recommendations can generate a warning causing JSON issues -issue#2905: Sorting plugins by version can lead to unexpected ordering -issue#2907: SSL column for multiple pollers can be incorrectly set causing SQL errors -issue#2908: When URL_PATH is blank, it should assume that it is '/' -issue#2909: Correct usage of affect vs effect in strings -issue#2910: Can not show user menu when in portrait mode on mobile devices -issue#2911: Graph variables are not always encoded to JSON properly resulting in warnings -issue#2912: Navigation cache can sometimes be corrupted resulting in a non-array value -issue#2913: When adding new graphs, the type of graph is not remembered -issue#2917: Action icons next to graphs can sometimes become unselectable due to zoom -issue#2919: When refreshing menu, selected items are sometimes lost and submenu items can become hidden 1.2.5 -issue#1978: Popup Menus can appear off screen when using Graph Thumbnails -issue#2282: Installation wizard does not detect RRDtool version correctly -issue#2524: When editing a tree, Drag and Drop of Devices does not always work as expected -issue#2573: Associated Graph Template for Data Query can sometime disappear -issue#2656: GPRINT text_format does not replace Data Query and Host Fields -issue#2661: Automation does not always calculate network range/subnet correctly -issue#2663: Some legacy Data Queries can not determine their index order causing broken graphs -issue#2674: Large strings can sometimes cause language translation can fail -issue#2719: Automation may sometimes create empty graphs -issue#2721: When replacing '|input_xxxx|' strings, undefined index can occur -issue#2722: Calls to _db_replace() are not consistent resulting in warnings -issue#2723: When replicating to remote pollers, Undefined Variable errors may be seen -issue#2724: When graphing HRULE items, 'Only Variables should be passed by reference' error may be seen -issue#2725: When viewing logs in utilities, filenames should be limited the same as clog -issue#2726: During Automation logging, include the Rule ID that triggers the creation of an item -issue#2732: When using basic authentication, automatically strip any @domain information -issue#2734: Allow non-english labels to be used on Graph Templates -issue#2727: When using Polling Hosts Template, warnings can be issued when CMD.PHP is the poller -issue#2733: When processing SNMP data, space delimited hex strings do not always convert into MAC addresses -issue#2735: Mouse cursor should show as default pointer if column is not sortable -issue#2736: When using MySQL 8 or above, 'function' is considered a reserved word unless quoted -issue#2741: Various errors can occur due to undefined or incorrect variable names -issue#2742: Various errors can occur due to undefined or incorrect variable names -issue#2743: Attempts to close a tooltip when no tooltip has been set may cause errors -issue#2744: When changing password, undefined index error can occur if user is not logged in -issue#2748: If PHP location setting is invalid during install/upgrade, this should be notified on modules page -issue#2750: When performing multiple sort, highlighting of content occurs -issue#2751: When editing a Tree, display filter may not allow 'All' option to work -issue#2752: When running verbose query on device, you are unable to copy text from items -issue#2753: Unable to copy entire verbose query using clipboard command -issue#2757: Page Navigation can be subject to XSS injection -issue#2758: Various sensitive directories are browsable if web server directory browsing is enabled -issue#2760: Unable to add items into a report -issue#2762: Creating an aggregate graph can sometimes fail due to unknown RRD tools error -issue#2766: When modifying Aggregate Templates, changes are not always cascaded to Graph -issue#2768: Aggregate Graphs may sometimes show the wrong row count -issue#2770: ItemType is not updated when saving Report Items -issue#2772: Add tooltip support to html_header() and html_header_checkbox() -issue#2775: Remote pollers may sometimes fail to replicate data back to main system -issue#2777: Attempting to edit a non-existent report generates an error -issue#2778: When rendering graphs, resizing can sometimes occur repeatedly -issue#2779: On new installations, automation rules for Interface Graphs are broken -issue#2780: Upgrade database script not actually upgrading Cacti -issue#2782: When replicating the syslog plugin, the configuration file is ignored causing errors -issue#2783: When limiting the number of displayed characters, international characters may sometimes display incorrectly -issue#2784: When removing a device with graphs but no data sources , errors are generated -issue#2785: When editing a graph rule, warnings incorrectly appear about unsaved changes -issue#2792: When a checkbox 'friendly name' has a comma, checkbox functionality stops working -issue#2797: When upgrading from before 1.x, SuperLinks view permissions may not be correct -issue#2799: Under heavy use of Real Time Graphs, SQL errors may start appearing -issue#2800: When editing a tree, using a comma in the search field stops search from working -issue#2802: If a Device lacks ifName, an alternative field is not always found even if available -issue#2807: When editing a Data Template that has dependant graphs, some attributes should not be modifiable -issue#2808: When navigating a tree, the layout may unexpectedly move -issue#2814: When viewing the utilities page, HTML tags may be seen rather than rendered -issue#2816: When viewing logs, paging does not always working correctly -issue#2818: Automation can sometimes incorrectly add duplicate devices with the same sysname -issue#2820: When path is blank, is_resource_writable() will generate 'Uninitialized string offset: -1' -issue#2821: When the desired locale can not be located, a number format issue may occur -feature#2728: Update phpseclib to 2.0.17 -feature#2809: Update c3.js & d3.js -feature#2730: Update jstree.js to 3.3.8 -feature#2754: Allow Devices, Graphs and Data Sources to be searched by ID -feature#2765: When editing a tree, allow cascading selection of available graphics -feature#2805: Merged plugins are not always upgraded correctly -feature#2823: Enhance the splice_rrd.php to be able to merge RRDfiles of differing step 1.2.4 -issue#2523: Send A Test Email stops working under PHP 7.3 -issue#2589: Missing RRD file can cause DSSTATS to throw errors -issue#2590: When installing, chosen language is sometimes lost -issue#2591: Menu selection does not always match selected page/section -issue#2592: When viewing an aggregate graph, 'Display graphs from this aggregate' option does always not work -issue#2593: Unable to migrate aggregate graphs to matching aggregate template -issue#2598: Creating an aggregate graph without associated template causes RRDtool error -issue#2599: Creating/Updating an Aggregate Graph to use LINE/STACK's generates invalid SQL statements -issue#2604: When adding a dataquery, SQL errors can be generated -issue#2605: When installing, checking database tables can cause errors -issue#2608: db_update_table() function should not require an engine type or comment -issue#2609: When updating from earlier than 1.2, timezone column might not exist -issue#2610: Data Sources troubleshooter generates warning that each() function is deprecated -issue#2612: When RRDtool fails to initialize, DSStats generates lots of warnings -issue#2618: ifAdminStatus in snmp_queries/interfaces.xml -issue#2621: File paths that accept blanks are not allowing blanks -issue#2622: Various undefined variables generate errors within database.php -issue#2623: When using form_text_area(), invalid HTML can be generated -issue#2627: Some filenames can be lost in log file selection list -issue#2629: When upgrading, ldap library is not loaded properly due to incorrect paths -issue#2632: Automated Networks are not being properly replicated to additional pollers -issue#2635: When running automation scans, database connection should be forced to central database -issue#2638: Support disabling PHP SNMP extension -issue#2645: Some URLs are incorrectly calculated -issue#2649: Automation not creating graphs when there are custom items -issue#2650: Several undefined variables are generating warnings -issue#2662: HRULE objects broken in some cases -issue#2668: Trailing parentheses are removed from the SNMP system description -issue#2672: Cacti Install on Windows Fails -issue#2676: Skin paper plane not working on iPhone XR -issue#2678: Call to undefined function _() in data_queries.php -issue#2679: Users with passwords that do not meet complexity requirements are not redirected to the Change Password page -issue#2680: Remove deprecated $php_errormsg usage -issue#2689: Increase boost maximum memory limits -issue#2693: Graph links do not contain URL path causing links to fail -issue#2698: Avoid duplicated icon in the main.js of all themes -issue#2699: Login option "Show the page that user pointed their browser to" does not work properly -issue#2702: sqltable_to_php.php does not always generate valid table data arrays -issue#2707: Some pages that have permission errors dont raise proper messages -issue#2712: PHP memory should be unlimited in scripts that need more memory than the default -issue#2713: SNMP System Description with UTF8 strings properly are not properly parsed -issue#2718: When links are converted to ajax calls, mailto links should not be included -issue#2720: When calculating percentiles, the value is incorrect as the steps are not placed in correct order -issue#2822: When stderr log file is not populated, clog generates 'empty needle' error -feature#2538: Allow users to change default method of removing data sources when deleting graphs -feature#2539: Allow users to set the default graph lock status -feature#2540: Allow users to enable/disable graph tree history -feature#2646: Allow application of automation rules on CLI -feature#2654: New hook to notify plugins of user profile changes ('auth_profile_update_data') -feature#2664: Add option to purge spikekill backups -feature#2701: Provide option to continue graphing objects that loose their index -feature#2704: Device and template cache do not refresh properly 1.2.3 -issue#1063: Tree View does not display the last item correctly under 'Modern' theme -issue#2282: Installation Wizard does not Detect RRDtool Version on Windows -issue#2430: "New Device" menu item showing as selected incorrect when "Devices" clicked -issue#2435: Tree View becomes narrower and narrower when expanding/collapsing nodes with long names -issue#2449: Index incorrectly changed to 1 if the index is alphanumeric when OID/REGEXP: or OIDVALUE/REGEXP: -issue#2452: Missing 'getSNMPQueries()' function when calling add_data_query.php -issue#2453: When running add_graphs.php, cannot retrieve list of valid snmp values -issue#2460: sqltable_to_php.php does not export 'default' value of columns correctly -issue#2456: When attempting to display actions that can be taken, having no actions caused error -issue#2457: When creating a graph, undefined function prevents confirmation from appearing -issue#2459: ss_host_disk.php attempts to return an empty array instead of a string -issue#2463: Partial Fix: Display zombie data sources without graphs -issue#2464: When viewing a User's effective permissions, disabled devices should show denied -issue#2465: Too many groups hide effective permission column when viewing User's effective permissions -issue#2466: Manual data source creation is broken -issue#2469: When using Matching Objects filter within Automation Graph Rules, unexpected redirect occurs -issue#2471: When Creating a new Graph Template, clear the Graph Template permissions cache -issue#2472: Bad navigation items cause Array to string conversion errors -issue#2474: REGEXP_SNMP_TRIM does not handle Gauge fields properly -issue#2475: When resetting filters, multiple sort session variables do not always reset properly -issue#2476: When using CMD.PHP for polling, device polling time is not updated -issue#2477: When saving a Data Input Method, Output Field name changes to incorrect value -issue#2478: When saving a LINEX type Graph Item, the Line Width value is too restrictive -issue#2479: RPN function select list should be sorted when editing CDEF and VDEF's -issue#2480: RRDtool versions in Cacti not granular enough -issue#2482: When upgrading past 1.1.34, upgrade attempts to drop a non-existing primary key -issue#2491: Data Source Info suggests commands RRDTool can't honor -issue#2492: When data templates are filtered by profile, data source list does not get same filter applied -issue#2493: Data Source Info is not separated properly -issue#2494: User Login History is not fully enabled for translations -issue#2497: When linking to Graphs, unless both start and end are specified, only defaults are used -issue#2499: Data Source reapply names does not update name from data query or template. -issue#2500: Allow Data Source repairs from the Data Source Debug and Data Source Info pages -issue#2502: Unable to have a min or max value for RRDfile at zero '0' -issue#2503: The Cacti Statistics Device Template is not include in release -issue#2509: When checking for correct Unicode, minimum MySQL version is incorrect -issue#2513: When a plugin INFO file is malformed or missing elements, plugin_load_info_file() should fill missing elements with defaults -issue#2519: When editing a data query, graph template picker shows poor performance -issue#2518: Unexpected errors when filtering Data Sources with invalid 'rows' value -issue#2522: When upgrading from pre-1.0.0, colors were not upgraded properly -issue#2525: Tree branches that includes sites which have valid devices do not appear on Graph Tree -issue#2527: When importing a package, if Cacti version is below the version which that exported, a clear message should be shown -issue#2531: When updating color template items, the table name used is incorrect -issue#2532: Ensure Graph ListView table is displayed in line with Management -> Graphs -issue#2535: Ensure Graph ListView uses same UI logic as Graph Management -> Graphs -issue#2537: Incorrect title showing when changes are made to Tree -issue#2543: Poor performance showing a device's graphs on a tree -issue#2547: RRD values are not being properly trimmed -issue#2551: When checking MySQL configuration values, consider ON/OFF to be equal to 1/0 -issue#2553: When upgrading from 1.0.0 or below, renaming automation columns can cause issues -issue#2555: Missing configuration defaults prevent installations/upgrades without showing reason -issue#2563: When sorting Data Sources, missing index causes unnecessary delays -issue#2564: Filtering for Orphan Data Sources is unreliable -issue#2565: Pages with 500+ selectable items in a single able can suffer from poor performance -issue#2568: When querying for diagnostic data, devices on remote pollers should proxy the request -issue#2571: External Links do not properly validate user permissions -issue#2575: Poller errors occur if a file exists that the website cannot read -issue#2576: Spikekill API does not work when called from plugins -issue#2578: When importing packages, missing/new resources are not created -issue#2581: When viewing poller cache, Device SNMP community is not properly escaped -issue#2583: When JSON module is not installed, Installer does not correctly show missing message -issue#2584: When user/group permissions are reset, this is not reflected immediately to the end user -feature#2505: Improve performance of Data Source Statistics -feature#2515: Allow more than one SNMP port to be specified when adding devices via CLI -feature: Update phpseclib to version 2.0.15 -feature: Adjust the max table rows based upon value of 'max_input_vars' 1.2.2 -issue#599: Aggregate graph templates assume AVG consolidation function -issue#2312: Retrieving Device Information appears to fail on Safari -issue#2317: Unabe to add new records to 'poller_time' table -issue#2327: Memory exhausted whilst running poller replication -issue#2334: Some browsers report JavaScript errors when switching to console -issue#2337: When running an upgrade, the path of the log file is reset -issue#2339: Certain characters in recipient address can cause email to fail -issue#2343: Export hooks no longer work due to missing default keyword -issue#2346: When listing plugin permissions, "Legacy 1.x Plugins" can appear in the wrong cell -issue#2347: Allow sort output to inject returned data into a specific object -issue#2350: Unable to Select Data Source for HRULES and COMMENTS that include nth Percentile and Bandwidth -issue#2352: SNMP description field can sometimes contain mangled data -issue#2354: When reindexing in Automation, titles are not updated for Graph and Data Source -issue#2355: Data Sources are sometimes duplicated when Custom Data is specified -issue#2357: When indexes are incorrect, poller should log more information -issue#2359: When upgrading, "Install/Upgrade" privilege may have been previously lost -issue#2360: When retrieving database / table / column information, schema name is not always applied -issue#2362: No way to default an interface speed when ifSpeed and ifHighSpeed come back as zero -issue#2365: When editing Aggregate Graphs, orphaned items were not always removed -issue#2372: Data Query reindexing leads gaps in Graphs -issue#2376: Manually adding a device discovered by Automation causes errors to be logged -issue#2380: Devices may experience constant reindexing -issue#2384: When authentication method is set to None, change to Builtin as None has been removed -issue#2393: When reindexing a device, Graph Automation creates duplicate graphs every time -issue#2416: SELinux wants APPEND not WRITE permission for Fedora/EPEL (RHEL, Centos) -issue#2419: Host state time was not correctly calculated -issue#2426: Reinstate missing plugin hooks for 'custom_logout_message' and 'custom_denied' -issue#2431: Default value for 'Mail Method' (settings_how) is incorrect resulting in errors -issue#2432: Undefined variable warnings when updating RRD data -issue#2451: Drag and drop does not always function correctly -feature: Update JavaScript library c3.js to version 0.6.12 -feature: Update phpseclib to version 2.0.14 -feature: Update PHPMailer to version 6.0.7 -feature: Update JavaScript library d3.js to version 5.9.1 1.2.1 -issue#2259: Unable to View Aggregate Graphs -issue#2267: Remove unnecessary includes in aggregate template code -issue#2270: Realtime Graphs consuming too much memory -issue#2272: Site Tree Branches not showing Graphs -issue#2273: Error when saving changes to Data Collectors -issue#2279: SQL Errors in add_graphs.php -issue#2280: SQL Errors in snmpagent cache table inserts -issue#2281: Database audit cli giving incorrect results -issue#2285: Allow HRULEs for bandwith and ptile -issue#2292: Allow Realtime to use 1 second data collection -issue#2298: Ambiguous Toggle Switches in Sunrise Theme -issue#2303: Problem with "Notify Primary Admin of Issues" function -issue#2304: Installation progress stays at 0% -issue#2305: BOOST PROGERR: ERRNO:'8' -issue#2311: Unable to update PHP location during installation due to incorrect CLI environment -issue#2319: Primary admin account not always given access to a plugin when that plugin is enabled -issue#2321: Date separator not being used properly for graphs -issue#2322: Modifying plugin realm registration files and description not supported -issue: Installer does not identify when shell_exec()/exec() are disabled -issue: Removing a Device or Graph Template can not be seen till next login -issue: Visual issues with custom data when using paper-plane theme -issue: Undefined function errors attempting to sync device templates -issue: Plugin dependency handling inconsistant -issue: Editing a report shows incorrect graphs from dropdown 1.2.0 -feature: Add a Timeout setting for Remote Agent calls -feature: Add Graphs and Data Sources hyperlinks on Device page -feature: Add One Minute Sampling to the default Data Source Profiles -feature: Add support for DDERIVE and DCOUNTER to Cacti -feature: Add Timezone support for Remote Data Collectors -feature: Allow Adding Aggregate Graphs to a Report -feature: Allow ASCII filepath paths to not be found on settings save -feature: Allow drill down from Graphs to Data Queries or Templates -feature: Allow Import/Export to be hookable -feature: Allow snmpagent to be disabled for very large installs -feature: Allow Top tabs to be Glyphs or Text or both -feature: Big Spanish translation update plus massive QA fixes -feature: Change password page provides visible confirmation of password rules -feature: Do not allow second data source to be added to an SNMP Get data template -feature: Don't allow removal of Data Sources from Data Template once its in use -feature: Inform the primary Cacti administrator of problems by Email -feature: Make all user settings dynamic and allow resetting to default. -feature: Make Graph and Data Source suggested naming more efficient -feature: Make it easy to find Data Query based graphs that have lost indexes -feature: Make Top Tabs use Ajax Callback -feature: Make tree editing responive -feature: New Install/Upgrade user permission to limit access to being able to upgrade -feature: Provide option to debug width errors where output exceeds column width -feature: Removed the Authentication Method of 'None' -feature: Tree automation is now defaulted to on for new install -feature: Update JavaScript library c3.js to version 0.6.8 -feature: Update JavaScript library Chart.js to 2.7.3 -feature: Update JavaScript library d3.js to version 5.7.0 -feature: Update JavaScript library jquery.js to 3.3.1 -feature: Update JavaScript library jquery-migrate.js to 3.0.1 -feature: Update JavaScript library jquery.tablesorter.js to version 2.30.7 -feature: Update JavaScript library jstree.js to 3.3.7 -feature: Update JavaScript library screenfull.js to 3.3.3 -feature: Update phpmailer to version 6.0.6 -feature: Update phpseclib to version 2.0.13 -feature#289: Allow external nologin access for Realtime Graphs -feature#553: When display a host, include Aggregated Graphs as well as standard graphs -feature#614: Allow users to duplicate Data Input Methods -feature#973: When creating a new user authenticated via LDAP, attempt to retrieve users email and full name -feature#122: Support a Site Branch Type -feature#1060: Design Enhancement for Large scale Cacti Implementations -feature#1142: Add Site dropdown to the Graphs and Data Source pages -feature#1184: Improve Data Input Methods editability and message handling -feature#1200: Aggregate Graphs can now include COMMENT -feature#1282: Email notification for Automation Network discovery process -feature#1347: Update automation logging to work better -feature#1395: Ensure messages have each new line keep the same prefix in cacti_log() -feature#1399: Allow 'requires' to include version against a plugin -feature#1400: User settings are now dynamic and can be reset (removed) to return to global settings -feature#1422: Automatically select the next unused data input field when clicking add on data input method -feature#1505: When displaying a graph, provide breadcrumb link to edit device -feature#1527: Update Fontawesome from 4.7 to 5.0.10 -feature#1580: Support Drag & Drop for Builtin Report Items -feature#1581: Allow Mass Adding of Graphs to Reports -feature#1584: Allow theme selection when installing -feature#1588: Check that PHP can run a test file -feature#1593: Allow External links to auto refresh -feature#1597: Ensure synchronised files have same attributes as originals -feature#1610: On Unix, redirect error messages to log files when running external scripts -feature#1628: Allow the User to define an initial Automation Network for discovery when installing -feature#1670: Improve Graph Management to show type of source for a graph -feature#1671: When duplicating a Graph Template, properly duplicate Data Query Graph Template Mappings -feature#1677: Default Tree nodes sorting to be inherited -feature#1691: On Graph context menu, add a 'Copy graph' option to copy graph image -feature#1692: Separate option for logging Input Validation issues -feature#1703: On Graph context menu, text is now multi-lingual -feature#1708: Allow the User to override global Automation email recipients at the Automation Network level -feature#1709: Suppress warning from RRDTool when attempting to make updates in the past -feature#1711: Add support for SSL connections to MySQL -feature#1731: Prevent loss of changes by warning user about unsaved items -feature#1734: When displaying a graph, provide more information when error image is displayed (see also #1428) -feature#1763: Enable automatic refresh for Time Graph View -feature#1806: Control low level debug routines via config.php (Develoepr Use) -feature#1819: Provide CLI program to enable graphs to be removed by scripts -feature#1969: Graph previews can now be linked using a host's external id -feature#2006: Introduce new Data Source Profile to handle decade long graphs -feature#2173: Introduce Device and Graph Template Caching to Speed UI -feature#2228: Add Device ID to Device search field -issue: Fix issue with display_custom_error_message() causing problem with system error message handling -issue: Graph List View was not fully responsive -issue: Move Graph removal function to Graph API -issue: On the Data Sources page, if there is no filtered Device and a Data Source is edited, device association is lost -issue: Typo in Dutch translations when an error occurred while downgrading -issue: Unable to display user profile tabs -issue: Verify all Fields not working due to Cacti 1.x upgrade error -issue#186: Cacti does not support jQueryUI 1.12.x -issue#187: Remove the use of jQuery Migrate plugin -issue#948: Do not create a new datasource when adding a new Graph for the same device/field -issue#454: Cacti Re-Index does not resolve index changes properly during re-index -issue#983: Import Template Preview is misleading -issue#1097: Template user should be disable to prevent logging in directly. And newly created user should always be enabled to allow logging in when copying template user. -issue#1174: When display a tree, disable drag and drop unless in edit mode -issue#1298: Display fatal error to prevent issues caused when system log is not writable -issue#1350: When switching an Automation Tree Rule's leaf type, remove invalid Automation Rule Items -issue#1383: CSRF Timeout does not obey session timeout -issue#1408: Update SQL / Backtrace to use new clean_up_lines() function -issue#1414: DSSTATS reports incorrectly that a data source does not exist -issue#1420: Fix issues found by Debian package builds -issue#1421: Fix issue when SQL had all bad modes, missing variable warning was generated -issue#1426: Fix issue where remote poller was not using unique filenames when attempting to verify files -issue#1437: Plugin install hover message sometimes shows line breaks rather than formatted text -issue#1454: When using oid_regexp_parse, filter indexes to those that match -issue#1473: Recovery Date overwritten by subsequent checks -issue#1494: Unable to Deep Link/Bookmark Trees -issue#1503: Undefined function clearstatscache in DSSTATS -issue#1507: When saving graph settings from the graph page, the graph template id should not be included -issue#1510: New Graphs Undefined Variable $graph_template_name -issue#1521: Force boost to be enabled when there are Remote Data Collectors -issue#1528: Saving a device can result in WARNINGS related to string vs array handling -issue#1529: Allow Aggregate Graphs to Sum Bandwidth and Percentile COMMENTS -issue#1543: Graph Preview appends header=false too many times -issue#1553: Poller does not set rrd_step_counter correctly if no steps taken -issue#1559: CLI Output Issues due to over escaping -issue#1560: Warning that escapeshellarg() is escaping a null -issue#1567: Technical support - add notification if Cacti and Spine version is different -issue#1574: User templates are not correctly being applied -issue#1589: Installer now checks that the temporary folder is writable -issue#1590: User Admin generates SQL error if user is not part of any groups -issue#1601: Aggregate Graphs can not include some classes of COMMENT -issue#1602: PHP ERROR: Call to undefined function api_data_source_cache_crc_update() -issue#1604: Failed to connect to remote collector -issue#1606: Boost debug log not functional -issue#1607: Boost next run time occurs in the past -issue#1608: Possible boost race conditions -issue#1609: Remote pollers update 'stats_poller' on main poller -issue#1617: Editing a data query results in missing $header variable -issue#1621: Realtime Popup can cause automatic logout -issue#1626: httpd-error.log have message about Fontconfig -issue#1634: Default snmp quick print setting resulting in false poller ASSERTS on some php releases -issue#1651: Check temporary folder has write access during import -issue#1655: Correct Cacti to handle new MySQL 8.0 reserved word `system` -issue#1658: Devices drop down should be filtered by Site -issue#1660: Reports based upon Tree don't maintain graph order -issue#1665: Must change password not working for local users when main realm is not local -issue#1669: Console log header grammar issue -issue#1674: Threads and Processes values not migrated to Poller table during upgrade -issue#1676: Allow automation discovery to add the same sysname on different hosts -issue#1682: Slow Select Statement lib/api_automation.php -issue#1689: Technical Support's RRDTool version should show detected RRD version -issue#1690: Report a warning if the default collation is not utf8mb4_unicode_ci -issue#1700: Mail sent without auth causes errors to appear in logs -issue#1710: RRDtool create command causes first update to fail -issue#1721: Console Side Bar not correct on first login -issue#1723: die() messages should include PHP_EOF for better logging -issue#1726: Poor page performance editing a Graphs Graph Items -issue#1746: Poller with no hosts does not exit until timeout is reached -issue#1761: Graph Management page shows bogus template names -issue#1783: Browser Back button still does not working -issue#1796: Import: Fixed handling of references to objects not included in file -issue#1799: Default User log sort should be date descending -issue#1810: Correct SQL errors with authentication set to no authentication -issue#1839: Dummy cosmetic bug on down device selection option -issue#1841: Data Source Stats table not properly migrated from pre 1.x Cacti plugin -issue#1849: SNMPAgent not sending traps -issue#1852: Reports Preview/Mails show no graphs -issue#1889: Insecure $ENV{ENV} which running setgid -issue#1901: Upgrade from 0.8.8h fails on external_links statement -issue#1921: Data Query XML field method 'rewrite_index' does not correctly query for value -issue#1926: Deselecting items should present warning or disable GO button -issue#1948: Device Template should warn about need to re-sync -issue#1953: set_default_action() should warn if more than one action provided -issue#1973: SpikeKill Menu does not display properly -issue#1976: Default admin permissions do not allow everything -issue#1982: Certain hooks should occur within api functions rather than UI functions -issue#2002: api_plugin_db_table_create should support non-string defaults -issue#2012: For kernel 3.2+, "Linux - Memory - Free" should grep for "MemAvailable:", not "MemFree:" -issue#2085: CLOG Regex Parser does not verify registered function exists -issue#2126: api_device.php generates undefined function poller_push_to_remote_db_connect() -issue#2127: Unable to save error when duplicating graph -issue#2135: api_tree_lock() and api_tree_unlock() forcing redirection incorrectly -issue#2143: export.php Illegal string offset 'method' -issue#2144: Device Management "Status" column does not sort properly -issue#2152: When editing a device, should show disable/enable option -issue#2153: Utilities page issues the wrong hook for tabs -issue#2163: LDAP functions are not consistent -issue#2164: Login page does not remember selected realm -issue#2171: datepicker and timepick translation not available -issue#2178: Header/Footer included more than once -issue#2182: Graph View missing 'html_graph_template_multiselect()' function -issue#2184: html_host_filter() does not handle host_id consequently -issue#2186: Boost generates invalid SQL during on demand update -issue#2188: SNMP timeout errors are being duplicated -issue#2191: i18n_themes is not properly primed in global_arrays.php -issue#2202: Can't create more than one graph with add_graphs.php from one template -issue#2207: Removing Graph Template does not Remove Data Query Associations -issue#2217: cmd.php not handling quoted snmp values properly -issue#2240: SNMP system Data Input Methods should not be modified on import -issue#2241: Spike removal not functional due to Debian packaging -security#1072: Prevent exploitation of Data Input Methods to escalate privileges (CVE-2009-4112) -security#1882: Bypass output validation in select cases -security#2212: Stored XSS in "Website Hostname" field -security#2213: Stored XSS in "Website Hostname" field - Devices -security#2214: Stored XSS in "Vertical Label" field - Graph -security#2215: Stored XSS in "Name" field - Color 1.1.38 -issue#1501: cmd.php poller not stripping alpha from snmp get values -issue#1515: Special characters not rendered properly in settings -issue#1530: Inconsistent behaviour handling blank Field Name/Value when editing data query suggested values -issue#1537: Numeric validation not ignoring blank elements 1.1.37 -issue#274: Allow Realtime Graph Popup Mode -issue#1405: When Data Query columns are wide, they cause rendering issues -issue#1414: DSSTATS reports incorrectly that a data source does not exist -issue#1419: Filtering log results in errors in the log -issue#1420: PHP NOTICE editing cdef and vdef items -issue#1421: CLI upgrade_database.php PHP Warning on execution -issue#1426: Remote poller erroring attempting to verify files -issue#1432: Delete confirmation does not disappear -issue#1443: Partial Save warnings under Settings -> Mail/Reporting/DNS -issue#1447: CLI audit_database.php not detecting database name, and failed to create audit tables when run fresh -issue#1453: CLI add_graph.php not allowing title to be set -issue#1456: Increase minimum php version maintaining support for RHEL6 -issue#1457: Path-Based Cross-Site Scripting (XSS) issues -issue#1458: Error in logs when creating new graphs -issue#1459: Automation filter not applied correctly -issue#1461: Setting output_format on input type causes no values to be returned -issue#1464: Poller stuck in infinitely loop causing excess logging -issue#1466: No scrollbars in mobile browsers -issue#1468: Increase max length of host.snmp_sysObjectID column -issue#1471: Undefined function found in global_languages.php -issue#1472: Change Device Options - Style needs updating -issue#1474: Check possibility for creation of temporary tables on install -issue#1487: Undefined constant in ldap.php -issue#1483: Create New Graphs - Paw Styling Issue -issue#1493: Can't create tree branches with '#' sign -feature#1489: Add ability to use parts of OID as value via regex -feature: Updated Chinese Simplified translations -feature: Updated Dutch translations -feature: JavaScript library Chart.js updated 2.7.2 -feature: Allow snmp formatting functions to detect UTF-8 output 1.1.36 -issue#934: Template names missing in graph management list -issue#1211: CDEF and VDEF Item Edit do not use correct procedures -issue#1250: Language support does not support localization properly -issue#1331: Log Rotation should occur at midnight on system -issue#1334: Console->Users->(Edit) Permissions checkmark descriptions missing -issue#1336: Debian test suite reports php error -issue#1338: Allow automation to be run in debug mode from GUI -issue#1339: First graph of second page does not render -issue#1340: Unable to open Time Graph View in new tab -issue#1348: Toggle context menu of Zoom -issue#1351: Errorimage does not render on systems without GD ttf support -issue#1353: New installation without config.php silently throws errors -issue#1355: Single tree can have the order of the tree changed -issue#1357: Data Profile disable fields shown temporarily as editable -issue#1359: Settings page generates error for removed plugin tab -issue#1362: DSStats Avg/Peak function broken due to change in RRDtool processing -issue#1365: Plugin Management enforce folder name -issue#1366: Improve error/info message display -issue#1380: Potential failure when updating script type -issue#1384: When installing/enabling plugins, current user and admin should get permissions -issue#1386: form_selectable_cell() ignores width if no style_or_class is passed -issue#1389: Poller is including plugins that are not installed -issue#1390: Plugin uninstall should prompt user before removal -issue#1396: Prevent installation/uninstallation of a plugin if dependency is present -issue#1397: Distinguish between plugin tabs and core tabs in settings -issue#1371: Allow dynamic setting of from name when emailing -issue: Data Query Cache filter layout more consistent -issue: Minor plugin permissions format change -issue: Implementation of error handling causes errors creating New Graphs -issue: Deprecated DDStats setting removed -issue: Graph context menu items are now context aware -issue: Validate spine path before allowing enabling of spine -issue: Errored settings fields now highlighted correctly on error -issue: Add the Default Device to the Default Tree at install time -issue: Secpass password verification error message unuseful -feature: Searching of SNMP Index in View Data Query Cache now works -feature: Presets now have default device Template -feature: JavaScript library c3.js updated (v0.4.21) / jstree.js (3.3.5) -feature: PHPSecLib updated 2.0.10 -feature: Updated Dutch translations 1.1.35 -issue#114: *all_max_peak* percentile calculations incorrect -issue#430: Pressing Back often fails to work as expected -issue#564: Fail to move items in graph template as desired -issue#981: Hyperlinks for Data Profile stats -issue#993: Realtime not working on remote pollers for certain data query -issue#1244: Errors importing templates with deprecated hashes -issue#1251: Allow zoom out through mouse mmiddle button -issue#1281: Max OIDs setting is for bulkget and not bulkwalk operations -issue#1286: Correct CHUNKED_ENCODING error when retrieving graph with some browsers -issue#1306: Graphs are not always refreshed properly -issue#1309: Provide meaningful authentication errors in graph_json.php and graph_image.php -issue#1310: Return button fails on change password page -issue#1315: Realtime not working on local data collector -issue#1316: CDEF Item Value dialog does not update creating items -issue#1319: Front end + remote poller - connection timeout issue -issue#1321: Use RRDtool pipelining functions within DSSTATS -issue#1323: Enhance form layout for readability -issue#1329: Spelling errors in automation_networks.php -issue: Validate regular expressions if specified in add_graphs.php -issue: Ensure compression levels are consistent when importing package 1.1.34 -issue#1040: PHP version 7.2 - ERROR PHP WARNING: sizeof() -issue#1195: Improved Javascript error message handling -issue#1245: Unable to reorder graph name suggested values -issue#1256: Error reporting of custom errors not displayed correctly -issue#1257: Boost excessively logging updates -issue#1258: cacti.sql updated to match expected schema -issue#1260: Tab images fail to render due to TrueType support in PHP GD Module -issue#1261: Automatic logout timeout does not apply to web basic authenication -issue#1263: CLI utility to validate database schema -issue#1266: Inconsistent usage graphWrapper CSS causes odd graph zoom behavior -issue#1268: Regex filters not working properly -issue#1274: Host CPU script checks value existance to avoid error -issue#1275: SNMP v3 authPriv fails to work -issue#1287: JSON calls return validation error in HTML format -issue#1289: Script Server should output parameter array rather than parameters -issue#1292: Chrome to aggressively caches Javascript files -issue#1293: Correctly identify if command 'snmpbulkwalk' is available -issue#1296: CactiErrorHandler does not ignore PHP suppressed errors -issue#1300: Automation discovery : New devices added by automation discovery have empty SNMP community field -issue#1302: Automatic logout should not be enforced on login page -issue#1304: mib_cache.php file contains unsafe transactions for binary logging -feature: CLI utilily to generate and verify file hashes for installed Cacti files -feature: Logging links back to appropriate areas for troubleshooting -feature: Logging lists filenames in reverse order 1.1.33 -issue#1253: Automatically generated RRDtool DEF names in Cacti 1.1.32 break existing Graph Templates 1.1.32 -issue#969: Undefined index: color_id / task_item when viewing graphs -issue#1166: Fix typo of 'locale' in global_languages.php -issue#1222: Graphs with large number of items causes RRDTool to error -issue#1230: PHP Fatal error: Call to undefined function get_max_tree_sequence() -issue#1238: SNMP functions fail to handle "Invalid object identifier" error -issue#1239: Browser console error in layout.js -issue#1240: Page layout issues caused by library update -issue#1246: Make SNMP Error return more info -issue: Missing or corrupted theme files can corrupt user settings -issue: Theme may not change until next login -issue: Tree edit Tree/Device/Graph drag areas incorrect -issue: Make callback error handling compatible with jQuery 3.x -issue: Ensure the snmp_error is cleared before every call -issue: Indicate unknown error when RRDTool returns no error message -feature: Update Javascript library: js.storage.js, d3.js, jquery.js, jquery.tablednd.js, jquery.timepicker.js 1.1.31 -issue#629: Site reload after delete the last letter in the searchbar -issue#1022: Discovery network stuck in "running" state does not return results -issue#1164: Version compare function fails on major/minor only versions -issue#1166: Invalid New User default language selection -issue#1175: Automatic logout inconsistent redirect -issue#1179: Warn during installation if installing moving to older version -issue#1183: Automatically detect missing Theme and use alternate -issue#1185: Layout with Graphs having large number of data columns -issue#1189: Allow ability to sort tree list by name asc/desc -issue#1190: Enabling, Disabling, Uninstalling plugin, you should page refresh -issue#1191: Tree sequences were not set or checked -issue#1197: Add more collection intervals to Data Source Profiles -issue#1206: Display issue with internationalization number format -issue#1210: CDEF and VDEF Items can not be properly edited -issue#1212: Navigation breadcrumbs fail to handle External links correctly -issue#1213: PHPMailer trying TLS despite SMTPSecure setting -issue#1215: Show version when installation prompts for license -issue#1217: Add ability to view/edit Input/Query when editing Data Template -issue: Named colors fail to import on install or upgrade -issue: Drag and Drop issues on multiple pages could corrupt sequencing -feature: Enhance filter to permit more glyphs for table headers -feature: Add a page refresh dropdown to the Automation Networks -feature: Enhanced SNMP v3 input forms -feature: Allow Trees to be rearranged using Drag and Drop -feature: Trap GUI callback errors and present error message 1.1.30 -issue#1155: Non-secure mail setting not functional due to changes in phpmailer -issue#1157: Resolve issue with branch permission api -issue#1158: Change CLOG to use regex replacement so line details are not mangled -issue#1161: Graph View regex's are not preserved during automatic page refresh -issue#1162: Error messages are not display when editing a user -issue#1166: Default language was not correctly set when editing a user -issue: basename function undefined during upgrade to 1.0.x -issue: Storage API and translations required for Change password function -issue: ALTER IGNORE still throws an error when attempting to drop the primary key -issue: Data Source profile form API generates error when system is half upgraded -issue: Resolve issue with importing packages -feature: Update package versions for Cacti version 1.1.29 1.1.29 -issue#871: Allow Nth Percentile and Bandwidth Summation to respect 'Base Value' in template -issue#965: Duplicate error message and incorrect error code when using LDAP authentication -issue#1084: Graph Tree Branch not properly populating when editing report item -issue#1104: Datetime formatting in developer debug mode incorrect -issue#1106: Template Filters has empty row -issue#1109: URL used in redirection when referrer already has parameters in it -issue#1110: Add CPU Total to 'SNMP - Get Processor Information' -issue#1111: PHP NOTICE when using LDAP authenication -issue#1116: Filters not allowing "None" or "All" when editing report item -issue#1119: Reduced amount of data fetched for CPU usage to just the data used -issue#1121: Bandwidth summation not using correct locale -issue#1122: Fix issue with local login / potential password problems -issue#1128: Resolve php warning when raising messages -issue#1130: Fix logging level issue where logs of same level as setting where not logged -issue#1131: Make upgrade_database.php use same version compare as /install/ system -issue#1133: Fix issues with variable name and debug log -issue#1141: When viewing graphs from list view, pagination causes list view filter to be cleared -issue#1143: ss_host_cpu.php - Division by zero / Invalid Return Value -issue#1146: Installation now checks URI path matchs with configuration option URL_PATH -issue: Updated Graph pagenation and filter reset -issue: Resolve issues with cacti_version_compare() processing -issue: Zoom context menu stays open after zoom out actions -issue: Paginator object was not always translated 1.1.28 -issue#958: User Group Tree permissions not calculated fully -issue#959: Issue viewing email reports due to email client decoding problems -issue#992: RRDfile naming issues that result from random sorting during export -issue#1012: Issue where disabled devices will not appear in Tree editor -issue#1044: Handle invalid exclusion regex properly when viewing the log -issue#1045: Issue with multiple pages and confirmation dialogs -issue#1048: Problem importing vdefs from templates -issue#1053: Remote Data Collector now works with https and self signed certificates -issue#1055: Errors in data source statistics inserts when invalid output is encountered -issue#1057: CVE-2017-16641 - Potential vulnerability in RRDtool functions -issue#1058: ICMP Ping to and IPv6 address fails to gather data for ping latency -issue#1059: Aggregate item filter should use regular expressions to avoid SQL errors due to flawed filter logic -issue#1064: When a Device Template is removed, Automation Templates for that Device Template remain -issue#1066: CVE-2017-16660 in remote_agent.php logging function -issue#1066: CVE-2017-16661 in view log file -issue#1071: CVE-2017-16785 in global_session.php Reflection XSS -issue#1074: Boost records get stuck in archive -issue#1079: Undefined index in lib/snmpagent.php -issue#1085: Undefined function html_log_input_error -issue#1086: Rerun data queries in automation process has no effect -issue#1087: cli/add_device.php --proxy option does not work with non-snmp devices -issue#1088: Set timeout for remote data collector context -issue: Minor performance increase in boost processing -issue: Poller output not empty not processed correctly on Log tab -feature: Timeout to the remote agent for realtime graphs -feature: Updated Dutch translations -feature: Database update adding additional indexes for increased performance -feature: Updated PHPMailer to version 5.2.26 -feature: Updated phpseclib to version 2.0.7 1.1.27 -issue#1033: Issues inserting into dsstats table due to legacy data -issue#1039: Using html_escape still double escapes. Use strip_tags instead -issue#1040: Resolving compatibility issue with PHP7.2 1.1.26 -issue#841: --input-fields variable not working with add_graphs.php cli -issue#986: Resolve minor appearance problem on Modern theme -issue#989: Resolve issue with data input method commands loosing spaces on import -issue#1000: add_graphs.php not recognizing input fields -issue#1003: Reversing resolution to Issue#995 due to adverse impact to polling times -issue#1008: Remove developer debug warning about thumbnail validation -issue#1009: Resolving minor issue with cmd_realtime.php and a changing hostname -issue#1010: CVE-2017-15194 - Path-Based Cross-Site Scripting (XSS) -issue#1027: Confirm that the PHP date.timezone setting is properly set during install -issue: Fixed database session handling for PHP 7.1 -issue: Fixed some missing i18n -issue: Fixed typo's -feature: Updated Dutch translations -feature: Schema changes; Examined queries without key usage and added/changed some keys -feature: Some small improvements 1.1.25 -issue#966: Email still using SMTP security even though set to none -issue#995: Redirecting exec_background() to dev null breaks some functions -issue#998: Allow removal of external data template and prevent their creation -issue: Remove spikes uses wrong variance value from WebGUI -issue: Changing filters on log page does not reset to first page -issue: Allow manual creation of external data sources once again -feature: Updated Dutch translations 1.1.24 -issue#932: Zoom positioning breaks when you scroll the graph page -issue#970: Remote Data Collector Cache Synchronization missing plugin sub-directories -issue#980: Resolve issue where a new tree branches refreshs before you have a chance to name it -issue#982: Data Source Profile size information not showing properly -issue: Long sysDescriptions on automation page cause columns to be hidden -issue: Resolve visual issues in Classic theme -feature: Allow Resynchronization of Poller Resource Cache -feature: Update Spanish Translation 1.1.23 -issue#963: SQL Errors with snmpagent and MariaDB 10.2 -issue#964: SQL Mode optimization failing in 1.1.22 1.1.22 -issue#950: Automation - New graph rule looses name on change -issue#952: CSV Export not rendering chinese characters correctly (Second attempt) -issue#955: Validation error trying to view graph debug syntax -issue: MySQL/MariaDB database sql_mode NO_AUTO_VALUE_ON_ZERO corrupts Cacti database -issue: When creating a data source, the data source profile does not default to the system default -feature: Enhance table filters to support new Cycle plugin -feature: Updated Dutch Translations 1.1.21 -issue#938: Problems upgrading to 1.1.20 with one table alter statement -issue#952: CSV Export not rendering chinese characters correctly -issue: Minor alignment issue on tables 1.1.20 -issue#920: Issue with scrollbars after update to 1.1.19 related to #902 -issue#921: Tree Mode no longer expands to accomodate full tree item names -issue#922: When using LDAP domains some setings are not passed correctly to the Cacti LDAP library -issue#923: Warninga in cacti.log are displayed incorrectly -issue#926: Update Utilities page to provide more information on rebuilding poller cache -issue#927: Minor schema change to support XtraDB Cluster -issue#929: Overlapping frames on certain themes -issue#931: Aggregate graphs missing from list view -issue#933: Aggregate graphs page counter off -issue#935: Support utf8 printable in data query inserts -issue#936: TimeZone query failure undefined function -issue: Taking actions on users does not use callbacks -issue: Undefined constant in lib/snmp.php on RHEL7 -issue: Human readable socket errno's not defined -issue: Audit of ping methods tcp, udp, and icmp ping. IPv6 will still not work till php 5.5.4 1.1.19 -issue#810: Scripts in packages don't match distribution -issue#919: Unable to upgrade to 1.1.18 -issue: Update documentation for minimum PHP 5.4 1.1.18 -issue#902: Correcting some issues with Console and External Links -issue#903: Upgrade pace.js to v0.7.8 -issue#904: Allow user to hide Graphs from disabled Devices -issue#906: Create a separate Realm for Realtime Graphs -issue#907: XSS issue in spikekill.php -issue#910: Boost last run duration generates an error on new install -issue#914: Unable to purge Cacti logfile from System Utilities -issue#915: Non-numeric data in ss_host_disk.php -issue#916: Resolve display of errors when encountering ldap issues -issue#918: Minor XSS and create generalized escape function -issue: Resolve JavaScript errors on Login page -issue: Resolve JavaScript errors on Permission Denied pages -issue: Graphs tab would appear in non-classic even if you did not have permissions -feature: Updated dutch translations 1.1.17 -issue#450: List View to Preview shows no results -issue#486: Export Device table results to CSV -issue#544: Allow Log Rotation to be other than Daily -issue#673: Downtime/Recovery time/date is set incorrectly -issue#819: Customized timespans for graphs -issue#888: Rebuilding Poller Cache when External data sources are present results in false positive warnings in the log -issue#891: Database.php unable to connect to MySQL when using port different than 3306 -issue#893: Warning messages when duplicating CDEF objects -issue#897: Due to browser use of special key, deprecate ctrl-shift-x for clearing filter -issue#898: Issue with tcp and udp ping due to file description allocation changes -issue: Unable use ipv6 ip addresses for snmp ping in the Cacti GUI -issue: Update language of the Rebuild Poller Cache menu pick -issue: Broken design for input controls with Sunrise theme -issue: Timespan switching not switching to Custom in Preview Mode -issue: Log rotation would not occur under certain conditions. Provide more control over log functions -issue: Purge log file always purged the cacti.log, not the selected log -issue: Unable to view graphs for errored data sources from Cacti log 1.1.16 -issue#865: Escape Data Query arguments to prevent issues with special characters -issue#872: Can't add device items to graphs generated with no device and no template -issue#875: When modifying Realm permissions, realms that are listed multiple times don't stay in sync -issue#877: Improving resolution to issue#847 and one additional vulnerability -issue#878: Ambiguous language in purge log function -issue#879: SQL Error when adding a report item to a report -issue#880: Device drop down is limited to 20 devices and lacks a scroll bar -issue#885: Graph generated with no device and no graph template forgets device definitions -issue#886: Unable to export templates other than Device templates -issue: Address additional corner cases around get_order_string usage -issue: Data Queries sharing a Data Source can result in poller output table not empty errors -issue: Fix Sunrise theme to properly theme multiselect widgets -issue: Increase height of multiselects so that more options are visible -issue: When a graph is locked, anchor tags are still functional -issue: Autocomplete does not populate none-value when the selected value is not set 1.1.15 -issue: PHP Fatal Exception on upgrade from 1.1.11 or earlier -feature: Added test to detect install upgrade code problems 1.1.14 -issue#849: Unable to select host in Graph Item pick -issue#850: Reporting not allowing Non-templated Graphs -issue#858: Pagination on SNMP Options wrong -issue#860: Network Discovery Subnet Range character limit too small -issue#861: The search filter does not support Cyrillic -issue#862: Automation - When editing Graph Rules, unable to Change Data Query -issue#863: Typo error in auth_login.php for LDAP authentication -issue#867: Cross-site scripting (XSS) vulnerability in auth_profile.php -issue: Link's not showing in Automation Graph and Tree rules on Sunshine theme -issue: Make Templates Export responsive -issue: Don't wrap menu glyphs and menuitems -issue: The function get_order_string() can fail when encountering reserved word columns -issue: Data Query Delete is not using callback -feature: Resize Graphs on Graph page to be responsive -feature: Make import text a hidden field as it is likely seldom used 1.1.13 -issue#605: Remove Spikes feature not fully functional -issue#814: Allow 'Save' feature from New Graphs -issue#837: Using the add_device.php CLI script, you can not 'default' the device threads to other than 1 -issue#838: CVE-2017-10970: XSS Issue in link.php -issue#839: The Database column name 'rows' is a reserved word in MariaDB 10.2+ -issue#845: External links tabs should appear at the end of the tab view -issue#846: Web crawl of Cacti site shows errors in the log -issue#847: CVE-2017-10970: XSS Issue in lib/html_form.php. -issue#853: Go and Clear buttons do not work in all cases on Graph Rules pages -issue: Up/Down arrow titles labeled incorrectly on Tree Management page -issue: Make the default Export Type a Device Template -issue: Fix SNMPagent MIB cache issues -issue: Realtime cache cleanup now only removes rrd and png -issue: When redirected from reports, you can receive a validation error -feature: updated Dutch language 1.1.12 -issue#822: Aggregate Graph Items are incorrectly editable -issue#823: Allow Filters to be hidden -issue#834: Add spacing on graphs pages -issue: Uninstalled plugins can not install -issue: Location of filter functions in host.php prevent full responsive filter implementation -feature: Implement first phase of responsive search filters 1.1.11 -issue#642: RRA not written or WARNING: Poller Output Table not Empty -issue#779: PHP running out of memory due to date format issues -issue#791: SeLinux causing problems due to recent enhancement of the Cacti log -issue#818: Unable to unselect all SpikeKill templates under settings -issue#831: Unable to add devices from automation devices that don't have a snmpSysname -issue: incorrect version of pace: fix progess bar -issue: date_format(): fix date separator character -issue: host.php: fix itemCount en rowCount when result = null -issue: clog: fix scandir for systems with limited permissions to log directory -issue: clog: fix listing of logfiles -issue: Stop New Graphs filter interface from taking too much space -issue: Pagination of clog is not done via ajax -issue: Unable to dry run spikekill's from Graphs page -issue: Default sort order does not highlight on Aggregate Template page -issue: Correct display issue with Graph Templates when editing Device -issue: External Data Sources show as having poller interval on Data Source page -issue: Allow Selecting 'External' as the Data Source Profile when creating non-templated Data Source -issue: Remove Field Order on Data Input output data as it's not required -issue: Data Templates not using Ajax callbacks to switch Data Sources -issue: Visual issue when creating non-templated Aggregate Graphs -feature: new skin: Sunrise -feature: Provide Non Compatible explanation when a plugin is not compatible -feature: Updated Dutch translations -feature: Allow Graph Templates with multiple flag to be created repeatedly from Graphs New interface -feature: Allow plugins to exclude files and directories from their remote poller synchronization process -feature: Add Device Description to View Poller Cache UI 1.1.10 -issue#779: Resolve random Apache segfault due to recursion -issue#786: Unable to create second RRA for a Data Source Profile with collection rate less than 5 minutes -issue#789: Unable to Clear Filter due to JavaScript name space collision -issue#791: cacti 1.1.9 and clog_webapi.php permission issue -issue#794: SQL Error when creating graphs manually -issue#798: Cosmetic issue when checking checkboxes in Cacti -issue#800: Unchecked loop in lib/html_utility.php causing race condition -issue#802: Issue updating device hostname with SNMP data queries -issue#803: Issues with utf8mb4 introduced via optimization -issue: If the device is down and snmp_sysUpTimeInstance is 0, time in state can be wrong -feature: Updated Dutch translations 1.1.9 -issue#788: Fails on PHP Fatal error if LDAP auth enabled 1.1.8 -issue#529: Issue on Graph New page with checkbox unselected -issue#552: Minor selectable row checkbox issue -issue#577: Dragging multiple items causes the tree to refresh too early -issue#617: Correct poller timeouts when no devices are associated with active data collector -issue#706: Classic external link template images missing -issue#726: Undefined variable in upgrade script -issue#728: Resolve issues with jQueryUI empty dialogs -issue#731: Add class to radio button labels to correct display issue -issue#736: Sequence numbers not visible when editing templates using modern theme -issue#739: Graph Titles missing on aggregate graphs -issue#740: Spacer manipulation broken after update to responsive forms -issue#741: Errors in dsstats with very large RRDfiles with more than 60 data sources -issue#748: Search results are not cleared on Aggregates -issue#754: Default Language for user and system are not set on new installation -issue#755: RRDtool Graph Watermark is incorrect -issue#756: Resolving some translation issues -issue#763: Template Export not functional -issue#765: Validation error when viewing Utility View -issue#771: Editing a report renders no options after creation -issue#780: Preview always shows thumbnails in reports interface -issue: Hide Aggregate system cdefs when editing graphs and graph templates -issue: Updating Utility View zoom was not updating table data -feature#723: Convert Data Source dropdown to autocomplete when editing standalone graphs -feature#735: Allow color selection in graphs and templates to be autocomplete -feature#753: Preliminary support for RRDtool 1.7. -feature: Add function to obtain the current execution user -feature: Implement Site timezones as autocomplete for performance -feature: For themes other than classic, make color id selection autocomplete -feature: CLOG timestamp is now formatted as defined in settings -feature: CLOG can show loginformation from rotated logfiles 1.1.7 -issue#470: Enhance Cacti's SNMP function and Data Query XML, add hex|string|guess -issue#653: Devices with empty sysNames are not added to discovered devices -issue#655: Data source not displaying device name -issue#658: Scheduled Reports (type "tree") not working -issue#662: Sending test Email should optionally bypass ping -issue#667: In Classic theme initial view of Tree view broken -issue#669: Invalid SQL Messages when upgrading to Cacti 1.0.5 -issue#670: Validation error when you do "Change Graph Template" in Cacti -issue#672: Cacti unable to enable snmp notification receiver mibs -issue#680: Sort order in Time Graph View -issue#687: Cacti DB access not compatible with PHP 7 -issue#696: Multiple issues with snmpagent notification UI -issue#699: Add custom error handler for ping functions -issue#704: Fix GUI issues for Graphs not belonging to a device -issue#707: Back button not working -issue#708: Issues finding lib/snmp.php in host disk functions -issue#712: Change Graph Template dropdown invalid -issue#717: Allow ajax callbacks when adding non-templated graph items -issue: Reports were not using Cacti's permission system for checking access -issue: User Admin page reported wrong permissions at Tree level missing some i18n as well -issue: Short data_name can cause data collection issues -feature: Updated Dutch language -feature: Updating PHPMailer to 5.2.23 -feature: Support input-output Data Query types -feature: Introduce new get_cacti_version() to reduce database calls on pages 1.1.6 -issue#620: The table poller_data_template_field_mappings can get out of sync when manipulating data templates -issue#622: Can not connect to MySQL over a socket -issue#628: Cacti upgrade process is complex and error pront for developers -issue#635: Error when saving change to data template -issue#637: When displaying tree graphs, use the same layout as preview mode -issue#646: When a plugin is disabled during page operations, warnings can appear -issue#651: Unable to view cacti log (because of allowed memory size exhausted) -issue#657: Error in log when host is down, using icmp and using cmd.php on FreeBSD -issue: List for creating a Graph type shows already added Graph Templates -issue: Fix and undefined variable on data source page when first creating a manual data source -issue: Remove tabindex and other non-required manual aria controls from pages -issue: Table type and column type in poller_output table wrong -issue: FILTER_VALIDATE_MAC not defined on PHP less than 5.5 -issue: When changing your language Cacti would not do a full page refresh -feature#106: Paginated CLOG and log administration -feature: Dutch translations -feature: Responsive Graphs page -feature: Convert forms from table based to div based for responsive design -feature: Better support for phones and tablets -feature: Simplified installation code to facilitate easier release cycle -feature: Updating Tablesorter to v2.28.9, adding widgets and pager 1.1.5 -issue#580: Data collection warnings when using cmd.php -issue#592: Incorrectly formatted HTML -issue#606: Replace in data input methods -issue#607: Allow draw_menu to specify multiple actions for the same URL -issue#608: Spaces adjacent to double quotes are eliminated during data input method import -issue#609: Honor the column setting in graph tree view mode -issue#610: Change Graph Template action not available -issue#611: Cacti Installation Wizard - Spine page incorrect on Windows -issue#612: Uncaught Error: Call to a member function row() on a string -issue#613: Network Automation, now requires a site or your are unable to save rules -issue#615: Data Input field length too short for longer scripts -issue#619: Export logging option in settings no longer used 1.1.4 -issue#524: Reporting not working when Tree branch is device -issue#560: Add 'Duplicate' and 'Convert to Graph Template' back to Graph Management page for Advanced mode -issue#573: Missing Graph Template dropdown items -issue#575: Very large hex strings result in scientific notation that RRDtool rejects -issue#579: Problems logging in using nginx web server -issue#581: session_start() warnings when manually sending reports -issue#584: Issues reporting memory recommendation on utilities page -issue#586: Overrunning pollers can cause system load spikes -issue#587: Data Collector setting under Network Discovery is not being used -issue#588: Devices with blank sysDescr are added to the first Device Template in error -issue#589: Automation discovery does not allow site association -issue#590: Unable to create a plugin based menu -issue#591: Row selection in Device Automation Templates not sane with drag-n-drop enabled -issue#601: Resolving some translation issues -issue#604: Unexpected backtrace on regular expression filters -issue#605: Remove Spikes non-numeric data causes warnings -issue: Ping email does not use a from email address -issue: Automation does not recognize default size or poller -issue: Unable to drag-n-drop on automation templates pages when enabled -issue: Fixed number of hosts in poller stats for first poller -issue: Fixed screenwidth issue in tab PHP-Info of Utilities module -issue: Recovery poller could get stuck in some situations -issue: Fix JavaScript errors when managing Aggregate Graphs -feature: Reorganize defaults to place more on device defaults page -feature: Update jQuery tableDnD to version 0.9 -feature: More tolerant of empty PHP_SELF found with some web servers 1.1.3 -issue#515: Unable to import color CSV file -issue#519: In non-classic themes its not possible to remove Cacti log or reporting tabs -issue#520: SQL error in graph automation -issue#521: Cacti allows removal of Data Query Graph Template associations when they are in use -issue#525: LAST GPRINT type not rendered correctly due to lack of escaping -issue#530: Undefined function get_vdef in lib/rrd.php -issue#531: Issues with TextAlign and Tick graph items -issue#532: Unreliable scroll height causes issues in Chrome -issue#533: User settings not cleared after saving profile -issue#534: Automation issue with AS clause -issue#538: Unable to rename tree folder -issue#541: Issues with mobile graph viewing -issue#555: DSStats SQL insert errors due to data collection issues -issue#563: Division by zero in removespikes.php -issue: Fixed rendering issues with HRULE's on graphs -issue: Update jsTree to 3.3.4 version -feature: Improved responsiveness UI tables, filters, and menus 1.1.2 -issue#492: Error while adding non data query (cg) graphs -issue#494: CLI error while importing template -issue#499: SQL error in graph automation resulting in no graphs on tree -issue#500: Generic SNMP device package damaged - Unix Ping Host -issue#505: Log rotation does not work in some cases -issue#506: Undefined index: cactiStatsDeviceFailedPolls -issue#507: Nextwork discovery 'export' produces no results -issue#509: Minor bug with device ownership selection -feature: Add new legend type that includes Current/Average/Minimum/Maximum -feature: Update d3.js to latest version 4.7.4 1.1.1 -issue#457: Continued LDAP issues with initial user creation -issue#461: The function escapeshell arg not appropriate on Windows -issue#462: LDAP authorization issues: group membership check broken for 'Group Member Type' = 'Username' -issue#464: Change default batch spike removal limits for standard deviation and variance -issue#465: Less than sign inside items and labels of graph break graph -issue#466: Call to member function row() on a non-object in lib/snmpagent.php -issue#467: Reduce the number of queries in log function -issue#472: Schema changes to improve performance -issue#485: When editing a device, the ping status was not always returned -issue: Back button issues due to syntax problems in JavaScript -issue: Zoom periodically would loose it's crosshairs after zooming -issue: Zoom would zoom out into the future even when disabled -issue: Fixing lite corruption in graph_templates_item table -feature: Make SpikeKill options more consistent -feature#459: Add variable date time option to report mail subject -feature#460: Add external_id to host variables -feature#469: Change re-index method of Data Query from Device edit -feature: Support generalized date format approach in the GUI -feature: Use localStorage over a Cookie for Zoom setting storage -feature: Fully implement 'Remove Orphans' from Package import process 1.1.0 -issue#337: Generic SNMP OID Graph Template damanged -issue#338: Extremely slow new graph/DS creation -issue#353: Broadcast & Multicast Packet counters missing -issue#376: Structured RRD path permission issues -issue#389: Manual template based graph creation not working -issue#407: The RRDfile does not exist message is misleading -issue#410: Select character data was interpreted as hex by cacti_snmp_walk() -issue#422: additional issues with LDAP authentication -issue#424: Automation does not discover devices w/o resolvable hostnames -issue#427: undefined index TotalVisibleMemorySize on FreeBSD -issue#432: SpikeKill menu wonky on Paw Theme -issue#434: password_verify not compatible in php5.4- -issue#435: urlPath missing from paw theme links -issue#436: Restricted user does not see graphs in tree view -issue#443: Allow remote_agent.php through a NAT -issue#446: No local admin when using multiple LDAP configuration -issue#447: Creating another non data query graph from same template reuses first data source -issue#449: exec_poll_php does not flush pipes when using script server -issue#450: Graph list view - No Graphs Found -issue: Improve email test exception errors and change default timeout to 10 seconds -issue: When on links page, breadcrumbs would become corrupted -issue: When upgrading from any version of Cacti to 1.0.5, SQL's relative to poller_reindex might appear -issue: Color page performance poor -issue: The Device dropdown on the Graph View page was unreliable -issue: Aggregate and non-Device Graphs in list view had not Device or Title description -issue: Re-engineer back button design to accomocate ajax and native navigation -issue: Make Graph Template filter wider -issue: Resolve some visual issues in Classic theme -feature: Add page refresh API to make page refreshing in Ajax easier to accomplish -feature: Update fontawesome to version 4.7 -feature: Use fontawesome glyphs for menu items -feature: Support multiple column sort in table library -feature: Add glyphs to main Cacti console menu 1.0.6 -issue#386: Allow special characters in graph title -issue#414: Install Wizard check path for spine -issue#415: SNMP session handling broken -issue#418: LDAP create user from template not working 1.0.5 -issue#296: Poller warning for Non-SNMP device -issue#319: Add default 'High Collection Rate' data source profile to new installs to demonstrate concept of multiple rates -issue#330: Import templates to non-default Data Profile -issue#337: Error when try create new graph - SNMP - Generic OID -issue#342: Infinite loop in poller_automation.php with invalid schedule -issue#343: Device discovery cannot handle dots in device name -issue#344: Unable to upgrade to latest Cacti on FreeBSD -issue#353: Legacy broadcast & multicast packet counters missing in interface.xml -issue#354: Place on tree dashes / ordering is not correct -issue#355: Replace table rows with count when using InnoDB tables -issue#357: If recovery mode runs longer than a polling interval, a second is spawned -issue#358: Sending test e-mail results in warning -issue#360: Issue importing cacti.sql with some charsets -issue#364: Moving graph item causes page render issue -issue#365: ss_host_disk.php and ss_host_cpu.php should use return -issue#367: Upgrade chart.js to version 2.5 -issue#368: Issue with device automation ip vs. ip_address -issue#369: Interface bits/second total Bandwidth wrong CDEF -issue#375: Drag and Drop of Devices and Graphs allows dropping onto self -issue#380: Ignores a non-standard SNMP port -issue#382: When using php5.5+ new users unable to change their password -issue#384: graph_view.php backtrace errors -issue#385: Unable to place an aggregate grapn on a subtree -issue#390: Display graphs from this aggregate icon next to graph not displaying -issue#392: cdef.php missing sql where for system cdef's -issue#398: checkbox is not honored when creating tree -issue#399: External link configuration: Order buttons don't work -issue#400: SNMP Engine ID (v3) field too short -issue#401: Graphs -> Apply Automation Rules fails -issue#404: Success even when test mail fails -issue#406: HRULE text format special characters not escaped -issue#408: Suppress SNMP units suffix from cacti_snmp_get() output -issue: Improve is_ipaddress functions -issue: Drag & drop showing when disabled on page automation_templates.php -issue: Output messages displayed incorrectly in automation_templates.php and automation_snmp.php -issue: Importing template from old Cacti would not show data templates -issue: Handle snmp error exceptions better -issue: Update Apache .htaccess files to support multiple version -issue: When executing a full sync, if the table structured has changed, recreate the remote table -issue: Multiple domains not working as expected -feature#197: Add external_id to Cacti for linking Cacti to other monitoring systems -feature#332: Support copy user groups -feature: Log proper IP address if logging in behind a NAT -feature: New qquery parsing rules: VALUE/TEST, VALUE/TABLE, VALUE/HEX2IP 1.0.4 -feature: Javascript: make menu movement smooth and use localStorage -feature: Added cacti_snmp_get_raw() for plugin developers -issue#288: Function cacti_snmp_get bad handling of wierd value into snmp_value -issue#298: Graph generation issue with SNMP - Bits/Sec + Total Bandwith -issue#301: Unresolvable DNS hostname causing backtraces -issue#302: spikekill memory leak -issue#303: Error when creating tree items with "&" in the name -issue#307: Aggregate graph gives CMDPHP errors -issue#308: UI resize issue -issue#309: Show "Save Successful" notification permanently -issue#311: Graph thumbnail settings in profile setting does not work -issue#320: Users can not change their own password -issue#324: Aggregate template graph template JavaScript error -issue#352: Add configurable auto-logout and page-reload options -issue#329: Customize the favicon -issue#334: primary key on poller output boost table not efficient/not being used correctly -issue: Fixed issues with Dark theme -issue: Fixed issues with Paw theme -issue: Fix timespan calculation -issue: Added misplaced join condition when generating RRDtool graphs -issue: Fix the selection of timestan based on local_graph_id and rra_id -issue: Correct error in discovery not adding devices -issue: Action message did not always display -issue: fix regex to use Domains like www.t-online.de -issue: Properly align Order columns. -issue: address renaming issues with tree items. -issue: Add device snmp --version is ambiguous -issue: SNMP Availability failed to report down devices - This only was occuring for cmd.php collector. -issue: i18n remove embedded HTML syntax -issue: Wrap menu items to avoid scrolling 1.0.3 -issue#297: Upgrade 0.8.8h to 1.0.0 fails to create poller_output_boost table -issue: Added missing template import hash for 1.0.2 1.0.2 -issue#279: Correct Boost Status display issue -issue#275: Permission View issue and Device Dropdown when in Classic Theme -issue#270: Major Mib Cache corruption. Rebuild your MIB Cache after upgrading -issue: Resolve Cacti logo on Graphs page in Classic Theme 1.0.1 -feature: SpikeKill allows filling range to last known good value -issue#261: Add IPv4 and IPv6 Specific Counters to interfaces.xml -issue#257: Poller Output Table not Empty WARNING messages in cacti.log -issue#256: New Graph - Add Graph Items Fails (Data Sources shows None) -issue#255: Errors Creating new Graphs - Undefined Index Errors -issue#254: Unable to Properly add Data Source -issue#251: Remote Data Collector stuck on upgrade page -issue#247: Devices missing from tree device list -issue#245: Drag and Drop in Tree Edit Erratic -issue#243: SMTP Ping Failure with not SNMP Authentication -issue#241: Authentication Method: None not functional -issue#240: SQL error when install plugin -issue#238: Duplicate color id's cause error during Upgrade -issue#231: SNMPv3 - PHP ERROR WARNING: Fatal error: Unknown user name in file -issue: Resolving visual issues with row counts. -issue: When deleting Graphs prevent the removal of Data Sources that are still in use -issue: Improve SNMP agent performance through SQL optimizations 1.0.0 -feature: Support for remote data collectors -feature: Support Internationalization (i18n) for the main Cacti site, and supported plugins -feature: Data Source Profiles replace RRA settings allowing a single system to have multiple polling intervals -feature: Redesigned Tree page including Drag & Drop functionality -feature: New Graph Permissions system designed to make permissions simple to manage -feature: Add Themes 'Classic', 'Modern', 'Dark', and 'Paw' -feature: Debug Data Sources by comparing them to the Data Template -feature: New special Data Source type to detect the poller interval -feature: Bulk inserts in PHP poller to address latency issues -feature: Optimize data collection through in memory caching giving a 50% reduction in polling times when dealing with large sites -feature: Support RRDtool VDEFs -feature: Support new Graph Items: AREA:STACK, GPRINT:AVERAGE, GPRINT:LAST, GPRINT:MAX, GPRINT:MIN, LINE:STACK, TEXTALIGN, TICK -feature: Support RRDtool features: Right Axis Support, Dynamic Labels, Tab Width, Legend Position, Legend Direction -feature; Resizeable table columns -feature: Deprecated Single Pane Tree View -feature: Role Based Access Control (RBAC) -feature: Support User Group Permissions -feature: Show number of in use Graphs, Data Sources, and Devices for a given Template -feature: Support bulk re-sync of graphs to assigned Graph Template -feature: Bulk Device Settings changes -feature: CDEFs, Colors, GPrint Presets consolidated to Presets menu -feature: Authentication cookies for 'remember me' functionality -feature: Automatic logout after session inactivity -feature: Replace Boost server in favor of RRDtool Proxy -feature: Graph Details include CSV output, zoom, debug, and download links -feature: Graph Export moved to a plugin -feature: User change password functionality -feature: Automation added to core functionality through the merge of the Discovery and AutoM8 plugins -feature: Change interface graphs from 32 bit to 64 bit with ease -feature: Plugins now have hooks in device templates and automation -feature: Allow users to preview template imports to determine if there will be issues from importing -feature: Automatic removal of orphaned graph items when importing newer versions of graph templates -feature: Support for MySQL 5.7 -feature: Support for PHP 7.0 -feature: Merge Aggregate Plugin - Aggregate graph creation -feature: Merge AutoM8 Plugin - Automation of graph creation -feature: Merge Boost Plugin - Faster polling, result caching, on-demand RRDtool file updates -feature: Merge CLog Plugin - View Cacti logs -feature: Merge Discovery Plugin - Device discovery -feature: Merge Domains Plugin - Support for domain (ADS/LDAP) specific user templates -feature: Merge DSStats Plugin - Cache Data Source values for easy retrieval -feature: Merge Logrotate Plugin - Rotate Cacti logs -feature: Merge Realtime Plugin - Realtime graph viewing -feature: Merge Reporting (Nectar) Plugin - Reporting -feature: Merge RRDclean Plugin - RRD file cleanup and management -feature: Merge Secpass Plugin - User password policy enforcement -feature: Merge Settings Plugin - Shared settings for plugins -feature: Merge SNMP Agent Plugin - SNMP Agent for Cacti providing system statistics -feature: Merge SpikeKill Plugin - Remove unwanted spikes from graphs -feature: Merge SSL Plugin - Force https -feature: Merge SuperLinks Plugin - Add external links within Cacti -feature: Merge UGroup Plugin - User groups with permissions -feature: Merge Watermark Plugin - Watermark your Cacti graphs -bug: Fixed issue where old graph templates (0.8.6-), could import bogus data causing issues with Data Input Methods -bug#0000168: Duplicate data sources should be avoided when creating new graphs -bug#0000851: Review an imported template -bug#0001155: When viewing graph tree do not show empty nodes -bug#0001337: Form to filter for graphs in host view mode -bug#0001552: Date ranges not shown on graphs in the view with Daily, Weekly, Monthly & Yearly graphs -bug#0001573: RRA templates/grouping -bug#0001577: Override session handling and store session in Database -bug#0001790: Allow for XML delimiter in fields of a script query -bug#0001820: Unable to use a Data Input Method Output Field in more than one Data Source Item -bug#0001827: Changing the graph template messes up the graph item fields -bug#0001836: Add mysql error message to log -bug#0001877: Cookies path is not properly set -bug#0001966: Expand Devices in tree view not honored -bug#0001970: Data query index order cache should be populated on re-index -bug#0001981: Cacti is not full UTF-8 -bug#0001986: CLI allow add_graphs.php to have multiples --snmp-field and --snmp-value options -bug#0001996: Allow using data input field in graph title -bug#0002096: Enumerated SNMP values not parsed correctly -bug#0002112: CLI add configurable parameters for device_add.php -bug#0002133: Restrict User to only manage specific device(s) -bug#0002135: Regular expression support for filter -bug#0002137: Data query oid_suffix parameter does not function -bug#0002159: Database creation file not fully compliant with strict SQL mode -bug#0002162: Unable to authenticate user with password containing UTF-8 -bug#0002196: Incorrect script server instance number in log -bug#0002225: Make -Cc SNMP option configurable -bug#0002255: Script query_unix_partitions.pl should only query local mounts -bug#0002336: Implement php-snmp class library -bug#0002340: Data query script execution should be escaped -bug#0002350: SNMP Data Query index_order ignored -bug#0002351: Ping does not work with non-English locale -bug#0002361: Spine does not log unknowns the same way cmd.php -bug#0002362: Poller cmd.php makes wrong hex-string to decimal conversion -bug#0002370: Cacti prints wrong date formats, does not honor a systems locale -bug#0002403: Typo in DELETE statement leading to poor graphing performance -bug#0002412: Graph Template duplication causes \t to be converted to TAB char -bug#0002418: Data Source Items named 'ds' break UI ability to add more items -bug#0002419: SNMP enum results not parsed correctly by cmd.php poller -bug#0002452: CVE-2014-4000 PHP Object Injection Vulnerabilities -bug#0002454: OS Command Injection -bug#0002468: Changing graph format to anything but PNG causes no output -bug#0002476: Add support for SNMP v3 EngineID -bug#0002483: Cisco ASA using Re-index method of verify all causes recache event every time -bug#0002484: Incorrect SQL request in cli script repair_database.php -bug#0002521: Unable to create two devices via CLI with the same IP-Address -bug#0002522: Zero padded hex strings are parsed incorrectly -bug#0002535: Graph Template Changes not updating RRDtool command -bug#0002636: Creating Data Template with "U" for min and max saves field data_input_field_id as 0 for first item -bug#0002697: CVE-2016-2313 allows remote authenticated users who use web authentication to bypass intended access -bug#0002698: When the host is down the wrong data type are used for some columns in the host table -bug#0002723: Renaming a disabled device still attempts to connect and get SNMP host information -bug#0002724: Multipage graphs the menu can disappear -bug#0002725: Changing graph template does not mark correct interfaces disabled on data query generated list 0.8.8h -bug:0002656: Authentication using web authentication as a user not in the cacti database allows complete access (regression) -bug:0002667: Cacti SQL Injection Vulnerability -bug:0002666: When click the [Clear] button after clicking the [Refresh] button in Preview Mode , fails to CSRFcheck -bug:0002673: CVE-2016-3659 - Cacti graph_view.php SQL Injection Vulnerability -bug:0002676: Outdated MIBs for non-unicast packets -bug:0002677: Index is a MySQL 5.6 reserved word -bug:0002681: generate_graph_def_name() generates reserved word "cf" 0.8.8g -bug:0002161: Graph management "graph()" function conflicts with graphviz PECL extension graph() -bug:0002320: Unable to delete more than 500 graphs at once -bug:0002591: graph_view.php - unable to advance to Next Page in Tree View -bug:0002608: cacti 0.8.8f - Data Templates - Poller/script issue with backslash -bug:0002618: bug/syntax error in html_utility.php -bug:0002616: cdef.php -- Extra php closing tag -bug:0002617: PHP Warning is thrown when trying to include auth_login.php -bug:0002623: log warning display wrong time_interval -bug:0002627: Graph tree doesn't work in Internet Explorer -bug:0002601: graphs_new.php query not sorted as per definition xml:index_order -bug:0002625: Plugins don't display the next page -bug:0002631: RRDtool export not XML compliant - results in empty CSV exports -bug:0002622: graph_view.php -- Navigation and Content Areas are not visible in Tree Mode -bug:0002626: Unable to add two users in a row - Notice: Undefined index: id -bug:0002620: Unable to copy user -bug:0002618: bug/syntax error in html_utility.php -bug:0002646: SQL injection in graph.php -bug:0002656: Authentication using web authentication as a user not in the cacti database allows complete access -bug:0002647: 0.8.8g rev 7767 Can add cacti devices to graph tree "Save Failed" -bug:0002652: CVE-2015-8604: SQL injection in graphs_new.php -bug:0002655: CVE-2015-8377: SQL injection vulnerability in the host_new_graphs_save function in graphs_new.php -bug:0002629: Cacti lacks tab icons in chrome from android -bug:0002619: Fix incorrect placement of htmlspecialchars() in tree.php -bug:0002642: ping.pl does not take into account host port numbers -bug:0002567: RRDtool 1.5.x Support -bug:0002269: |query_ifSpeed| in --upper-limit for graph template does not work with empty ifSpee 0.8.8f -bug:0002599: 0.8.8e Poller Script Parser is Broken -bug:0002600: cli/upgrade_database.php is missing releases -bug:0002603: Graph managment graphs.php save button does not work -bug:0002599: Poller Script Parser is Broken 0.8.8e -bug: Fixed issue with graph zooming failing to work -bug: Fixed various SQL Injection vectors -bug#0002569: Impossible to have a URL pointing directly to a graph -bug#0002574: SQL Injection Vulnerabilities in graph items and graph template items -bug#0002577: CVE-2015-4634 - SQL injection in graphs.php -bug#0002579: SQL Injection Vulnerabilities in data sources -bug#0002580: SQL Injection in cdef.php -bug#0002582: SQL Injection in data_templates.php -bug#0002583: SQL Injection in graph_templates.php -bug#0002584: SQL Injection in host_templates.php -bug#0002586: Cannot delete data sources from the GUI -bug#0002592: graph_view.php - viewing host in new tab - Undefined index: nodeid -bug#0002594: status_fail_date and status_rec_date are set incorrectly after host is marked down -bug#0002597: Incorrect value in Hosts column on Host Templates page -bug#0002598: Incorrect row number in Devices -> (Edit) page 0.8.8d -feature: Remove un-needed fonts and javascript files -bug: Fixed XSS VN: JVN#78187936 / TN:JPCERT#98968540 -bug#0002261: PHP 5.4.0 added new error_reporting variable, causing cacti to show errors -bug#0002391: Odd Behaviour on ReIndex of Data Query Data -bug#0002393: Broken thumbnail images for graph templates -bug#0002402: Subtree must not have the same header as the parent header -bug#0002474: CLI add_device.php dows not set availability_method correctly -bug#0002449: The Save button does not work: Invalid html on page Console -> Cacti Settings: empty form tag -bug#0002428: Fail to delete all data input items when removing more than 1000 data sources -bug#0002439: Password with special character don't work with LDAP authentication -bug#0002461: invalid bn with ldap and anonymous bind -bug#0002465: Graph Export return empty CSV file -bug#0002484: Incorrect SQL request in cli script repair_database.php -bug#0002485: Broken pagenation on graph viewing -bug#0002489: SNMP - Get Mounted Partitions using Re-index method of Index Count Changed causes recache event every time -bug#0002490: Can not select page for multiple datasources per device -bug#0002494: CSV export always shows last day -bug#0002504: Data template search not functional -bug#0002542: [FG-VD-15-017] Cacti Cross-Site Scripting Vulnerability Notification -bug#0002543: Unable to switch pages within graphs_new.php due to invalid URL generation -bug#0002544: Duplicate entry in $nav_url during list view -bug#0002571: SQL Injection and Location header injection from cdef id CVE-2015-4342 -bug#0002572: SQL injection in graph templates CVE-2015-4454 0.8.8c -bug#0002228: GPL incompatible files included in Cacti project in include/treeview -bug#0002383: Sanitize the step and id variables CVE-2013-5588, CVE-2013-5589 -bug#0002385: Cannot export host templates while including dependencies -bug#0002386: cli/upgrade_database.php is missing the last two releases -bug#0002390: Poller/script issue with slash and backslash -bug#0002405: SQL injection in graph_xport.php -bug#0002431: CVE-2014-2326 Unspecified HTML Injection Vulnerability -bug#0002432: CVE-2014-2327 Cross Site Request Forgery Vulnerability - Special Thanks to Deutsche Telekom CERT -bug#0002433: CVE-2014-2328 Unspecified Remote Command Execution Vulnerability -bug#0002434: Suppress SNMP UNITS Suffix from cacti_snmp_get() output -bug#0002438: Down Host Detection issue when using SNMP Desc or SNMP getNext -bug#0002446: Subtract plugin processing time from Poller sleep time -bug#0002453: CVE-2014-4002 Cross-Site Scripting Vulnerability - Special Thanks to G. Geshev (munmap) -bug#0002455: Incomplete and incorrect input parsing leads to remote code execution and SQL injection attack scenarios -bug#0002456: CVE-2014-5025 / CVE-2014-5026 - Cross-Site Scripting Vulnerability - Special Thanks to Adan Alvarez and Paul Gevers -bug#0002495: Graph Filter Date Range -bug: Fix COMMENT handling, even in case COMMENT is empty, with or without HR and with variable substitution -bug: Fix issues when SNMP data holds a "="; "explode" must be treated accordingly -bug: Fix filter highlighting on data sources for the data template field -bug: correct description of SNMP V3 parameters -feature: Added native jquery, jqueryui, and jstree -feature: Fixed issues with 'Clear' under preview not working -feature: Added new Tree navigation -feature: Added Columns and Thumbnails to Preview -feature: Added Columns to Tree (Preview only) -feature: Both Graphs and Columns default to 'Default' -feature: Resolved Left hand navigation taking entire page -feature: Added new graph zoom to tree view and preview offering a "quick" (default) and an "advanced" mode 0.8.8b -bug: Fixed issue with custom data source information being lost when saved from edit -bug: Repopulate the poller cache on new installations -bug: Fix issue with poller not escaping the script query path correctly -bug: Allow snmpv3 priv proto none -bug: Fix issue where host activate may flush the entire poller item cache -security: SQL injection and shell escaping issues 0.8.8a -bug#0002207: cannot export graph templates -bug#0002208: Graphs with CDEFs fail to generate -bug#0002209: External auth does not work behind a reverse proxy -bug#0002211: creating an index USING BTREE fails ony MySQL < 5.0.60 -bug#0002213: CLI upgrade script is missing 0.8.7i as a target -bug#0002214: SQL error during non-PIA upgrade to 088 when giving a default for a text field in plugin_realms -bug#0002216: use of define_syslog_variables() gone in PHP 5.4 -bug#0002217: url_path should default to /cacti/ -bug#0002221: Missing plugin directory causes endless loop in plugins.php -bug#0002222: tail_logfile hangs when cacti.log not readable, filling apache log with fgets warnings 0.8.8 -bug#0002056: un-initialized datetime used for host status (was: Zero length string != NULL) -bug#0002081: In Graph Management, search display graph title breaks when using pattern symbol "/" -bug#0002132: need to include pa.sql with the 0.8.7i and future releases -bug#0002134: rebuild_poller_cache.php --host-id deletes table poller_item completely -bug#0002141: cacti.sql missing BTREE PRIMARY KEY for poller_output -bug#0002146: Utilities -> View Log File -> refresh does not work -bug#0002150: usort_data_query_index() is broken -> graph order for hosts with data query sort option fails -bug#0002151: When building HTML forms with sub_checkbox on_change parameter is not used -bug#0002152: Issue with filter on graphs_new.php -bug#0002153: Cant search for patterns containing a forward-slash -bug#0002156: CDEF strings are not escaped before passed to rrdtool command -bug#0002158: Minor changes to grammar of displayed messages -bug#0002165: Using data input field in data source name (related to 2079 in 0.8.7i) -bug#0002167: New poller hook poller_finishing -bug#0002172: structure_rra_paths.php does not handle disabled data sources -bug#0002174: poller_item.host_id has wrong type -bug#0002178: typo in include/global_form.php: Mimimum -> Minimum -bug#0002181: session_unregister (use in functions.php) doesn't exist anymore in PHP 5.4 -bug#0002182: When there is no suitable (unique) index, graphs are not shown in data query ordering on host leafs -bug#0002189: Proper graph hooks -bug#0002191: Refresh issues -bug#0002194: changing data query XML does not propagate to existing data sources -bug: Fix input validation on cli/api_device.php -bug: Fix issue with data source template associate command line script inserting incorrect rra information -bug: Fix minor display issue on data source pages -bug: Fix minor issue with counting items in the poller_output table -bug: Graph settings and settings check boxes do not allow unchecking to be saved -bug: Fix minor issue with plugin library caused by non-session -bug: Fix SQL error on data input save for non-templated graphs -bug: user_log index added to increase performance -feature: Merge Plugin Architecture into Cacti -feature: Added index to data_template_data to increase performance 0.8.7i -bug#0001963: Bandwidth summation "total in" and "total out" are always 0 -bug#0002040: ICMP ping errors for Windows 7 with PHP 5.3 -bug#0002062: Multiple security vulnerabilities -bug#0002063: Multiple value poller output incorrectly interpreted as hexadecimal value -bug#0002064: Removing "~" (tilde) by sanitize_uri() conflicts with Apache UserDir translation -bug#0002066: Graph without host id "Notice: Undefined variable: host_id" -bug#0002067: Custom time range filter not working -bug#0002068: Missing header include in analyze_database.php -bug#0002071: MySQL table poller_item is dropped always when "Data Input Method" is changed or added. -bug#0002079: Using input field of a script in graph title does not work -bug#0002080: Database password containing "@" does not connect -bug#0002083: Adding a new users generates errors in apache logs -bug#0002084: Incorrect normalization of hrStorageTable values over 2^31 -bug#0002086: Incorrect usage of mysql custom tcp port -bug#0002087: PHP recache problems due to missing slashes in reindex table -bug#0002093: Unit exponent value of 0 not imported with graph template -bug#0002094: CDEF: "another cdef" references not included in template export -bug#0002106: Command line add device does not accept "None" for host template -bug: Update host template cli script help to fix incorrect options -bug: Refresh of Cacti log viewer not working -bug: Problems saving User Graph Permissions in IE9 -bug: Bandwidth summation fails if NAN values are present -bug: Special Type Code "host_id" available in Data Queries by Not Data Input Methods -bug: Do not generate error messages when creating non host based graphs -bug: Wrong index used for Data Queries using VALUE/REGEXP -bug: Fix issue with title variable replacement failing when no host is associated with graph -bug: Cacti generating MySQL 1100 Errors when modifying the tree -bug: Resolved "Fatal error: Cannot use string offset as an array" in lib/data_query.php -feature: Properly support ifHighSpeed replacement variable -feature: Increase granularity of availability options to correct spine bug -feature: Replace "event count" with last changed date for host availability 0.8.7h -bug#0001403: Reapply Suggested Names does not work correctly for graphs and data sources not associated with Data Queries -bug#0001568: Remove PHP 5.3 deprecated functions -bug#0001584: Concurrent changes to graph tree ordering can corrupt sort values -bug#0001626: Symbol ($) does not appear in labels/gprint strings to rrdtool during graph generation -bug#0001632: Script server treats quoted arguments with spaces incorrectly as multiple separate arguments -bug#0001646: MySQL SSL connection support -bug#0001660: Modifying data template values does not propagate as expected -bug#0001678: Adding graphs to a device fails to add entries to poller_item if using the script server -bug#0001768: Perform consistency check on ds maximum vs. ds minimum -bug#0001783: Graph Export export date is incorrect -bug#0001812: Data template copying ignores some item templating -bug#0001814: Command line device add script fails when SNMP default is disabled -bug#0001815: One minute polling not working correctly -bug#0001816: Cannot export graph data to CSV with IE 8 -bug#0001819: MySQL "TYPE=" command deprecated since MySQL 4.1 removed in MySQL 5.4.4 -bug#0001826: Zoomed graph views should auto refresh -bug#0001828: Reapply Suggested Name prompt as spelling problems -bug#0001835: Graph edit page has more than one html form tag -bug#0001847: Graph export API function has required argument not defined -bug#0001851: Graph creation selector does not work with data query that has no associated graph templates -bug#0001855: Improper formatting of data queries can result in SQL errors -bug#0001862: Ping script does not process output of update ping utility -bug#0001867: RRDtool Cacti fetch function does not work for some locales -bug#0001876: PHP function strip_quotes causes HEX values to be truncated -bug#0001880: Form validation error message does not highlight text area control -bug#0001882: Cacti snmp_walk function fails if max_oids is an empty value -bug#0001890: Default tree view mode set to single pane mode not working -bug#0001893: Data input method description text does not make sense -bug#0001900: Equal sign not correctly parsed in snmp data results -bug#0001903: Undefined variable: mode in lib/ldap.php on line 375 -bug#0001918: Script server does not accept more than one blank space before the function name -bug#0001926: Importing templates "using defaults for this installation" associates all rra's defined -bug#0001928: graph_image.php does not check local_graph_id -bug#0001929: Error when exporting templates are not properly reported -bug#0001930: No error reporting for wrong RRA -bug#0001934: Poller does not process SIGTERM signal correctly -bug#0001936: Removing multiple data sources is inefficient -bug#0001937: Technical support page uses check table which waits for table lock -bug#0001939: Do not query for number or items per host if concurrent polling processes is set to one -bug#0001954: Usage of PHP_SELF without basename in html.php (at least partly fixed) -bug#0001956: Attempts to update existing tree item fail -bug#0001967: Reflected XSS on Cacti 0.8.7g -bug#0001989: IE9 breaks Cacti when objects are hidden using 'display:none;' style tag -bug#0001993: Undefined index in lib/html.php -bug#0001995: REQUEST_URI not properly escaped in graph_view.php for preview mode -bug#0002005: Saving Script Server or Script Data Input Method Results in SQL Error -bug#0002060: NAN values in hdd utilisation graphs (Poller Output Table not Empty) -bug: Fix SQL injection issues in login page -bug: RRDtool fetch in Cacti fails to function properly on rrdtool files with NaN values in the output -bug: Accept "Connection refused" on TCP ping tests -bug: Add missing row selection javascript to graph preview -bug: Script server throws "undefined variable" error when in debug mode -bug: Removing graphs does not take advantage of bulk deletes -bug: Fixed issue with multiple "U" results for a data input method with multiple output parameters -bug: SNMP v3 use AuthNoPriv when privacy passphrase is empty -bug: Fixed sql errors when using template and search filter on graph management -bug: Delete Data Source multi fails to perform bulk deletes on Data Source items -bug: Allow Timespan Selector to work with $_REQUEST as well as $_POST -bug: While in the mrtg view of Cacti Graphs, or in viewing graph properties zoom fails -bug: The filepath api call should trim the filename before checking for the files existance -bug: Fix issues with IE9 while editing templates -bug: Form action in graph_items.php incorrect -bug: Initial drawing of tree causing Next/Previous with malformed URI -feature#0001519: Spine enhancement for parallel collection of data at device level -feature#0001667: Get values of |host_*| variables in graph elements from data source -feature#0001922: Reindex method "Index Count Changed" requires that OID_NUM_INDEXES is given for SNMP Data Queries -feature#0001923: Implement counting for script (server) data queries just like OID_NUM_INDEXES -feature#0001924: Allow for reindex method "Index Count Changed" to apply to script (server) queries as well -feature#0001952: Ability to use input field of a script in graph title -feature: Make reindexing and repopulating the poller cache a lossless process -feature: Change default font sizes -feature: Add analyze database and push out host cli scripts 0.8.7g -bug: RRDtool 1.4.x not recognized during installation -bug: Implement windows-aware shell escaping -bug: Fixed multiple cross site scripting vulnerabilities reported by Tomas Hoger of the Red Hat Security Response Team -bug#0001292: Over 8TByte Partition in Windows cant get correct data from snmp -bug#0001486: Unable to login after redirection to access denied page -bug#0001516: "Show the page that user pointed their browser" does not seem to work -bug#0001561: Over zelous HTML excaping on filter strings -bug#0001575: LDAP-Authentifications does not work due to ldap_host being set incorrect -bug#0001587: Feature from bug#0001271 breaks on large values -bug#0001607: Web Basic authentication does not work with fastcgi -bug#0001620: Max OID's max value reported incorrectly in Web UI -bug#0001747: oid_suffix do not work correctly for input direction on data queries -bug#0001756: Alternate font styles do not work correctly -bug#0001757: LDAP realm authentication outputs warning for undefined index -bug#0001763: Unable to add graph permissions on a user -bug#0001765: Tech support does not work correctly with RRDtool 1.4.x -bug#0001766: Page refresh setting not being honored -bug#0001771: "index count changed" not implemented for query_unix_partitions.pl, query_host_partitions.pl, query_cpu_partitions.pl, ss_host_cpu.php and ss_host_disk.php -bug#0001773: Character encoding problem after upgrade to 0.8.7f -bug#0001775: Tech support page does account for no memory limit set for PHP -bug#0001776: Simultaneous databases connections are not supported 0.8.7f -security: SQL injection and shell escaping issues reported by Bonsai Information Security (http://www.bonsai-sec.com) -security: Cross-site scripting issues reported by VUPEN Security (http://www.vupen.com) -security: MOPS-2010-023: Cacti Graph Viewer SQL Injection Vulnerability (http://php-security.org) -bug#0001125: XML parse error on template import with degree symbol -bug#0001311: Access denied for graph-only users when accessing index.php directly -bug#0001366: Exported data templates do not import special characters properly -bug#0001416: Graph Export fails with EXPORT FATAL ERROR: Export path /some/path/root/export is within a system path /root. Can not continue. -bug#0001452: Missing "<" and ">" in "Collection Methods=>Data Input Methods=>"Input String" after importing template -bug#0001461: Data query export/import fails -bug#0001492: RRDtool 1.3 series fonts (fontconfig) support -bug#0001506: Reindexing fails due to global include issue in lib/snmp.php -bug#0001522: Special characters break parsing of template data -bug#0001524: Export graphs and Classical Presentation does not honor per graph export rules -bug#0001528: ICMP Ping availabilty broken in UI for Windows Servers using IIS -bug#0001535: No display of parent ID in tree nodes for CLI tree add script -bug#0001543: All graphs are exported dispite graph export rules -bug#0001549: Function array_to_sql_or creates poor sql where clauses -bug#0001557: Quotes in Text Format graph template field break graph rendering -bug#0001587: 64bit HEX Strings do not convert to Decimal on 32bit Systems -bug#0001604: HEX Counter values enclosed in quotes not recognized as HEX -bug#0001609: Script server timeout too aggressive with 10 second poller interval -bug#0001628: Inconsistent message for Change SNMP Options related to available buttons -bug#0001695: Suppress deprecated warnings in Cacti code -bug#0001725: PHP Fatal Error while trying to add a tree node via cli -bug: When creating new graphs without a data source, print error to user instead of throwing php error -bug: Browser query string does not contain arguments -bug: Function inject_form_variables does not operate if more than 1 variable needs replacing -bug: Script imposed memory limits cause issues with some scripts -bug: Turn off process leveling if there are not enough poller items to substantiate it -bug: Add device should allow no-snmp type devices -bug: Firefox Autocomplete causes issues with password validation -bug: Access Denied messages do not allow re-direction to login page -bug: When clearing filter on new-graphs do not clear host or template -bug: When clearing filter, reset page to 1 for all queries -bug: Graph List selectors do not persist between pages -bug: allow empty [upper|lower]_limit even without autoscaling -bug: Availability method Ping or SNMP generates meaningless warnings -feature: Add logging to SQL Save error handling -feature: Add utility to convert database to InnoDB -feature: Return nav as the title for the page -feature: Detect and correct for RRDtool segfaults -feature: Add rra_id for hosts and graphs to be used during tree export -feature: Make the Graphs pages render like the rest of Cacti -feature: Convert base Cacti UI to use buttons and not images -feature: Make poller sane so that it can be used by other cacti processes -feature: Add snmp timeout warnings for lib/snmp.php 0.8.7e -bug#0001044: Creating a DS, Output field can't be selected for DT with a DIM when "Use Per-Data Source Value" is on -bug#0001341: SNMP query: add oid_suffix for weird SNMP queries -bug#0001345: Overwriting $snmp_index in query_snmp_host() breaks SNMP Data query if using get method -bug#0001346: Strip out noisy 'No Such Instance currently exists at this OID' -bug#0001404: timeout in "function ping_icmp" (lib/ping.php) -bug#0001405: Spaces in DS when .rrd file is created, so it fails -bug#0001407: Place graph thumbnail into div to lower page length changes on load graphs -bug#0001410: Thumbnail Columns is not honored for host display with snmp index group style -bug#0001411: Graph searching issue -bug#0001413: strip_quotes fails -bug#0001426: multiple form opening due to bug in draw_edit_form() -bug#0001436: CSV Export Start Date and End Date are always 1970-01-01 01:00:00 -bug#0001443: format_snmp_string can return a number with a leading space -bug#0001446: Wrong dates override in CSV export -bug#0001456: oid_uptime is not parsed correctly -bug#0001460: Skiping input parameters in data_query_field_list() may lead to SQL errors -bug#0001464: Typo in install/index.php -bug#0001467: Customisable oid index parse regexp for weird MIBs -bug#0001468: Tree is not expanded correctly -bug#0001469: Tree is not being expanded if user followed link outside of cacti -bug#0001476: Mark stacked columns in rrdtool_function_xport() output -bug#0001477: Spelling error in a variable in html_tree.php -bug#0001478: Combo boxes on Graph Management page produce URLs with leading spaces -bug: Top Graph Header Breaks When Plugins Used -bug: SNMP v3 Password issue caused by Firefox's Password AutoFill -bug: Strip Quotes does not properly handle the value 'U' -bug: Changes to the graph tree would not show up immediately for current user 0.8.7d -bug#0001336: Allow to specify on_change handler for checkbox_group -bug#0001338: When Using Web Basic Authentication HTML Bookmarks Do Not Work -bug#0001388: Spine uses illegal flag for ping on Mac OS X -bug#0001351: Deleting 1000 graphs along with their Data Sources crashes the Server -bug#0001361: SNMP query: 'No more variables left in this MIB View' instead of value of input field -bug#0001374: ss_host_disk.php etc. error corrected when using SNMP V3 (index off by 1) -bug#0001376: graph_items.php variable $id defined in wrong place -bug#0001377: Several bugs in new cli script "structured_rra_paths" -bug#0001378: ping.pl script fails when using tcp:hostname -bug#0001382: cdef.php error due to wrong function name -bug#0001383: syntax error in lib/rrd.php with PHP 4.4.4 -bug#0001384: utilities.php does not handle view_snmp_cache when host_id = -1 (Any) -bug#0001385: LDAP Error: Group DN could not be found -bug#0001391: parsing snmp string with "=" ?? --> WARNING: Result from SNMP not valid -bug#0001392: Problem on CDEF function ALL|SIMILAR_DATA_SOURCES_(NO)?DUPS -bug#0001394: Error of variable in lib/html_tree.php -bug#0001398: Cross site scripting checking is overly protective on search filters -bug#0001400: LDAP authentication results in PHP warning message -bug: Resolved issue with reapply suggested names not working for data sources under certain conditions -bug: Correct missing db_conn argument issue -bug: Deleting large number of hosts results in SQL errors due to MySQL buffer overrun -feature: SNMP cli version information added to tech support page 0.8.7c -bug#0000157: Dual pane tree does not have the option of not rendering all trees in one page -bug#0000486: RRA template edit allows invalid XFF values -bug#0000626: Setting "Default Graph Tree" does not work with dual pane view -bug#0000828: Truncated IOS description in |query_ifAlias| -bug#0000909: ALL_DATA_SOURCES_NODUPS breaks graphing when using "Consolidation Function" MAX -bug#0000943: scripts/ping.pl has incorrect response when "icmp hop redirect" occurs -bug#0000948: Exporting graphs to a local path does not work correctly in some cases -bug#0000986: Graphs that are done by graph type are not exported when using the tree view -bug#0001022: strip_quotes incorrectly parses script output -bug#0001090: LDAP authentication fails when using quote character in password -bug#0001135: Graph export feature not exporting as per user level selected -bug#0001136: Regex ambiguous for mbstring -bug#0001138: Lack of error checking causes graphs to not update when rrdtool crashes -bug#0001141: Script server appears broken for "index" and "query" requests (Documentation Fix) -bug#0001145: Save Failed error when changing Graph Details -bug#0001153: Undefined variable: local_graph_id in graphs.php on line 201 -bug#0001166: Installer does not properly handle disabled guest_user conversion -bug#0001174: Unidentified index warning -bug#0001175: Hide hosts in Graph Permissions that you already have access to -bug#0001176: Problem validating IPv6 addresses -bug#0001188: Graph export issues in tree mode -bug#0001191: Faulty IP address validation by ping.php script -bug#0001180: Graph Export to CSV failed by using IE 6 SP2 -bug#0001194: RRDtool URL is incorrect on the about page -bug#0001204: Since upgrade to 0.87b the hosts with ip address with 255 are down and have no datas -bug#0001206: Graphs are not zoom-able with PHP warnings turned on -bug#0001211: Allow use of "REMOTE_USER" if "PHP_AUTH_USER" is not set for authentication -bug#0001213: Template Copy does not hash copied template_items -bug#0001215: Impossible to define a none availability with the client cli/add_device.php -bug#0001216: CSV Export for zoomed graph, results in Validation error -bug#0001217: Default Graph Tree is not reflected in Left Pane of the graph page -bug#0001223: Missing Hard return on last GPRINT causes bad formatting -bug#0001228: LDAP server port not honored -bug#0001230: Poller stops updating rrd files -bug#0001236: Set 'stats_recache' to zero when no re-index is present -bug#0001238: Guest user has access to change password -bug#0001239: Using the TOTAL_ALL_DATA_SOURCES in a graph where all item are using the MAX CF yields an invalid(empty) CDEF -bug#0001240: SNMP string cleanup removes too many '=' signs -bug#0001244: Missing closing on host.php -bug#0001247: Snmp ping won't work for snmp v3 -bug#0001256: Spine-poller.c : Bug in size string sysUptime -bug#0001258: "Remove Verification" is an ambiguous definition, leads to data loss -bug#0001259: LDAP Authentication using Solaris 10 standard ldap client fails -bug#0001262: Do not allow deletion of Graph Export User -bug#0001264: CDEFs can't recognize |query_*| -bug#0001268: resource/snmp_queries/net-snmp_disk.xml has incorrect name for "Percent Available" -bug#0001271: Hex string to decimal conversion for proper RRDtool storage -bug#0001273: Escape windows paths to accommodate spaces -bug#0001281: ICMP Ping fails if an octet == 255 -bug#0001283: graph_image.php causes PHP Notice errors on view -bug#0001286: poller_item cache is not updated when "Data Input Method" is changed -bug#0001288: A host with ICMP ping selected as method does not properly perform ping -bug#0001291: Reapply Suggested Names fails on Script Queries -bug#0001293: When Creating Data Query Graphs, Performing Search will Cause List to Disappear -bug#0001294: Stack overflow if database is not correctly initialized -bug#0001295: Division by zero when rrd_step < poller_interval -bug#0001296: add_graphs.php does not add the graph template to the host -bug#0001299: When creating graphs the entire poller cache is recreated for a host -bug#0001314: Use Data Query variables as HRULE input for graph templates -bug#0001318: Graph Export with 1 minute poller re-exports graphs 5 times -bug#0001320: Invalid PHP_SELF Path -bug#0001326: If a user's password contains a single quote the login fails -bug#0001342: VRULE printed as HRULE on graph_templates.php graph template item list -bug#0001380: Expand description of ping retries -bug: Remove include/html files to mitigate XSS issues -bug: IE generates errors on both the host and graph settings pages -bug: Host save failed in FireFox 3 for non-SNMP V3 hosts, complaining about "password mismatch" -bug: Initialization of snmp_auth when using SNMP=NONE -bug: Speed up add_graphs.php in most cases (still slow only if --input-fields is used) -bug: If the poller_output table is not empty, do not flood the log -bug: Remove warnings appear in the httpd log relative to reset attempts on settings array -bug: Add API Automation tool quietMode to additional functions -bug: When Cacti is launched from within an iframe, cookies are dropped from IE6 -bug: Database upgrade and cacti.sql differ -bug: drop color setting background on FF does not work -bug: cli/add_tree.php requires as least a host-id for --list-graphs -bug: add_tree.php did not allow nodes with propagating sort options -bug: When adding a tree node via the api numeric and natural were reversed -bug: When saving a data query based data templates, their data sources would become corrupt -bug: If your system contains INNODB tables, the Technical Support page would hang -bug: The default user tree link icon would not be properly highlighted when opening graphs -bug: Severe performance problems when adding data query based graphs. -bug: Default refresh on Cacti Log was too quick -bug: Some users do not like the idea of automatic page refreshes -bug: Allow more rows to be visible in Cacti pages -bug: Ping and SNMP should test both conditions -bug: When step is less than poller interval, item will stop polling for long period of time -bug: When using Web Basic authentication, user is directed to default page and not REQUEST URI -feature#0000284: Custom for each device -feature#0000431: Add php-xml to requirements, verify required PHP extensions -feature#0000852: Have "Previous" and "Next" disappear when not in use (only for graph display) -feature#0001082: Mirror Graph Rename based on template function to work with Data Sources -feature#0001140: CLI-Script to associate a graph template to a host -feature#0001162: WEB UI now accepts max_oids on SNMP bulkwalks -feature#0001177: CLI Reindexing - poller_reindex_hosts.php: allow filter on "host description" -feature#0001189: Introducing |data_source_title| variable -feature#0001195: Add graph title to graphs page -feature#0001201: Reapply Suggested Names for Data Sources and cli/poller_data_sources_reapply_names.php -feature#0001205: Add filtering and pagination to cdef management; add "Duplicate CDEF" -feature#0001220: Disable snmpbulkwalk if max OIDS is less than 2 -feature#0001233: Move $export_types variable definition from templates_export.php to include/global_form.php -feature#0001235: CLI script needs to activate a query: add_data_query.php -feature#0001250: Dispatching job in poller can lead to unbalanced threads -feature#0001249: New pseudo CDEF variables for "Count All|Similar Data Sources (NO)?DUPS" -feature#0001289: Add "Graph Properties" wrench to tree+preview mode -feature#0001323: List all graph template associated with a host template -feature#0001306: Add Blank Line as possible graph item -feature: Paginate Treeview Dual Pane -feature: Allow user to specify maximum graphs per page from Treeview Dual Pane -feature: Allow Treeview Dual Pane to be filtered for graph titles -feature: Allow the user to add or remove graph text from page for searching with the browser -feature: Add links to Graph Management and Data Sources to Device Edit Screen -feature: Add links to Graph Template and Host Edit to Graph Edit Screen -feature: Add links to Data Template and Host Edit to Data Source Edit Screen -feature: Support using the cacti database api with more than one connection -feature: Add some more debug lines to Data Query debugging (Verbose Query) -feature: Fix compatibility issues for RRDtool 1.3 -feature: Make the tabs section work a little better with existing plugins -feature: Add additional options to speed data query graph automation process -feature: Add additional indexes to speed data query graph creation -feature: Allow the cli reindexing of hosts to be limited to a single query -feature: New cli command host_update_template to allow re-templating of hosts using an updated template -feature: When reindexing hosts, allow a queryid to be specified -feature: Add command line Database upgrade script -feature: Add api call to associate graphs with their data sources -feature: Move the notes field to bottom of page -feature: New availability option "Ping or SNMP" -feature: Allow for specification of a default reindex method -feature: Show more colors on a single color's page -feature: Exit is either a database or table does not exist -feature: Add developer debug level to reduce SQL messages in DEBUG -feature: Add support for group membership for LDAP authenication 0.8.7b -bug#0000855: Unnecessary (and faulty) DEF generation for CF:AVERAGE -bug#0001083: Small visual fix for Cacti in "View Cacti Log File" -bug#0001089: Graph xport modification to increase default rows output -bug#0001091: Poller incorrectly identifies unique hosts -bug#0001093: CLI Scripts bring MySQL down on large installations -bug#0001094: Filtering broken on Data Sources page -bug#0001103: Fix looping poller recache events -bug#0001107: ss_fping.php 100% "Pkt Loss" does not work properly -bug#0001114: Graphs with no template and/or no host cause filtering errors on Graph Management page -bug#0001115: View Poller Cache does not show Data Sources that have no host -bug#0001118: Graph Generation fails if e.g. ifDescr contains some blanks -bug#0001132: TCP/UDP ping port ignored -bug#0001133: Downed Device Detection: None leads to database errors -bug#0001134: update_host_status handles ping_availability incorrectly -bug#0001143: "U" not allowed as min/max RRD value -bug#0001158: Deleted user causes error on user log viewer -bug#0001161: Re-assign duplicate radio button IDs -bug#0001164: Add HTML title attributes for certain pages -bug#0001168: ALL_DATA_SOURCES_NODUPS includes DUPs? SIMILAR_DATA_SOURCES_DUPS is available again -bug: Cacti does not guarentee RRA consolidation functions exist in RRA's -bug: Alert on changing logarithmic scaling removed -bug: add_hosts.php did not accept privacy protocol -security: Fix several security vulnerabilities -feature: show basic RRDtool graph options on Graph Template edit -feature: Add additional logging to Graph Xport -feature: Add rows dropdown to devices, graphs and data sources -feature: Add device_id and event count to devices -feature: Add ids to devices, graphs and data sources pages -feature: Add database repair utility -feature: Default Script Server/Script Queries now accept host specific ping_retries, max_oids -feature: Support for new variables |host_ping_retries| and |host_max_oids| 0.8.7a -bug#0000895: "Use Per-Data Source Value (Ignore this Value)" runs only when when checking "Allow Empty Input" -bug#0001029: Add --autoscale-min (rrdtool 1.2.x only) and --autoscale-max (using upper AND lower limit) -bug#0001035: Allow for --logarithmic scaling without autoscaling -bug#0001038: Data sources in RRAs have random order, messing up predefined CDEFs -bug#0001043: Graph Templates drop down populates with duplicates -bug#0001046: Upgrade from 0.8.6j to 0.8.7 defaults to Authentication Method NONE -bug#0001052: Graph template - GRINT creates CF function DEF -bug#0001055: Invalid date format - "half hour" not the GNU Date format -bug#0001057: SQL error when using 'Auth Method' None when no 'guest' user exists -bug#0001058: Graph Filter dropdowns do not respect user graph permissions -bug#0001059: Potential SQL injection vulnerability -bug#0001060: RRDtool 1.2.15 complain for garbage characters when rrdtool_function_xport is used -bug#0001061: cmd.php: potential call to invalid "availability_method" key on wrong hash -bug#0001064: Log file viewer inefficient filtering uses excess memory -bug#0001066: doc change for using COUNTERs as integers only -bug#0001067: Fixed extra spaces in GPRINT. Better Alignment for Autopadding -bug#0001068: doc change for patching cacti when running SELinux -bug#0001070: Cron interval detection causes multiple pollers to run -bug#0001073: Max OIDS is not saved in device view -bug#0001078: Undefined variable: rra in graph.php on line 241 -bug#0001079: Dates are not stored in host table using correct format -bug#0001080: Graph Export Generates SQL Errors -bug#0001081: Usernames with spaces and dashes are not able to save -feature#0001035: Allow for --units=si on logarithmic scaled graphs (rrdtool-1.2.x only). -feature#0001069: add opacity/alpha channel to graph items (rrdtool-1.2.x only). -feature#0001065: Move to Top for List and Tree View. Omit boring scrolling -feature: add availability pings to host interface 0.8.7 -bug#0000480: Fix error after altering graphs displayed per page -bug#0000740: Add support for setting the PHP session name of Cacti -bug#0000829: Add support for an specifying an uptime OID for SNMP queries -bug#0000830: Add filtering graphs by Graph Template -bug#0000833: Add favicon.ico support -bug#0000850: Add Select All for graph list view -bug#0000854: Move "Downed Host Detection" into the device edit screen -bug#0000873: Fix issues with the poller hanging in certain situations -bug#0000876: Add ability to search for host with a not UP status -bug#0000898: Selecting a CUSTOM timespan and then CLEARing yields "LAST HALF HOUR" preset -bug#0000899: Add local checking to the Paths tab on the Settings page -bug#0000902: Fix issues with cmd.php and PHP 4.4.1 under windows -bug#0000903: snmpgetnext function does not exist in PHP less than 5.0 -bug#0000904: Data Source creation fails without php-snmp -bug#0000906: Every tenth host does not show on tree during console edit -bug#0000907: Sorting of data sources when interface numbers are used without leading zeros are incorrectly sorted -bug#0000908: Graphs created by SNMP data queries are losing their specific names if the template is modified -bug#0000910: Cacti complains when trying to set the data source "maximum value" to any number with a decimal point -bug#0000912: Nth Percentile thumbnail graphs fail with RRDtool 1.2.15, 1.2.18 -bug#0000913: Allow direct linking to specific graph pages -bug#0000919: Fix problem with ping_tcp function -bug#0000920: Improved handling of rrdtool --font parameter -bug#0000921: Improvement to ping.pl script -bug#0000925: Support for host_* variables in the legend -bug#0000926: Stop removing useful characters when searching -bug#0000927: Classic export does not recognize thumbnail columns properly -bug#0000931: New rrdtool fails on empty comment -bug#0000934: Column 'status_last_error' in table 'host' too short. -bug#0000937: System output in hosts.php poor for Alcatel -bug#0000946: Timetick of zero returns down for device -bug#0000947: Trailing blank on OID in form causes problems -bug#0000953: SNMP Passphrase is displayed in cleartext -bug#0000954: Y-grid lables are not informative when using --alt-autoscale -bug#0000955: Fixed possible denial of service attack by modifying graph image URL -bug#0000956: Additional editing help with tree management -bug#0000957: Script server output's beginning/trailing data during "Include" causing a synchronization issue -bug#0000958: Slope Mode is now selectable -bug#0000959: Alarming added when poller output table is not empty -bug#0000963: TCP/UDP capitalization -bug#0000965: When setting filters under utilities, pressing enter takes you back to the main page -bug#0000966: Log file viewing utility has no ability to filter -bug#0000969: In some versions of PHP, the graph tree will not view properly -bug#0000970: Incorrect debug messages in lib/ping.php for failed UDP ping -bug#0000974: No graphs on Fedora core6 using sunone/iplanet 6.1 SP5 -bug#0000975: Add Nth Percentile aggregate_current - Summing Multiple Data Sources with like names for Nth Percentile -bug#0000982: Remove invalid references to the "output_string" column in the "data_input" table -bug#0000983: Bad SQL: snmp_query_graph_rrd.snmp_query_graph_id= -bug#0000984: Poller does not correctly flush poller_output table after a memory error -bug#0000989: hyphen - host description used with Data Source Path -bug#0001001: "Purge User Log" keeps invalid entries -bug#0001002: Cacti reports incomplete interface status -bug#0001007: SNMPv3 password field allows command injection -bug: ss_sql.php causes the script server to crash -bug: Timeshifter added to base code -bug: Allow query_ and host_ substitution in COMMENT and CDEF's. -bug: Command line interface scripts to add devices, graphs, tree's and permissions. -bug: Correct index error when creating graphs when you have no hosts on your system. -bug: More recent versions of net-snmp broke SNMP walk functions. -bug: Adjust for problematic responses from some SNMP agents (IBM AIX). -bug: Improve logging in cmd.php and poller.php when parameters are not specified correctly. -bug: Reduce the total number of SQL queries called -bug: Replace inefficient strip function in process_poller_output -bug: Some php_snmp implementations return strings as "Hex-STRING:". In these cases properly resolve the string -bug: Correctly assign right and left click actions for Opera -bug: Fix SQL error when viewing an invalid Data Source via the Log Viewer -bug: Fix command line user copy utility -feature: Paginate the Graph Creation Page -feature: Add SNMPv3 Support to Cacti -feature: Add a Notes field to the Device that can contain arbitrary information -feature: Add Availability Methods to Cacti including per Host Ping Methods and Timeouts -feature: Add Max OID's to te Host Level -feature: Allow CSV Export from the various Graphs page -feature: Add rra_path as a global.php config variable -feature: Add drop down actions to data queries -feature: Add drop down actions to data input methods -feature: Add drop down actions to user administration -feature: Add filtering and pagination to data queries -feature: Add filtering and pagination to data input methods -feature: Add filtering and pagination to host templates -feature: Add filtering and pagination to user administration -feature: Add extended LDAP authentication support -feature: Add Web Basic authentication -feature: Add authentication realm to modifiable user parameters -feature: Add multiple polling intervals -feature: Moved command line scripts to cli sub directory -feature: include/config.php now only includes database configuration -feature: include/config_* have been renamed to include/global_*. Note: Script servers need to be updated. -feature: Allow VRULE's in Cacti to specify an absolute timestamp in addition to [+/-]HH:MM -feature: Add 1 minute RRA -feature: Add item select highlighting to main pages -feature: Let poller.php be more intelligent about poller intervals less than 60 seconds -feature: Add consistency to Filters by adding nowrap to td items -feature: Add Graph and Data Source counts to Device page -feature: Add Poller Interval to Data Sources page -feature: Keep filters aligned with main page content on window resize -feature: Add Enable/Disable user -feature: Add copy and batch copy of users -feature: Reduce ADODB memory consumption during polling -feature: Add new RRDtool Function to facilitate CSV export -feature: Add the ability to ignore custom RRA settings when importing templates and use this behavior by default -feature: Add technical support output to System Utilities -compat: Add additional checking due to php-snmp changes in Windows -compat: Remove GIF as a supported file type for RRDtool 1.2.x and added SVG file type 0.8.6j -bug#0000842: SNMPv3 password field does not check if entered passwords match. -bug#0000848: Fix "PHP Script Server communications lost" error in the poller under high network load. -bug#0000859: User log "purge" now keeps the last successful login. -bug#0000861: Use downed host detection even when the SNMP community is blank. -bug#0000864: Apply natural sort to graph items in the tree. -bug#0000867: Apply various cleanups to poller.php and lib/poller.php. -bug#0000870: Add sorting to the graph templates list on the "Change Graph Template" page. -bug#0000877: Fix issue that caused PHP 5.2.0 to break the Windows cmd.php poller. -bug#0000882: Add "collapsible" branches to the graph tree editor. -bug#0000883: Fix exploit in cmd.php with register_argc_argv enabled in PHP. -bug#0000884: Add bottom navigation bar to graph viewing. -bug#0000885: Fix issue causing spaces to be removed when importing/exporting data input methods. -bug#0000886: Allow SNMP ping to utilize the snmpgetnext call instead of snmpget. -bug#0000890: Fix issue with dec-vulnerability-poller patch breaking graph_view.php. -bug#0000892: Fix hostname sorting on the devices page for IP addresses. -bug#0000894: poller.php does not give any output with MySQL disabled in CLI's php.ini. -bug: Template export produces invalid XML escaped character encoding. -bug: Data queries were not sorted properly during initial display. -bug: Apply various graph changes required for Boost plugin. -bug: If your system has no hosts or graphs, you would get a warning when creating new graphs. -bug: If using the CGI version of PHP, the script server risked not starting properly. 0.8.6i -bug#0000188: Add ability to sort columns by selecting column headers. -bug#0000199: Exported thumbnail graphics shows limited time range only. -bug#0000207: Correct unit size displayed in the default 'Localhost - Memory Usage' graph. -bug#0000286: Fix issue with bandwidth summation on exported graphs. -bug#0000313/#0000561: Don't print menu/titlebar by using CSS class noprint. -bug#0000316: Take the unit value field into account when creating graphs. -bug#0000395: Fix graph export FTP functionality in Unix environments. -bug#0000430: Add natural sort order option for graph trees. -bug#0000433: Remove script server restriction on varying case path names. -bug#0000488: Remove reliance on HTTP_USER_AGENT to prevent possible notices. -bug#0000527: Fix issue updating the RRA for a graph tree item. -bug#0000584: Add barometer decimal fix to scripts/weatherbug.pl. -bug#0000624: Generate DEFs for graph items other than AREA, STACK, and LINE. -bug#0000643: Always display a human readable sysUpTime in the device edit page. -bug#0000665: Invalid index error on empty or 0 return set from rrdfetch with Nth Percentile. -bug#0000672: When creating a device, the Host Template was not properly validated. -bug#0000678: Allow graph export to a Cacti sub directory. -bug#0000681: Increase the size of the arg1, arg2, and arg3 fields in the poller_item table. -bug#0000692: Fix problems with FTP and the tree export method. -bug#0000693: Fix problems with the "Expand Host" option and the tree export method. -bug#0000698: Make arguments to 'df' more compatible with FreeBSD 6.0 in the "Get Unix Partitions" data query. -bug#0000705: Fix problem with the current selected data source item and SIMILAR_DATA_SOURCES_NODUPS (again). -bug#0000709: Fix problems with FTP and the tree export method (duplicate). -bug#0000720: Fix undefined variable message in script_server.php. -bug#0000721: SNMPv2 Query has issues with ifAlias & ifName when none present. -bug#0000727: Allow a user with specific graph permissions to be used when exporting graphs. -bug#0000730: Allow non-standard MySQL ports to be specified. -bug#0000731: Use proper defaults when adding a device to a tree from the Devices page. -bug#0000739: Stop ignoring the "Unit value" parameter in the graph template. -bug#0000741: Fix issue with links getting mismatched after using zoom on a graph. -bug#0000746: Make sure clearing Cacti log file from web interface preserves file permissions. -bug#0000752: Allow OID's greater than 255 characters except for the index OID because of MySQL index limitations. -bug#0000758: LDAP user with non-alphanumeric characters in the password failed to authenticate. -bug#0000761: Correct input validation to allow all possible numbers in the RRAs form. -bug#0000766: Increase the size of the id field in the graph tree items table. -bug#0000769: Use only selected RRA's when exporting graphs. -bug#0000775: Add pagination to the SNMP cache viewer to handle large numbers of items. -bug#0000779: Scale down the size of text when viewing thumbnail graphs. -bug#0000781: Add an "enabled" filter status item in the devices list. -bug#0000785: Fix issue with Graph Tree View and Data Query Index Sorting showing "Non Indexed" even if empty. -bug#0000786: Expose the SNMP port field to data sources that use SNMP. -bug#0000789: Remove use of "action" attribute on graph tree image which is incompatible with newer Opera browsers and HTML4. -bug#0000797: Fix issue with filtering on multiple fields on the Data Sources and Graph Management pages. -bug#0000809: Add an option to "purge" the user_log table. -bug#0000814: Prevent Apache from segfaulting if the database permissions are not correct. -bug#0000815: Paginated the Cacti log file viewer to handle large numbers of items. -bug#0000821: Add missing menuarrow.gif image. -bug#0000823: Prevent Cacti from overwriting data during the creation of a new data template. -bug: Do not allow the device filter on the graph items editor to clear the selected data source. -bug: SQL query incorrectly formatted causing SQL queries to fail in preview mode. -bug: Setting a host template filter in devices, followed by moving off and then back on the page generated an error. -bug: PHP 5.1 snmpwalks utilize the bulk method by default. Therefore, prefer them over the bulkwalk binary. -bug: Allow read_config_option to force a database refresh when one is wanted. -bug: Fix to resolve script server script not returning data as expected. -bug: Make load average script compatible with Mac OS X systems. -bug: Correct an issue where under certain circumstances, |query_ifSize| was being implemented as the maximum value for an RRD. -bug: Correct issue where DHTML caching was not working with expand hosts enabled. -bug: Add SNMP retries option to Cacti's SNMP functions. -bug: Once Graph Export has been enabled, do not allow Cacti to run even after it has been disabled. -bug: Correct alphabetic tree sorting to be more natural. -bug: Fix meta refresh tags to use proper URL syntax. -bug: Do not allow the graphs setting page to use the refresh interval, which can cause it to refresh while the user is inputting data. -bug: Make sure that data query index ordering with the "index_order" XML field is always respected. -bug: Limit the number of rows retrieved from the poller_output table to minimize the impact low memory system configurations. 0.8.6h -bug#0000383: Add more verbose RRDtool debug output from Graph Management. -bug#0000522: Take 'oid_index_parse' into consideration when handling 'OID/REGEXP:' data query fields. -bug#0000528: Allow template_import.php to return without error when XML file is invalid in PHP 4.4 and above. -bug#0000557: Changing filter value resulted in invalid page/row selection. -bug#0000572: Added $database_port to config.php. -bug#0000570: Grammar edit for text about already up-to-date. -bug#0000571: Misleading diagnostic error messages during install have been updated. -bug#0000582: Ampersand present in graph template graph name causes XML import to fail. -bug#0000585: Graphing fails using AREA/STACK/LINE/HRULE/VRULE without defined color. -bug#0000586: Remove static reference to RRA ID #1. -bug#0000596: Proper escape of ' in graph titles. -bug#0000599: Add filtering to graphs and data templates. -bug#0000601: Add ability to add multiple hosts to a tree. -bug#0000603: user_log.ip field not ipv6 compatible. -bug#0000608: Minor coding error in lib/poller.php with a erroneous pclose statement. -bug#0000615: Add sysContact and sysLocation output to device edit page. -bug#0000619: Host templates not alphabetized on device creation form. -bug#0000625: Cannot modify/create a user with a period in the username. -bug#0000631: Invalid information concerning delimiter for index_order in SNMP Query documentation. -bug#0000650: Clicking Cancel in Create Graphs for this Host does nothing. -bug#0000656: Perl scripts using back ticks is not portable. -bug: Stop MySQL connect messages from appearing in user interface. -bug: Allow primary keys other than "ID" to work in sql_save and in HTML code. -bug: Save statistics even when the poller times out. -bug: Only call poller_commands.php or poller_export.php if they require calling. -bug: Incorporate a timeout to ss_fping.php so that a host that takes to long to finish at least returns data. -bug: Correct the display of custom data under data input methods to follow the proper order. -bug: Change the default behavior of ping.php to mark a host as up if either SNMP or ping are successful. -bug: Don't allow graph_export to delete your web site. -bug: Correct issue where SNMP was not returning both hex and text data under certain circumstances. -bug: Prevent a never ending table lock in lib/tree.php. -bug: Correct issue where either AREA or LINEx without color were causing RRD_NL without any elements in rrdtool_graph. -bug: Allow hostname to include the TCP: prefix for TCP based snmp and keep tcp, icmp, udp ping functional -bug: Better error reporting for Clear Cacti Log File in Utilities -bug: Graphs with items having Legend text defined but no color will fail under RRDtool 1.2.x. -feature: Add MySQL 5.x support. -feature: Add IPv6 support to lib/ping.php. -feature: When utilizing cmd.php, do not run the script_server if it is not required for a process. -feature: Incorporate snmpbulkwalk binary path to user interface to speed snmpv2 and snmpv3 walk calls. -feature: Incorporate snmpgetnext binary path to user interface to make available for certain plugins. -feature; Add support for Nth percentile functions, not just 95th. -feature: Add support for new Nth percentile variables: aggregate, aggregate_max, aggregate_sum. -feature: Allow additional filtering for graph item adding while creating graphs. -feature: Add Command line script to copy users: copy_cacti_user.php. -feature: Add Command line script to reindex hosts: poller_reindex_hosts.php. -feature: Add Command line script to rebuild the poller cache: rebuild_poller_cache.php. 0.8.6g -bug#0000351: Fix zooming capability in Safari. -bug#0000491: Allow underscore, dash, and forward slash characters through search string validation. -bug#0000498: Fix issue where editing data input methods damaged portions of the database. -bug#0000502: Fix Syslog support in unix. -bug#0000506/#0000517: Properly handle special XML characters when importing/exporting templates. -bug#0000508: Fix issues where filter functionality would not work in preview mode. -bug#0000512: Increase script server buffer size for large output. -bug#0000520: Fix issue where LDAP authentication causes crash/abort. -bug#0000521: Add graph/data source title mouseover support. -bug#0000525: Make sure that all files in the Cacti distribution contain an EOF character. -bug#0000530: Remove 132 character limitation for OID's during polling. -bug#0000531: Make sure that quote characters in suggested value fields are properly escaped. -bug#0000535: Fix template export support for PHP 4.4. -bug#0000536: Fix printing of zoomed graphs where in IE where a white box would appear over the graph. -bug#0000537: Re-implement functional SNMPv3 support (authNoPriv only) -bug#0000543: Always allow non-templated graph/data template fields to be blank. -bug#0000544: See graph tree export contrib below. -bug#0000547: Fix issue with escaping certain control characters, causing the graph tree to break. -bug#0000552: Fix typo on the Settings page. -bug: Fix multiple output support in the script server. -bug: Fix incompatible binary SNMP calling parameter issue with NET-SNMP versions earlier than 5.1. -bug: Fix issues encountered when polling invalid data sources. -bug: Fix issue where if a host was deleted, re-indexing would continue to attempt to be performed on it. -bug: Allow lib/ping.php to be included in user script server scripts. -bug: Eliminate the need to run php-win.exe in Windows environment. Will now work with just php.exe. -feature: Add a great new graph export format "Tree Presentation", thanks to our friend from Toulouse France (forums user: jaybob). -feature: Allow data query |query_*| variables to be used within a CDEF string. -feature: Force export functions into a separate poller process. -feature: Force re-caching of data queries into a separate poller process. -feature: Added filter capability to graph list view mode. -feature: Enhanced ss_fping.php and ping.php to inclue ICMP, TCP and UDP ping functionality and to specify a port. 0.8.6f -security: Hardened PHP Project Advisory #042005 - Cacti Authentification/Addslashes Bypass Vulnerability -security: Hardened PHP Project Advisory #022005 - Cacti Multiple SQL Injection Vulnerabilities -security: Hardened PHP Project Advisory #032005 - Cacti Remote Command Execution Vulnerability 0.8.6e -bug#0000143: Allow the user to enter 'U' for unknown minimum and maximum data source input values. -bug#0000377: Fix logarithmic graph creation issues. -bug#0000392: Implement caching to reduce the number of SQL queries needed to render the graph tree. -bug#0000402/#0000457: Allow bounds to be set properly for logarithmic graph creation. -bug#0000428: Unable to try login again after Access Denied. -bug#0000450: Force strict checking for data query parsing to prevent numeric values from being incorrectly handled. -bug#0000453: SPAN tag between each character of GraphTitle in Graph Management. -bug#0000458: Generate and error message and exit poller.php if the cactid binary path is invalid. -bug#0000463: Fix Syslog logging of poller statistics. -bug#0000464: Remove dates from Syslog generated messages. -bug#0000465: Allow for the mass resize of graphs. -bug#0000471: Remove the graph 'Settings' tab if the user is not allowed to save graph settings. -bug#0000478: Validate field input values on the Data Templates page. Prevent duplicate data template items from appearing as a result of this bug. -bug#0000481: Add several checks to prevent PHP errors when parsing data query XML files. -bug: Graph zoom feature had incorrect bounding box when using RRD 1.2.x -bug: Speed the generation of the Tree View Dual Pane by caching the Tree to a local session variable. -bug: Handle STACK graph items properly in RRDtool 1.2. -bug: Prevent data query recaches if the device returns empty input. -bug: Fix potential issues with graph gaps when using a large number of poller processes. -bug: Fix issues when zooming with new RRDtool 1.2 title fonts with a point size other than 10 -bug: Fix issues when zooming outside of the select areas causing a broken graph -bug: Fix issues experienced when users attempted to create custom graphs and thousands of data sources exist -feature: Add ability to filter by host status as well as add ability to filter accross both description and hostname -feature: Add additional options to control RRDtool 1.2 fonts. -feature: Allow the user to Enable/Disable Data Sources from the user interface and automatically disable hosts when deleting a device. -feature: Add Data Source information to the Cacti Log File to assist with troubleshooting. -feature: Add html links to both hosts and data sources in the Cacti Log File. -security: Fix several remote inclusion bugs that were exploitable when PHP's 'register_global' feature is turned on [IDEF0941], [IDEF1023], [IDEF1024]. -security: Fix several SQL injection bugs due to improper input validation [IDEF1001]. 0.8.6d -bug#0000416: Speed up binary net-snmp calls by removing MIB lookup requirement. -bug#0000434/#0000403: Allow for periods in script return variable names. -bug#0000436: Made snmp.php more like version 0.9 code base. -bug#0000419: Fixed session initialization problems with some browsers. -bug#0000394: Fixed a web server crash when reordering items in a graph tree. -bug#0000390: Remove deep linking in Cacti. -bug#0000389: Implement directory security in Cacti. -bug#0000443: Add SNMP port/timeout to the Host MIB CPU/disk script queries. -bug: Corrected issues encountered when creating multiple graphs from a single graph template. -bug: Corrected a problem where no graphs are displayed in the graph tree when authentication is turned off. -bug: Allow RRDtool fetch command to retrieve negative numbers. -bug: Increased some field lengths for very long OID's. -bug: Removed references to non-existing code when attempting to make database connections. -bug: Give poller cache more time to process entries during a clear operation, give it more memory. -bug: Changed default value in Unix ping script to correct for template bug. -bug: Fixed page refresh issue. -bug: Fixed include ordering in config.php to accommodate MySQL bugs and logging. -bug: Changed SNMP ping OID to be sysUptime because it is more common. -bug: Increased PHP timeout to accommodate for long running recache events causing poller issues. -bug: LDAP Auth with no DN specified and blank username would allow login. -feature: Basic support for RRDtool 1.2 including specifying a default True Type Font. -feature: Added support for spike suppression within the cmd.php poller. -feature: Support php_snmp version 2 builtin functions. 0.8.6c -bug#0000354: User Name field always displays "admin" in Mozilla web browser. -bug#0000293: JavaScript selection bug on the "New Graphs" page. -bug#0000352: Problem with the current data source item when using the "Similar Data Sources" special data source. -bug#0000348: Scale problems with the "ucd/net - Memory Usage" graph template. -bug#0000358: Problems adding the same graph to more than one graph tree. -bug#0000355: Allow scientific and negative numbers to be returned from a script. -bug#0000347: Change Order of Graph Templates and Data Queries in Host. -bug#0000339: LDAP description misspell 'allow'. -bug: Maximum runtime issues with the script server. -bug: User could select a data query graph type from "Graph Templates", causing duplicate data source items. -bug: Auto-recache failed and caused the poller to crash under specific circumstances. -bug: Problems saving a user's graph settings from the user admin page. -bug: Poller cache not being updated properly for some host types upon change. -bug: Hope it's final this time: 95th percentile and bandwidth summation fixes. -bug: Added more verbose error handling with template XML importing. -bug: Sort host templates when creating a host. -bug: Corrected user form edit array problem that didn't show the graph options for an edited user. -bug: Access Denied error when user doesn't have console access. -bug: Return type bug in cacti_snmp_walk() which could cause extra blank data query rows. -feature: Data queries now support indexes that span multiple OIDs (see the manual). -feature: Re-apply suggested naming to graphs from the user interface. -feature: TreeView-specific feature to speed up rendering the tree for large databases. -feature: Added retry logic to the MySQL connect statements. -feature: Changed default connect method to a 'pconnect' from a 'connect' to improve performance with large implementations. -feature: Add support for Safari on the graph zoom page. 0.8.6b -bug#0000318: Only delete the Cacti system user when uninstalling the RPM package rather than during each upgrade. -bug: Problems with the 95th percentile and bandwidth summation graph variables. -bug: Problem with random gaps in some or all graphs caused by staggered RRDtool update times. 0.8.6a -bug#0000287: Non-host based scripts failing to populate the poller cache (0.8.6). -bug#0000285: Data query variables on graphs should reflect the data source of each individual graph item (0.8.6). -bug#0000289: Check the value of PHP's "magic_quotes_gpc" setting to prevent potential security holes (0.8.6). -bug#0000295: Problem with the DHTML tree when Cacti is included inside of a parent frame. -bug#0000311: Set PHP's "max_execution_time" to "0" during all upgrades. -bug#0000303: Correct the logic that checks if the export path directory exists or not. -bug#0000310: Problems viewing data templates with the "Data Input Method" set to "None". -bug#0000304: Problems displaying duplicate data templates on the main "Data Templates" screen. -bug#0000302: Update the Windows install documentation to mention the "PHPRC" environment variable. -bug#0000293: Problem with the JavaScript that grays out already created graphs on the "New Graphs" page. -bug#0000312: Make sure that the "host_graph" table is populated in the installer for users coming from a version less than 0.8.4. -bug#0000296: Remove references to PHP's ob_flush() function it doesn't exist until verion 4.2. -bug#0000314: Respect graph export timing settings. -bug: Problem saving a templated graph or data source that contained a checkbox field that had a value different from the default. -bug: Typo in graphs.php when placing graph(s) on a tree. -bug: Make sure that there is a user logged in before trying to read a per-user graph configuration value. -bug: Fix support for multiple cmd.php/cactid polling sessions in a single poller.php session. -bug: Revert back to older RRDtool update method as to correct several poller related issues with 0.8.6. -bug: Fix PHP-SNMP support in cmd.php. -bug: Fix multiple graph/data template corruption issues when converting from graphs or data sources. 0.8.6 -bug#0000051: HTTP header caching problems (0.8.5). -bug#0000121: It is no longer possible to add the same graph twice to a single graph tree branch. -bug#0000123: Several UI fixes on the tree item edit page (0.8.5). -bug#0000124: Select all check boxes would actually invert the selection. -bug#0000128: Graph template item corruption issues (0.8.5a). -bug#0000139: Graph tree deletion corruption issue (0.8.5a). -bug#0000140: Replaced the 'None' option in several host drop downs with 'Any' and redefined 'None' to mean host = 0 (0.8.5a). -bug#0000144: Possible corruption issues when deleting tree items from the root of the tree. -bug#0000149: Error using the 'total' type for 95th percentile or bandwidth summation. -bug#0000151: Added the ability to duplicate a host template. -bug#0000160: A change in Mozilla 1.5+ caused extra vertical space to appear on many table rows throughout the console. -bug#0000164: HostMIB scripts do not respect SNMP port and timeout parameters. -bug#0000173: Increase the number of characters dedicated to each tier from 2 to 3 which increases the item per tier/branch limit to 999. -bug#0000174: Broken thumbnail graphs that contained a 95th percentile HRULE item. -bug#0000175: Strip quotes from SNMP output to prevent UI escaping issues. -bug#0000176: Added the '-P' argument to 'df' to prevent multi-line output for the query_unix_partitions.pl script. -bug#0000179: Updated ADODB to version 4.23 which enabled Cacti work with PHP 5. -bug#0000198: Strip greater and less than characters from SNMP output to prevent UI escaping issues. -bug#0000214: Rename 'Utilities' to 'System Utilities' and move it under the 'Utilities' menu heading. -bug#0000235: Limit the number of pages displayed for graph management, data sources, and devices. -bug#0000244: Prevent PHP errors from being displayed during summation/95th percentile calculation when the .rrd file does not exist. -bug#0000253: Fixed recursive CDEFs. -bug#0000254: CDEF dropdown list in adding another CDEF is not sorted. -bug#0000265: Removed "CANNOT FIND GUEST USER" error message. -bug#0000273: Fixed 'rrdtool fetch' parsing for RRDtool 1.0.9. -bug: A hash was not being generated for duplicated graph and data templates which would cause import/export for those templates to fail. -bug: A user's graph permissions may fail to delete properly after removing that user. -bug: The "Export Every x Times" feature did not work correctly. -bug: Work correctly with PHP's get_magic_quotes_gpc() turned off. -bug: Eliminated potential password injection attack in auth_login.php. -bug: Eliminated popen issues in cactid win32 with threads > 1. -feature/bug#0000118: Data source screen UI enhancements (0.8.5). -feature/bug#0000120: Deleting a tree header should delete all child items (0.8.4). -feature/bug#0000125: A forced sort type can be specified for data query indexes which will be used to sort data query results in the UI. -feature/bug#0000152: Added filter/search/pagination capabilities to the Devices page. -feature/bug#0000155: Allow hosts on the graph tree to be grouped by data query index (ie. switch port, partition, etc) instead of only graph template. -feature/bug#0000156: Added the ability to sort a graph tree branch alphabetically or numerically. -feature/bug#0000161: Removing a graph now gives the user the option to remove all associated data sources. -feature/bug#0000172: Added the ability to control which graph viewing areas should display thumbnail graphs and which ones should display full sized graphs. -feature/bug#0000185: Deleting a device gives the user the option of deleting all associated graphs and data sources. -feature/bug#0000187: Add host availability and device enabled/disable controls to the main devices page. -feature/bug#0000189: Add a system-wide defaults for SNMP community, version, port, timeout and retries configurable under 'Cacti Settings'. -feature/bug#0000192: Add the ability to log poller runtime statistics to the log. -feature/bug#0000194: Add host availability capability which allows Cacti to track of downed devices as well as a device's uptime history. -feature/bug#0000200: Implement three different auto re-index methods which allow Cacti to automatically 'refresh' a data query when an indexes changes. -feature/bug#0000213: Add a 'Clear' button to all filter forms which resets the form to its default state. -feature/bug#0000240: Add moonman's SIMILAR_DATA_SOURCES_NODUPS CDEF patch. -feature/bug#0000250: Allow host/graph tree items to change parents. -feature: Data query index types are now automatically selected which eliminates the need to prompt the user for this information at graph creation time. -feature: Better message handling on the "New Graphs" page. -feature: Get rid of the "Data Input Method" box from the data query edit screen as this data can be automatically derived. -feature: Customizable log levels. -feature: Ability to log to syslog (Unix) and event log (Windows) in addition to the log file. -feature: UDP/ICMP/SNMP ping support used to determine a host's availability status. -feature: A PHP script server which enables PHP script to be interpreted by the poller without spawning a separate PHP process for each item. See the manual for more details. -feature: Ability to choose the type of poller (cmd.php, cactid) and number of threads (cactid only) from the UI. -feature: Ability to spawn multiple simultaneous cmd.php/cactid processes to speed up the polling process. -feature: Allow data templates and data sources that use SNMP to override host fields (hostname, snmp port, etc) in the poller cache. -feature: Added Eric Steffen's Bonsai patch which enables users to zoom a graph by dragging a box around the area of interest. -feature: Added branix's graph export enhancements patch which adds many more graph export configuration options including remote FTP support. -feature: Ability to view/clear the log file from the console. -feature: Use a single RRDtool stdin pipe for all update, create, and graph export actions. -feature: Advanced timespan selector which provides a large number of presets and a calendar control for custom timespans. -feature: Better support for SNMP v2 from UI. Speed up some UI queries. -feature: Enable/Disable Poller from UI. -feature: Added ifOperStatus to Graph Creation page to show either Up or Down. -feature: Rearchitected poller subsystem to prepare for multiple poller architecture in future releases. -feature: Added validation logic in the pollers to prevent system and log anomalies. -feature: Removed SNMP v3 options until SNMP v3 is supported. 0.8.5a -bug#84: Updated internal CDEF caching to take CFs into account. -bug#86: Updated the LDAP code to correctly copy template users. -bug#136: Inaccurate total bandwidth readings for RRAs with a step > 1. -bug#138: Typo on install/index.php -bug#141: Incorrect pre-requisite file check when doing a graph export. -bug#142: Added the '-t' option when calling ucd-snmp or net-snmp to support numeric timeticks. -bug#145: phpMyAdmin was choking on the import of cacti.sql. -bug#146: Minor HTML fix in lib/form.php -bug: Fixed potential graph item input corruption when saving a graph template item. -bug: Fixed problem saving a data source using a template that had more than one item. -bug: Correctly display the console menu when authentication has been turned off. -bug: Correctly display the two pane tree when authentication has been turned off. -bug: Support regular expression characters in passwords: \+*?[^]$(){}=!<>|: -bug: Fixed certain re-ordering problems when deleting branches from a graph tree. -bug: Add support for a 3 digit exponents in RRDtool fetch output on Windows. -bug: Correctly escape community strings with a quotation mark under Windows. -bug: 95th percentile and bandwidth summation code should result in less errors when things don't go as planned. -bug: Fix 'data_input_data_fcache' orphan when deleting a data source. -feature: Make the 'None' option on the graph management and data sources host filter dropdowns only display items with no host assigned. Add an 'Any' option to display items assigned to all hosts. -cactid: Fix segfault problems on all platforms when performing SNMP queries. -cactid: Fix deadlock issues on Windows and Solaris when making popen calls. 0.8.5 -bug#102: Fix problem with SNMP community strings that contain certain variable shell characters. -bug#103: Under "New Graphs", make sure to highlight the host template line when the right-hand checkbox is selected. -bug#104: Typo in the usage for the query_unix_partitions.pl script. -bug#105: On the data query edit page, only display compatible items in the "Data Input Method" dropdown. -bug#106: Render the main menu based on a user's permissions so graph-only users cannot see a list of menu options when attempting to view 'index.php'. -bug#109: Replaced all instances of 'ifDesc' with the correct 'ifDescr' when dealing with the IF MIB. -bug#110: Be smarter about redirecting the user to the correct page when the user's login option is set to "Show the page that user pointed their browser to". -bug#111: Take host permissions into account when rendering the left-hand pane in tree view. -bug#112: Every 10th tree item was not being displayed. -bug#115: Fixed a bunch of misspellings of the word 'substitute' throughout the code. -bug#116: Restructured the edit screens for CDEF items and tree items, making them less confusing to users. -bug#119: Added a "Search:" label to the filter textboxes on the "Graph Management" and "Data Sources" pages. -bug#127: Added an HTML "title" tag to the three graph mode images. -bug#129: Added support for correctly parsing timeticks in both cmd.php and cactid. -bug#130: Users are sometimes redirected to the incorrect host when selecting the "Create Graphs for this Host" link under "Polling Hosts". -bug#131: Load averages above '10' were not being returned correctly from the loadavg_multi.pl script. -bug#133: Non-SNMP data sources were not being removed from the poller cache when a host became 'disabled'. -bug#134: Make sure to delete associated 'host' tree items when deleting a host. -bug#135: Fix the navigation display so it doesn't display errors when directly linking to a graph. -bug#137: Remove the 'td.shadow' CSS class as it isn't being used and contains an incorrect image reference. -bug: Allow the user to enter a "Unit Exponent Value" of '0'. -bug: Remove all references to $_SERVER["HTTP_REFERER"] for web servers that do not include this variable. -bug: Extend the "Maximum JavaScript Rows" feature to work for host templates as well. -bug: Fixed a few parsing problems that were causing problems for users including a '\' or '/' in their script's input string. -bug: The correct representation of memory usage using net-snmp should be 'free memory + cache memory + buffered memory'. -bug: Fixed a problem importing CDEF items correctly from an XML file. -bug: Deleting a GPRINT preset now correctly displays the name of the item about to be removed. -bug: Problems importing XML that contained a host template with more than one associated graph template. -bug: Added a potential workaround for the PHP session/popen bug which occurs on Windows systems using PHP in ISAPI mode. -feature: Data query variables such as |query_ifAlias| can now be included on the actual graph in the "Text Format" or "Value" field. -feature: Added two new special data sources to CDEFs, which enable users to use the data source's maximum or minimum value in a CDEF. -feature: Added a new SNMP query source type, "VALUE/REGEXP", which enables users to parse the SNMP value with a regular expression before passing it onto Cacti. -feature: Hide the "Console" tab from users that only have rights to view graphs. -feature: Added a new 95th percentile type, "max", which calculates 95th percentile based on the maximum of either inbound or outbound for each sample. This is how most co-location facilities calculate 95th percentile for billing purposes. -feature: Update ADODB to version 4.05. -feature: Data source graph inputs are automatically added and maintained by Cacti for new graph templates as to reduce user confusion. -feature: The "Graph Management" and "Data Sources" edit pages are much improved when using a template. -feature: Renamed "Polling Hosts" to "Devices" since polling hosts technically implies that you are managing the hosts that poll data, which could be reserved for later use. -feature: If you enter a value for a "host field" in the data template, Cacti will use that value rather than always defaulting to the host. If you leave it blank, Cacti will use the value from the host. -feature: Data input method type codes 'snmp_timeout' and 'snmp_port' are now supported. -feature: Users will only see tabs for the graph viewing modes that they have access to. -doc: Completely re-written manual in SGML/Docbook so HTML, PDF, and ASCII versions of the manual are now possible. The new manual also includes a better introduction to Cacti for new users and makes use of screen shots to illustrate various portions of the user interface. -cactid: Fixed segfault problems using cactid on Solaris platforms. 0.8.4 -bug#87: Deleting top level branches without children on the tree caused ordering problems. -bug#88: Possibly popen/pclose concurrency problem with cactid. -bug#89: Missing "check all" checkbox on polling hosts page when an empty column was drawn. -bug#91: Fix undefined index errors on data source checkbox popups. -bug#92: Fix undefined index errors on graph management checkbox popups. -bug#96: Problems creating graphs from data queries where there was only row row total in the query result. -bug#97: Typo in cmd.php -bug#98: Creating a data source or graph with no host or template, would result in an extra empty item. -bug#99: Deleting a graph or data template that was still attached to one or more items would cause the graph/data source to appear to still have the deleted template still attached. -bug: Removed size limits on Linux memory data template. -bug: Undefined variable errors when creating new graphs/data sources without a template. -bug: multiple problems that caused the Windows disk space and CPU graphs to stop working. -bug: Broken images for bandwidth summation graphs that were less than a day old. -bug: Graph order changes on the tree would affect other graph trees. -bug: Problem with the "Host MIB - Hard Drive Space" data template that broke Windows disk spaces graphs. -bug: Fixed the LDAP authentication code, which was partially broken in 0.8.3. -bug: Fixed a cmd.php parsing problem when input and output fields are sharing the same name. -bug: Added basename() to all PHP_SELF references to make sure all hrefs stay absolute. -bug: The RRA field is now honored for the dual pane tree view. -bug: The |date_time| graph variable now displays the current day of the month. -feature: The "Total All Items" CDEF is now able to total NaN's without becoming 'U'. -feature: Data query results are now grayed out if they have already been created. -feature: The "cacti Web Root" and "Web Server Document Root" settings are completely auto-detected now. -feature: Add SNMP port and SNMP timeout fields to each host. -feature: Removed the "Management IP" field in polling hosts in favor of "Hostname". -feature: Re-organized the menus expand/contract for less used items to help save vertical space. -feature: Added complete template to XML import and export support. -feature: Moved the graph creation features of "Polling Hosts" to a new menu item,"New Graphs". -feature: Added verbose debugging support for data queries. -doc: Added a FAQ. -cactid: Removed lots of potential buffer overflows. -cactid: Several libz/openssl autoconf fixes that improve FreeBSD 5.x support. -cactid: Fixed some potential segfaults on FreeBSD when reading information from the targets table. -cactid: The snmp_get() function now respects the SNMP version chosen under "Polling Hosts", so 64-bit counters should work. 0.8.3a -bug#81: Partial/complete poller cache rebuild failure after an upgrade. -bug#82: Undefined variable error messages under win32/IIS. -bug: Problems with overlapping graph permissions with multiple users. 0.8.3 -bug#50: When viewing a graph, only display it for the RRAs used on the graph. -bug#66: Users can see a list of all hosts in graph preview mode. -bug#71: Extra escape characters in the |date_time| variable output. -bug#72: Disk space graph for ucd/net was broken for original 0.8 users. -bug#75: Problems monitoring more than one CPU with query_host_cpu.php. -bug#76: Cactid segfault on Solaris caused by unchecked use of NULL with sprintf. -bug#77: Cactid segfault upon a MySQL connect error. -bug#79: Check for unique/valid data when the user selects a field to index their new data sources off of. -bug: Redirect user to the correct page after a forced password change. -bug: Problems entering negative numbers for upper/lower limit fields on graph pages. -bug: Never try to use internal SNMP support if SNMP version 2 or 3 is selected. -bug: Adding or removing data source items in a data template should update attached data sources as well. -bug: Problems updating certain fields when switching or turning off both graph and data templates. -bug: Got rid of the "Use Per-Data Source Value" checkbox where it isn't usable. -bug: Strange sequence/ordering behavior after updating an already created tree item. -bug: Error message displayed instead of 'Access Denied' message. -feature: Added host and graph template permissions for graph viewing users. -feature: Added a new 'dual pane' tree view type that draws the graph trees on a DHTML tree on the left side of the page. -feature: Added the ability to add hosts to a tree. -feature: Added a 'timespan' field to "Round Robin Archives" to determine the timespan (in seconds) of graphs using each RRA. -feature: Completely replaced the header images/layout for both the console and graph viewing pages -feature: Added a navigation bar in the header so you can keep track of you location in the UI. -feature: Added bandwidth summation support. See the manual for more information. -feature: Made the installer more verbose about SQL it runs during an upgrade. -cactid: Changed threading strategy to spawn threads based on hosts. -cactid: Created header files for each source file and moved precasts out of cactid.h. -cactid: A bunch of autoconf updates. 0.8.2a -bug: Fixed various problems updating the poller cache. -bug: Fixed the Weatherbug script to work under Redhat 9. -cactid: Updated poller to use detached threads based on each host. 0.8.2 -bug#47: The 'cacti_server_os' variable is now auto-detected. -bug#56: Possible endless loop for non 0.8 users in version upgrade loop. -bug#57: Cacti does not take the 'graph_tree_id' column into account when re-ordering trees which can cause unexpected results. -bug#59: Regular expression bug that caused 'query_unix_partitions.pl' not to function on FreeBSD. -bug#60: Incorrect index OID in the (currently unused) 'host_disk.xml' SNMP query. -bug#61: Problems adding additional graph items to an input after the template is in use by graphs. -bug#64: Cactid now checks for the RRDtool path in the 'settings' table.\ -bug#67: Problems with wrapping and 'diskfree.pl'. -bug: Problems deleting GPRINT presets. -bug: Undefined variable errors on the graph settings page if built in user authentication was turned off. -bug: Kill cached field value when messages are displayed. -bug: Graph trees now honor the RRA selected when creating the tree (andyfud.org.nz) -bug: Graph and data source titles are now properly updated when making changes to graph or data templates. -bug: Unexpected results when trying to delete top level branches from a graph tree. -bug: Problems expanding/contracting trees when two or more nested branches had the hidden flag set. -feature: Added ability to turn off checks for an entire host. -feature: Added SNMP and operating system variable printout to the about page. -feature: Added 95th percentile support. See the manual for more information. -feature: Added setting for data query maximum field length. -cactid: Added downed host detection. -cactid: Code cleanup: formatting, compiler warnings, and removal of unused functions. -cactid: Daemon support has been removed from cactid for the time being, it must be run out of CRON. -cactid: Have autoconf detect net-snmp before trying ucd-snmp to prevent failure on default Redhat installs. 0.8.1 -bug#40: Fixed OIDs in serveral Netware data templates. -bug#41: Data source and graph names are lost when created from a template. -bug#44: Fixed Host MIB logged in users OID in data template. -bug#46: Fixed an RRDtool/PHP binary variable mixup on the install page for win32 users. -bug#48: Changed the "Create" button on the settings page to "Save". -bug#52: Make sure the data source/graph names are pulled down after clicking "Create", so the user can press cancel. -bug: Changed references from $_SERVER["SCRIPT_NAME"] to $_SERVER["PHP_SELF"] because of strange behavior on PHP 4.3.2 under Windows. -bug: Make sure to filter on the "cached title" for on both the data sources and graph management pages. -bug: Fixed error when debug mode was on and the user tried to add a new graph or data source. -bug: Take tree permissions into account when displaying the "Default Tree" dropdown on the graph settings page. -bug: Incorrect graph title was displayed on graph tree delete confirmation. -bug: Win32: Graphs were being exported even when the graph export path was left blank. -bug: Exported graphs were displayed in the incorrect order. -bug: Legends were not displayed on exported graphs. -bug: HRULE items caused graphs to break. -feature: You can now use negative VRULE items, such as '-12:00' to display a line 12 hours ago. -bug: Data queries that had a non-integer index would not render graph/data source titles properly. -auth: LDAP authentication updates 0.8 -feature: Added support for graph, data source, and host templates. -feature: Added a stricter concept of hosts which enables better organization and easier graph creation. -feature: Created data queries which enable the retrieval of indexable data in the form of a query. -feature: Revised the entire UI creating more functional and attractive forms. -feature: New generic poller interface enables other pollers to handle the data gathering for Cacti. -feature: Added support for net-snmp 5.x. -docs: Revised the install documentation and re-wrote the manual for this version. -feature: The beginnings of a threaded c-based poller (cactid), which is not completely function at this point. -feature: And much much more... 0.6.8a -bug: Unchecked string being passed to rrdtool caused a potential security problem. -bug: The logout funtionality was broken for some users because of a missing fourth argument. -bug: Fixed some SNMP parsing problems. -bug: Fixed a problem with using quotes for data source input. 0.6.8 -feature: Added the following new rrdtool graph options: --units-exponent value, --unit, and --logarithmic. -feature: Added the ability to show exact numbers in GPRINT, users can now specify a custom GPRINT string on a per-graph item basis. -bug: Any data input source with more than one output would be added as a multi-data source .rrd file. -bug: Some data source file name issues. -bug: Cacti now checks to see if a host exists when adding it to be graphed. -feature: There is now an optional "remove verification" for most of cacti's dialogs. -feature: There is a "logout" button when viewing graphs (not for the guest user). -docs: Updated the Win32 docs (thanks Larry). -bug: Fixed some rare HTML "multipart/form" bugs with PHP. -feature: Added a "Default View Mode" for each user when viewing graphs. -bug: Fixed some bugs where you would change a parent graph item to a child or a child graph item to a parent when graph grouping was turned on. -bug: Fixed some potential security bugs by eliminating cacti's use of cookies. 0.6.7 -feature: Added a "none" option for a data source when creating a CDEF. This can be used if you check the "Use the current data source being used on the graph instead of a preset one" box. -feature: Each user has a default graph policy: ALLOW or DENY for their graph permissions. -bug: Unique .rrd filename/data source name issues for SNMP "Make Graph" have been fixed. -feature: Changing the data source for a graph group parent will change the data sources for each of the child items. -bug: Logging has been fixed so errors do not show up in the Apache error_log any more. -bug: VRULE's work correctly now. Enter a time in the "value" field to use them, such as "00:00" or "14:00". -feature: If you select a graph to be added to the graph hierarchy, the "This Item is a Graph" checkbox is automatically selected. -docs: Install docs have been updated for Unix/Win32, documentation on upgrading cacti has been added. See the 'docs/' directory for more information. -bug: SNMP can function on win32/unix without snmpwalk/snmpget binaries. This will only work if you have php-snmp support compiled into both your php binary and web server modules. This is already the case for win32. -bug: A bug when more than one data source was created using the same data input source with multiple outputs has been fixed. -feature: The default install/upgrade screen has been revised. 0.6.6 -feature: Multiple data sources per .rrd is supported. To use this feature, simply create a data input source with multiple outputs that 'Update RRA'. -feature: Graph item grouping, which enables you to delete/reorder groups of similair graph items. -feature: Graph preview and output preview in the console, which allows you to preview what a graph will look like/what rrdtool's output is. -feature: Graph-based permissions have added, you can also show/hide certain hierarchies per user. -feature: Multiple data source per .rrd file support, read the docs for more information. -feature: You can now export graphs to static png's/html's every n times. -feature: By default, SNMP data source names come from _, instead of just which is more unique. -feature: More options for users such as where to go when the user logs in and whether the user can have their own settings or not. 0.6.5 -bug: Fixed some of the data source naming issues. You can now use any data source name you want; cacti will take care of making the name "rrdtool friendly". -feature: Cacti will use PHP's builtin SNMP support if detected, SNMP is overall faster now too. NOTE: PHP's SNMP support may not work with all of your MIB names, you may have to use the OID instead! -feature: Basic high speed counter support has been added, use 'hcin'/'hcout' to use it. Also may not work with PHP's builtin SNMP support yet. -bug: Using the MAX consolidation function with graph data works better now. You can make graphs that look like the MRTG ones (5 minute maximum). This code still needs a little work though. 0.6.4 -bug: You can now add the same CDEF to multiple data sources in the same graph. -feature: Ability to "sync" changes with the .rrd file with rrdtool's TUNE function. Cacti also tries to fill in internal data source path and name information to keep graphs from "breaking" when possible. -settings: You can now change the PHP Binary path from within cacti. -feature: Cacti can now export static images/html files when it gathers data like MRTG did. -feature: Multiple graph hierarchies are supported. -feature: You can now "zoom in" on any portion of the graph hierarchy by clicking on a header item. -bug: Some changes were made to make cacti more win32 complaint; a tutorial on how to setup cacti on win32 can be found on the raXnet page. -feature: You can now create all graphs for an SNMP host with one click. -feature: You can customize the graph title when creating graphs using the 'Make Graph' or 'Make All Graphs' link. -feature: Data sources in cacti are no longer limited to 19 characters. If you create a data source name that rrdtool will not like, cacti will automatically modify the name and save it internally for rrdtool-only use. 0.6.3 -feature: Put limits (HTML 'maxlength') on fields that have a maximum length. -feature: Added 'cacti Settings' and 'User Administration' to the cacti menu. -feature: Added a 'Step' field for Data Sources to graph data at non-300 second intervals. -feature: Added a '--rigid' on/off option, plus the ability to choose between '--alt-autoscale' and '--alt-autoscale-max' when using auto scale. -feature: Added a 'Base Value' field to the graphs to adjust how the vertical axis is displayed. -feature: Updated the menu/header graphics for a smoother look and easier navigation. -feature: cacti now stores its settings in the database instead of config.php, so they can be manipulated under 'cacti Settings'. Database credentials are still located in config.php however. -feature: Added a preview of the rrdtool source when creating data sources. -feature: Added a "data source duplicate" function and moved "graph duplicate" to "Graphs" on the cacti menu. -settings: You can now turn on/off cacti's builtin authentication. -settings: You can control what is logged (create, graph, snmp, update). -feature: Added a "Total All Data Sources" CDEF, which can be used to represent the total of all of the data on a graph. -bug: Fixed a few add/edit/delete form-related bugs. -docs: Added some more content to the documentation and made it more visible from within cacti. 0.6.2 -bug: Fixed some bugs when creating CDEF's using multiple data sources. -bug: Fixed more SNMP parsing bugs with some versions of net-snmp. -feature: added an "auto-refresh" feature to the graphs (thanks Nossie). -bug: HRULE's and VRULE's acually work now. -docs: the beginnings of some real documentation. -bug: you can select the color black now. 0.6.1 -bug: Fixed a parsing bug with snmp, more parsing is done in cacti's code and not via arguments passed to snmpget. -auth: Updated the function used to hash passwords (more compatible with older MySQL versions), more strict on document caching. -feature: Easier installation: cacti now checks for common problems and gives suggestions. Database updates are also done at this time. -bug: Fixed a problem with adding new data input sources. -bug: Problem saving the wrong numbers for 'Round Robin Archives'. -feature: Ability to preview the output of the cron script from a web browser under 'Cron Printout'. -feature: Added 'Logout User' to the menu. -bug: Removed some occurances of /var/www/html and replaced them with more dynamic variables. 0.6 -new tree code -some html table issues in graph view mode -fixed the settings code for saved graph-view data 0.5 -initial release ----------------------------------------------- Copyright (c) 2004-2023 - The Cacti Group, Inc. cacti-release-1.2.26/LICENSE000066400000000000000000000355031454067461500153320ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. cacti-release-1.2.26/README.md000066400000000000000000000261161454067461500156040ustar00rootroot00000000000000# Cacti â„¢ [![Cacti Commit Audit](https://github.com/Cacti/cacti/actions/workflows/syntax.yml/badge.svg)](https://github.com/Cacti/cacti/actions/workflows/syntax.yml) [![Project Status](http://opensource.box.com/badges/active.svg)](http://opensource.box.com/badges) [![Translation Status](https://translate.cacti.net/widgets/cacti/-/core/svg-badge.svg)](https://translate.cacti.net "Translation Status") [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/cacti/cacti.svg)](http://isitmaintained.com/project/cacti/cacti "Average time to resolve an issue") [![Percentage of open issues](http://isitmaintained.com/badge/open/cacti/cacti.svg)](http://isitmaintained.com/project/cacti/cacti "Percentage of issues still open") ----------------------------------------------------------------------------- ## Running Cacti from the `develop` Branch ### IMPORTANT When using source or by downloading the code directly from the repository, it is important to run the database upgrade script if you experience any errors referring to missing tables or columns in the database. Changes to the database are committed to the `cacti.sql` file which is used for new installations and committed to the installer database upgrade for existing installations. Because the version number does not change until release in the `develop` branch, which will result in the database upgrade not running, it is important to either use the database upgrade script to force the current version or update the version in the database. #### Upgrading from Pre-Cacti 1.x Releases When Cacti was first developed nearly 20 years ago, MySQL was not as mature as it is now. When The Cacti Group went about engineering Cacti 1.x, a decision was made to force users to use the InnoDB storage engine for many of the Tables. This was done as the InnoDB storage engine provides a better user experience when your web site has several concurrent logins. Though a little slower, it also provides greater resiliency for the developers. With that said, there are several changes that you MUST perform to MySQL/MariaDB before you upgrade, and a service restart is required. Depending on your release of MariaDB or MySQL, the following settings will either be required, or already enabled as default: ``` [mysqld] # required for multiple language support character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci # Memory tunables - Cacti provides recommendations at upgrade time max_heap_table_size = XXX max_allowed_packet = 500M tmp_table_size = XXX join_buffer_size = XXX sort_buffer_size = XXX # important for compatibility sql_mode=NO_ENGINE_SUBSTITUTION # innodb settings - Cacti provides recommendations at upgrade time innodb_buffer_pool_instances = XXX innodb_flush_log_at_trx_commit = 2 innodb_buffer_pool_size = XXX innodb_sort_buffer_size = XXX innodb_doublewrite = ON # required innodb_file_per_table = ON innodb_file_format = Barracuda innodb_large_prefix = 1 # not all version support innodb_flush_log_at_timeout = 3 # for SSD's/NVMe innodb_read_io_threads = 32 innodb_write_io_threads = 16 innodb_io_capacity = 10000 innodb_io_capacity_max = 20000 innodb_flush_method = O_DIRECT ``` The *required* settings are very important. Otherwise, you will encounter issues upgrading. The settings with XXX, Cacti will provide a recommendation at upgrade time. It is not out of the ordinary to have to restart MySQL/MariaDB during the upgrade to tune these settings. Please make special note of this before you begin your upgrade. Before you upgrade, you should make these required changes, then restart MySQL/MariaDB. After that, you can save yourself some time and potential errors by running the following scripts (assuming you are using bash): ``` for table in `mysql -e "SELECT TABLE_NAME FROM information_schema.TABLES WHERE table_schema='cacti' AND engine!='MEMORY'" cacti | grep -v TABLE_NAME`; do echo "Converting $table"; mysql -e "ALTER TABLE $table ENGINE=InnoDB ROW_FORMAT=Dynamic CHARSET=utf8mb4" cacti; done ``` This will convert any tables that are either InnoDB or MyISAM to Barracuda file format, dynamic row format and utf8mb4. Note, that if you have been using MySQL or MariaDB without innodb_file_per_table set to on, you might be better in backing up your database, resetting InnoDB by removing your ib* files in the /var/lib/mysql directory, and after which restoring your database and MySQL/MariaDB tables and permissions. Before you take such a step, you should always practice on a test server until you feel comfortable with the change. Good luck, and enjoy Cacti! #### Running Database Upgrade Script ``` sudo -u cacti php -q cli/upgrade_database.php --forcever=`cat include/cacti_version` ``` #### Updating Cacti Version in Database ``` update version set cacti = '1.1.38'; ``` ***Note:*** Change the above version to the correct version or risk the installer upgrading from a previous version. ----------------------------------------------------------------------------- ## About Cacti is a complete network graphing solution designed to harness the power of RRDtool's data storage and graphing functionality providing the following features: - Remote and local data collectors - Device discovery - Automation of device and graph creation - Graph and device templating - Custom data collection methods - User, group and domain access controls All of this is wrapped in an intuitive, easy to use interface that makes sense for both LAN-sized installations and complex networks with thousands of devices. Developed in the early 2000s by Ian Berry as a high school project, it has been used by thousands of companies and enthusiasts to monitor and manage their Enterprise Networks and Data Centers. ## Requirements Cacti should be able to run on any Linux, UNIX, or Windows based operating system with the following requirements: - PHP 5.4+ - MySQL 5.1+ - RRDtool 1.3+, 1.5+ recommended - NET-SNMP 5.5+ - Web Server with PHP support PHP Must also be compiled as a standalone cgi or cli binary. This is required for data gathering via cron. ### php-snmp We mark the php-snmp module as optional. So long as you are not using ipv6 devices, or using snmpv3 engine IDs or contexts, then using php-snmp should be safe. Otherwise, you should consider uninstalling the php-snmp module as it will create problems. We are aware of the problem with php-snmp and looking to get involved in the php project to resolve these issues. ### RRDtool RRDtool is available in multiple versions and a majority of them are supported by Cacti. Please remember to confirm your Cacti settings for the RRDtool version if you having problem rendering graphs. ## Documentation Documentation is available with the Cacti releases and also available for viewing on the [Documentation Repository](https://github.com/Cacti/documentation/blob/develop/README.md). ## Contribute Check out the main [Cacti](http://www.cacti.net) web site for downloads, change logs, release notes and more! ### Community forums Given the large scope of Cacti, the forums tend to generate a respectable amount of traffic. Doing your part in answering basic questions goes a long way since we cannot be everywhere at once. Contribute to the Cacti community by participating on the [Cacti Community Forums](http://forums.cacti.net). ### GitHub Documentation Get involved in creating and editing Cacti Documentation! Fork, change and submit a pull request to help improve the documentation on [GitHub](https://github.com/cacti/documentation). ### GitHub Development Get involved in development of Cacti! Join the developers and community on [GitHub](https://github.com/cacti)! ----------------------------------------------------------------------------- ## Functionality ### Data Sources Cacti handles the gathering of data through the concept of data sources. Data sources utilize input methods to gather data from devices, hosts, databases, scripts, etc... The possibilities are endless as to the nature of the data you are able to collect. Data sources are the direct link to the underlying RRD files; how data is stored within RRD files and how data is retrieved from RRD files. ### Graphs Graphs, the heart and soul of Cacti, are created by RRDtool using the defined data sources definition. ### Templating Bringing it all together, Cacti uses and extensive template system that allows for the creation and consumption of portable templates. Graph, data source, and RRA templates allow for the easy creation of graphs and data sources out of the box. Along with the Cacti community support, templates have become the standard way to support graphing any number of devices in use in today computing and networking environments. ### Data Collection (The Poller) Local and remote data collection support with the ability to set collection intervals. Check out ***Data Source Profile*** with in Cacti for more information. Data Source Profiles can be applied to graphs at creation time or at the data template level. Remote data collection has been made easy through replication of resources to remote data collectors. Even when connectivity to the main Cacti installation is lost from remote data collector, it will store collected data until connectivity is restored. Remote data collection only requires MySQL and HTTP/HTTPS access back to the main Cacti installation location. ### Network Discovery and Automation Cacti provides administrators a series of network automation functionality in order to reduce the time and effort it takes to setup and manage devices. - Multiple definable network discovery rules - Automation templates that specify how devices are configured ### Plugin Framework Cacti is more than a network monitoring system, it is an operations framework that allows the extension and augmentation of Cacti functionality. The Cacti Group continues to maintain an assortment of plugins. If you are looking to add features to Cacti, there is quite a bit of reference material to choose from on GitHub. ### Dynamic Graph Viewing Experience Cacti allows for many runtime augmentations while viewing graphs: - Dynamically loaded tree and graph view - Searching by string, graph and template types - Viewing augmentation - Simple time span adjustments - Convenient sliding time window buttons - Single click realtime graph option - Easy graph export to csv - RRA view with just a click ### User, Groups and Permissions Support for per user and per group permissions at a per realm (area of Cacti), per graph, per graph tree, per device, etc... The permission model in Cacti is role based access control (RBAC) to allow for flexible assignment of permissions. Support for enforcement of password complexity, password age and changing of expired passwords. ## RRDtool Graph Options Cacti supports most RRDtool graphing abilities including: ### Graph Options - Full right axis - Shift - Dash and dash offset - Alt y-grid - No grid fit - Units length - Tab width - Dynamic labels - Rules legend - Legend position ### Graph Items - VDEFs - Stacked lines - User definable line widths - Text alignment ----------------------------------------------------------------------------- Copyright (c) 2004-2023 - The Cacti Group, Inc. cacti-release-1.2.26/about.php000066400000000000000000000130451454067461500161450ustar00rootroot00000000000000
raXnet

', ''); ?>

  • Larry Adams (TheWitness)
  • Mark Brugnoli-Vinten (netniV)
  • Jimmy Conner (cigamit)
  • Petr Macek (xmacan)
  • Andreas Braun (browniebraun)
  • Thomas Urban (phalek)
  • Jing Chen (ddb4github)

  • Sean Mancini (bmfmancini)
  • J.P. Pasnak, CD (Linegod)
  • Chris Bell (Windows) (BSOD2600)
  • Paul Gevers (Debian) (paulgevers)
  • Morten Stevens (Fedora) (mortenstevens)

  • Ian Berry (raX)
  • Reinhard Scheck (gandalf)
  • Tony Roman (rony)
  • Andy Blyler (ablyler)



__('Delete'), 5 => __('Convert to Normal Graph'), 4 => __('Place Graphs on Report'), 2 => __('Migrate Aggregate to use a Template'), 3 => __('Create New Aggregate from Aggregates') ); $agg_item_actions = array( 10 => __('Associate with Aggregate'), 11 => __('Disassociate with Aggregate') ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': form_save(); break; case 'actions': form_actions(); break; case 'edit': top_header(); graph_edit(); bottom_footer(); break; default: top_header(); aggregate_graph(); bottom_footer(); break; } function add_tree_names_to_actions_array() { global $graph_actions; /* add a list of tree names to the actions dropdown */ $trees = db_fetch_assoc('SELECT id,name FROM graph_tree ORDER BY name'); if (cacti_sizeof($trees)) { foreach ($trees as $tree) { $graph_actions['tr_' . $tree['id']] = __('Place on a Tree (%s)', $tree['name']); } } } function form_save() { if (!isset_request_var('save_component_graph')) { header('Location: aggregate_graphs.php?header=false&action=edit&id=' . get_nfilter_request_var('id')); return null; } /* remember some often used values */ $local_graph_id = get_nfilter_request_var('local_graph_id', 0); $graph_template_id = get_nfilter_request_var('graph_template_id', 0); $aggregate_template_id = get_nfilter_request_var('aggregate_template_id', 0); $graph_title = form_input_validate(get_nfilter_request_var('title_format'), 'title_format', '', false, 3); if (is_error_message()) { raise_message(2); header('Location: aggregate_graphs.php?header=false&action=edit&id=' . $local_graph_id); return null; } /* get the aggregate graph id */ $aggregate_graph_id = db_fetch_cell_prepared('SELECT id FROM aggregate_graphs WHERE local_graph_id = ?', array($local_graph_id)); /* if user disabled template propagation we need to get graph data from form */ if (!isset_request_var('template_propogation')) { $aggregate_template_id = 0; $new_data = aggregate_validate_graph_params($_POST, false); } else { $new_data = array(); } if (is_error_message()) { raise_message(2); header('Location: aggregate_graphs.php?header=false&action=edit&id=' . $local_graph_id); return null; } /* save graph data to cacti tables */ $graph_templates_graph_id = aggregate_graph_templates_graph_save( $local_graph_id, $graph_template_id, $graph_title, $aggregate_template_id, $new_data ); /* update title in aggregate graphs table */ db_execute_prepared('UPDATE aggregate_graphs SET title_format = ? WHERE id = ?', array($graph_title, $aggregate_graph_id)); /* next lets see if any of the aggregate has changed and save as applicable * if the graph is templates, we can simply ignore. A simple check will * determine if aggregation propagation is enabled */ if (!isset_request_var('template_propogation')) { /* template propagation is disabled */ $save = array(); $save['id'] = $aggregate_graph_id; $save['aggregate_template_id'] = $aggregate_template_id; $save['template_propogation'] = ''; $save['gprint_prefix'] = get_nfilter_request_var('gprint_prefix'); $save['gprint_format'] = isset_request_var('gprint_format') ? 'on':''; $save['total_prefix'] = get_nfilter_request_var('total_prefix'); $save['total'] = get_filter_request_var('total'); $save['graph_type'] = get_filter_request_var('graph_type'); $save['total_type'] = get_filter_request_var('total_type'); $save['order_type'] = get_filter_request_var('order_type'); /* see if anything changed, if so, we will have to push out the aggregate */ if (!empty($aggregate_graph_id)) { $old = db_fetch_row_prepared('SELECT * FROM aggregate_graphs WHERE id = ?', array($aggregate_graph_id)); $save_me = 0; $save_me += ($old['aggregate_template_id'] != $save['aggregate_template_id']); $save_me += ($old['template_propogation'] != $save['template_propogation']); $save_me += ($old['gprint_prefix'] != $save['gprint_prefix']); $save_me += ($old['gprint_format'] != $save['gprint_format']); $save_me += ($old['graph_type'] != $save['graph_type']); $save_me += ($old['total'] != $save['total']); $save_me += ($old['total_type'] != $save['total_type']); $save_me += ($old['total_prefix'] != $save['total_prefix']); $save_me += ($old['order_type'] != $save['order_type']); if ($save_me) { $aggregate_graph_id = sql_save($save, 'aggregate_graphs'); } /* save the template items now */ /* get existing item ids and sequences from graph template */ $graph_templates_items = array_rekey( db_fetch_assoc_prepared('SELECT id, sequence FROM graph_templates_item WHERE local_graph_id=0 AND graph_template_id = ? ORDER BY sequence', array($graph_template_id)), 'id', array('sequence') ); /* get existing aggregate template items */ $aggregate_graph_items_old = array_rekey( db_fetch_assoc_prepared('SELECT * FROM aggregate_graphs_graph_item WHERE aggregate_graph_id = ? ORDER BY sequence', array($aggregate_graph_id)), 'graph_templates_item_id', array('aggregate_graph_id', 'graph_templates_item_id', 'sequence', 'color_template', 't_graph_type_id', 'graph_type_id', 't_cdef_id', 'cdef_id', 'item_skip', 'item_total') ); /* update graph template item values with posted values */ aggregate_validate_graph_items($_POST, $graph_templates_items); $items_changed = false; $items_to_save = array(); $sequence = 1; foreach($graph_templates_items as $item_id => $data) { $item_new = array(); $item_new['aggregate_graph_id'] = $aggregate_graph_id; $item_new['graph_templates_item_id'] = $item_id; $item_new['color_template'] = isset($data['color_template']) ? $data['color_template']:0; $item_new['item_skip'] = isset($data['item_skip']) ? 'on':''; $item_new['item_total'] = isset($data['item_total']) ? 'on':''; $item_new['sequence'] = $sequence; /* compare with old item to see if we need to push out. */ if (!isset($aggregate_graph_items_old[$item_id])) { /* this item does not yet exist */ $items_changed = true; } else { /* compare data from user to data from DB */ foreach ($item_new as $field => $new_value) { if ($aggregate_graph_items_old[$item_id][$field] != $new_value) { $items_changed = true; } } /* fill in missing fields with db values */ $item_new = array_merge($aggregate_graph_items_old[$item_id], $item_new); } $items_to_save[] = $item_new; $sequence++; } if ($items_changed) { aggregate_graph_items_save($items_to_save, 'aggregate_graphs_graph_item'); } if ($save_me || $items_changed) { push_out_aggregates(0, $local_graph_id); } } } raise_message(1); header('Location: aggregate_graphs.php?header=false&action=edit&id=' . $local_graph_id); } /* ------------------------ The "actions" function ------------------------ */ function form_actions() { global $graph_actions, $agg_item_actions; /* ================= input validation ================= */ get_filter_request_var('drp_action', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-zA-Z0-9_]+)$/'))); /* ==================================================== */ /* we are performing two set's of actions here */ $graph_actions += $agg_item_actions; /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_request_var('drp_action') == '1') { // delete api_aggregate_remove_multi($selected_items); } elseif (get_request_var('drp_action') == '2') { // migrate to template api_aggregate_convert_template($selected_items); } elseif (get_request_var('drp_action') == '3') { // create aggregate from aggregate $aggregate_name = get_request_var('aggregate_name'); api_aggregate_create($aggregate_name, $selected_items); } elseif (get_request_var('drp_action') == '4') { // add graphs to report $good = true; for ($i=0;($i $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $graph_list .= '
  • ' . html_escape(get_graph_title($matches[1])) . '
  • '; $graph_array[$i] = $matches[1]; $i++; } } top_header(); /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); form_start('aggregate_graphs.php'); html_start_box($graph_actions[get_request_var('drp_action')], '60%', '', '3', 'center', ''); $save_html = ''; if (isset($graph_array) && cacti_sizeof($graph_array)) { if (get_request_var('drp_action') == '1') { // delete print "

    " . __('Click \'Continue\' to delete the following Aggregate Graph(s).') . "

      $graph_list
    "; $save_html = " "; } elseif (get_request_var('drp_action') == '2') { // migrate to aggregate /* determine the common graph template if any */ foreach ($_POST as $var => $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { $local_graph_ids[] = $matches[1]; } } $lgid = implode(',',$local_graph_ids); /* for whatever reason, subquery performance in mysql is sub-optimal. Therefore, let's do this * as a few queries instead. */ $task_items = array_rekey(db_fetch_assoc("SELECT DISTINCT task_item_id FROM graph_templates_item WHERE local_graph_id IN($lgid)"), 'task_item_id', 'task_item_id'); if (cacti_sizeof($task_items)) { $task_items = implode(',', $task_items); $graph_templates = db_fetch_assoc("SELECT DISTINCT graph_template_id FROM graph_templates_item WHERE task_item_id IN ($task_items) AND graph_template_id>0"); } else { $graph_templates = array(); } if (cacti_sizeof($graph_templates) > 1) { print "

    " . __('The selected Aggregate Graphs represent elements from more than one Graph Template.') . "

    " . __('In order to migrate the Aggregate Graphs below to a Template based Aggregate, they must only be using one Graph Template. Please press \'Return\' and then select only Aggregate Graph that utilize the same Graph Template.') . "

      $graph_list
    "; $save_html = ""; } elseif (cacti_sizeof($graph_templates) == 0) { print "

    " . __('The selected Aggregate Graphs does not appear to have any matching Aggregate Templates.') . "

    " . __('In order to migrate the Aggregate Graphs below use an Aggregate Template, one must already exist. Please press \'Return\' and then first create your Aggregate Template before retrying.') . "

      $graph_list
    "; } else { $graph_template = $graph_templates[0]['graph_template_id']; $aggregate_templates = db_fetch_assoc_prepared('SELECT id, name FROM aggregate_graph_templates WHERE graph_template_id = ? ORDER BY name', array($graph_template)); if (cacti_sizeof($aggregate_templates)) { print "

    " . __('Click \'Continue\' and the following Aggregate Graph(s) will be migrated to use the Aggregate Template that you choose below.') . "

      $graph_list
    "; print " " . __('Aggregate Template:') . " "; $save_html = " "; } else { print "

    " . __('There are currently no Aggregate Templates defined for the selected Legacy Aggregates.') . "

    " . __('In order to migrate the Aggregate Graphs below to a Template based Aggregate, first create an Aggregate Template for the Graph Template \'%s\'.', db_fetch_cell_prepared('SELECT name FROM graph_templates WHERE id = ?', array($graph_template))) . "

    " . __('Please press \'Return\' to continue.') . "

      $graph_list
    "; $save_html = ""; } } } elseif (get_request_var('drp_action') == '3') { // create aggregate from aggregates print "

    " . __('Click \'Continue\' to combine the following Aggregate Graph(s) into a single Aggregate Graph.') . "

      $graph_list
    "; print " " . __('Aggregate Name:') . ""; print " "; $save_html = " "; } elseif (get_request_var('drp_action') == '4') { global $alignment, $graph_timespans; $reports = db_fetch_assoc_prepared('SELECT id, name FROM reports WHERE user_id = ? ORDER BY name', array($_SESSION['sess_user_id'])); if (cacti_sizeof($reports)) { print "

    " . __('Click \'Continue\' to add the selected Graphs to the Report below.') . "

      $graph_list
    " . __('Report Name') . '
    '; form_dropdown('report_id', $reports, 'name', 'id', '', '', '0'); print ''; print '' . __('Timespan') . '
    '; form_dropdown('timespan',$graph_timespans, '', '', '', '', read_user_setting('default_timespan')); print ''; print '' . __('Align') . '
    '; form_dropdown('align',$alignment, '', '', '', '', REPORTS_ALIGN_CENTER); print ""; $save_html = " "; } else { print "" . __('You currently have no reports defined.') . ""; $save_html = ""; } } elseif (get_request_var('drp_action') == '5') { // convert to a normal graph print "

    " . __('Click \'Continue\' to convert the following Aggregate Graph(s) into a normal Graph.') . "

      $graph_list
    "; $save_html = " "; } elseif (get_request_var('drp_action') == '10') { // associate with aggregate print "

    " . __('Click \'Continue\' to associate the following Graph(s) with the Aggregate Graph.') . "

      $graph_list
    "; $save_html = " "; } elseif (get_request_var('drp_action') == '11') { // dis-associate with aggregate print "

    " . __('Click \'Continue\' to disassociate the following Graph(s) from the Aggregate.') . "

      $graph_list
    "; $save_html = " "; } elseif (preg_match("/^tr_([0-9]+)$/", get_request_var('drp_action'), $matches)) { // place on tree print "

    " . __('Click \'Continue\' to place the following Aggregate Graph(s) under the Tree Branch.') . "

      $graph_list

    " . __('Destination Branch:') . "
    "; grow_dropdown_tree($matches[1], '0', 'tree_item_id', '0'); print "

    "; $save_html = " "; } } else { raise_message(40); header('Location: aggregate_graphs.php?header=false'); exit; } print " $save_html "; html_end_box(false); form_end(); bottom_footer(); } function graph_edit() { global $config, $struct_graph, $struct_aggregate_graph, $image_types, $consolidation_functions, $graph_item_types, $struct_graph_item; // Remove filter item unset($struct_graph_item['data_template_id']); /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ /* purge any old graphs */ aggregate_prune_graphs(get_request_var('id')); if (isset_request_var('reset')) { $_SESSION['aggregate_referer'] = 'aggregate_graphs.php'; } elseif (isset($_SERVER['HTTP_REFERER']) && !substr_count($_SERVER['HTTP_REFERER'], 'aggregate_graphs.php')) { $_SESSION['aggregate_referer'] = $_SERVER['HTTP_REFERER']; } elseif (isset($_SERVER['HTTP_REFERER']) && !isset($_SESSION['aggregate_referer'])) { $_SESSION['aggregate_referer'] = $_SERVER['HTTP_REFERER']; } $referer = isset($_SESSION['aggregate_referer']) ? $_SESSION['aggregate_referer'] : 'aggregate_graphs.php'; $use_graph_template = false; $aginfo = array(); $graphs = array(); if (!isempty_request_var('id')) { $graphs = db_fetch_row_prepared('SELECT * FROM graph_templates_graph WHERE local_graph_id = ?', array(get_request_var('id'))); if (cacti_sizeof($graphs)) { $aginfo = db_fetch_row_prepared('SELECT * FROM aggregate_graphs WHERE local_graph_id = ?', array($graphs['local_graph_id'])); if ($aginfo['title_format'] == '') { $aginfo['title_format'] = get_graph_title($graphs['local_graph_id']); } $header_label = __esc('[edit: %s]', get_graph_title(get_request_var('id'))); } else { $header_label = __('Aggregate Graph does not Exist'); } } if (cacti_sizeof($aginfo)) { if ($aginfo['aggregate_template_id'] > 0) { $template = db_fetch_row_prepared('SELECT * FROM aggregate_graph_templates WHERE id = ?', array($aginfo['aggregate_template_id'])); } else { $template = $aginfo; } $aggregate_tabs = array( 'details' => __('Details'), 'items' => __('Items'), 'preview' => __('Preview') ); } elseif (cacti_sizeof($graphs)) { $template = array(); $aggregate_tabs = array( 'details' => __('Details'), 'preview' => __('Preview') ); } else { raise_message('missing_aggregate', __('Aggregate Graphs Accessed does not Exist'), MESSAGE_LEVEL_ERROR); if (isset($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; header('Location: ' . $referer); } else { header('Location: aggregate_graphs.php'); } exit; } /* ================= input validation and session storage ================= */ if (isset_request_var('tab')) { switch(get_nfilter_request_var('tab')) { case 'details': case 'items': case 'preview': $_SESSION['agg_tab'] = get_nfilter_request_var('tab'); set_request_var('tab', get_nfilter_request_var('tab')); break; default: if (isset($_SESSION['agg_tab'])) { set_request_var('tab', $_SESSION['agg_tab']); }else{ $_SESSION['agg_tab'] = 'details'; set_request_var('tab', 'details'); } } } elseif (isset($_SESSION['agg_tab'])) { set_request_var('tab', $_SESSION['agg_tab']); } else { set_request_var('tab', 'details'); } /* ================= input validation ================= */ $current_tab = get_nfilter_request_var('tab'); /* draw the categories tabs on the top of the page */ print "
    "; print "
    "; } elseif (!isempty_request_var('id') && $current_tab == 'details' && (!cacti_sizeof($template))) { print ""; } else { print ""; } if (!isempty_request_var('id') && $current_tab == 'preview') { $graph = db_fetch_row_prepared('SELECT * FROM graph_local WHERE id = ?', array(get_request_var('id'))); if (!cacti_sizeof($graph)) { html_start_box(__('Aggregate Preview Does Not Exist'), '100%', '', '3', 'center', ''); print "" . __('Aggregate Graph does not Exist') . ''; html_end_box(false); raise_message('noaggregate', __('Aggregate Graph does not Exist'), MESSAGE_LEVEL_ERROR); return false; } html_start_box(__('Aggregate Preview %s', $header_label), '100%', '', '3', 'center', ''); ?>


    "; html_start_box(__('Aggregate Graph %s', $header_label), '100%', true, '3', 'center', ''); $helper_string = '|host_description|'; if (isset($template)) { $data_query = db_fetch_cell_prepared('SELECT snmp_query_id FROM snmp_query_graph WHERE graph_template_id = ?', array($template['graph_template_id'])); if ($data_query > 0) { $data_query_info = get_data_query_array($data_query); foreach($data_query_info['fields'] as $field_name => $field_array) { if ($field_array['direction'] == 'input' || $field_array['direction'] == 'input-output') { $helper_string .= ($helper_string != '' ? ', ':'') . '|query_' . $field_name . '|'; } } } } // Append the helper string $struct_aggregate_graph['suggestions'] = array( 'method' => 'other', 'friendly_name' => __('Prefix Replacement Values'), 'description' => __('You may use these replacement values for the Prefix in the Aggregate Graph'), 'value' => $helper_string ); /* add template propagation to the structure */ draw_edit_form( array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($struct_aggregate_graph, (isset($aginfo) ? $aginfo : array())) ) ); html_end_box(true, true); if (isset($template)) { draw_aggregate_graph_items_list(0, $template['graph_template_id'], $aginfo); } form_hidden_box('save_component_template', '1', ''); ?> '; } /* we will show the classic representation only when we are not templating */ print "
    "; ?> '> '> $field_array) { if ($field_array['method'] != 'spacer') { if ($field_name != 'title') { $form_array += array($field_name => $struct_graph[$field_name]); $form_array[$field_name]['value'] = (isset($graphs) ? $graphs[$field_name] : ''); $form_array[$field_name]['form_id'] = (isset($graphs) ? $graphs['id'] : '0'); if (!(($use_graph_template == false) || ($graphs['t_' . $field_name] == 'on'))) { $form_array[$field_name]['method'] = 'template_' . $form_array[$field_name]['method']; $form_array[$field_name]['description'] = ''; } } } else { $form_array += array($field_name => $struct_graph[$field_name]); } } draw_edit_form( array( 'config' => array('no_form_tag' => true), 'fields' => $form_array ) ); html_end_box(true, true); } form_hidden_box('save_component_graph','1',''); form_hidden_box('save_component_input','1',''); form_hidden_box('rrdtool_version', get_rrdtool_version(), ''); form_save_button($referer, 'return', 'id'); echo '
    '; ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'template_id' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'rfilter' => array( 'filter' => FILTER_VALIDATE_IS_REGEX, 'pageset' => true, 'default' => '' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'matching' => array( 'filter' => FILTER_CALLBACK, 'default' => 'on', 'options' => array('options' => 'sanitize_search_string') ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'title_cache', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'custom' => array( 'filter' => FILTER_VALIDATE_REGEXP, 'options' => array('options' => array('regexp' => '(true|false)')), 'pageset' => true, 'default' => '' ), 'local_graph_ids' => array( 'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST, 'pageset' => true, 'default' => '' ) ); validate_store_request_vars($filters, 'sess_agraph_item'); /* ================= input validation ================= */ if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } /* form the 'where' clause for our main sql query */ if (get_request_var('rfilter') == '') { $sql_where = ''; } elseif (validate_is_regex(get_request_var('rfilter'))) { $sql_where = "WHERE gtg.title_cache RLIKE '" . get_request_var('rfilter') . "'"; } else { $filters = explode(' ', get_request_var('rfilter')); $sql_where = ''; $sql_where = aggregate_make_sql_where($sql_where, $filters, 'gtg.title_cache'); } if (get_request_var('matching') != 'false') { $sql_where .= ($sql_where != '' ? ' AND':'WHERE') . ' (agi.local_graph_id IS NOT NULL)'; } $graph_template = db_fetch_cell_prepared('SELECT graph_template_id FROM aggregate_graphs AS ag WHERE ag.local_graph_id = ?', array(get_request_var('id'))); $aggregate_id = db_fetch_cell_prepared('SELECT id FROM aggregate_graphs WHERE local_graph_id = ?', array(get_request_var('id'))); $total_items = db_fetch_cell_prepared('SELECT COUNT(*) FROM aggregate_graphs_items WHERE aggregate_graph_id = ?', array($aggregate_id)); if (!empty($graph_template)) { $sql_where .= ($sql_where != '' ? ' AND':'WHERE') . " (gtg.graph_template_id=$graph_template)"; } if (get_request_var('local_graph_ids') != '') { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . ' agi.local_graph_id IN(' . get_request_var('local_graph_ids') . ')'; } $sql = "SELECT COUNT(DISTINCT gl.id) AS total FROM graph_templates_graph AS gtg INNER JOIN graph_local AS gl ON gtg.local_graph_id=gl.id LEFT JOIN ( SELECT DISTINCT local_graph_id FROM aggregate_graphs_items WHERE aggregate_graph_id=$aggregate_id) AS agi ON gtg.local_graph_id=agi.local_graph_id $sql_where"; $total_rows = get_total_row_data($_SESSION['sess_user_id'], $sql, array(), 'aggregate_graph'); $sql_order = get_order_string(); $sql_limit = ' LIMIT ' . ($rows*(get_request_var('page')-1)) . ',' . $rows; $graph_list = db_fetch_assoc("SELECT gtg.id, gtg.local_graph_id, gtg.height, gtg.width, gtg.title_cache, agi.local_graph_id AS agg_graph_id FROM graph_templates_graph AS gtg INNER JOIN graph_local AS gl ON gtg.local_graph_id=gl.id LEFT JOIN ( SELECT DISTINCT local_graph_id FROM aggregate_graphs_items WHERE aggregate_graph_id=$aggregate_id) AS agi ON gtg.local_graph_id=agi.local_graph_id $sql_where $sql_order $sql_limit"); ?>
    '> > ' title=''> ' title=''>
    '>
    array('display' => __('Graph Title'), 'align' => 'left', 'sort' => 'ASC'), 'local_graph_id' => array('display' => __('ID'), 'align' => 'right', 'sort' => 'ASC'), 'agg_graph_id' => array('display' => __('Included in Aggregate'), 'align' => 'left', 'sort' => 'ASC'), 'height' => array('display' => __('Size'), 'align' => 'right', 'sort' => 'ASC')); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false, 'aggregate_graphs.php?action=edit&id=' . get_request_var('id')); if (cacti_sizeof($graph_list) > 0) { foreach ($graph_list as $graph) { /* we're escaping strings here, so no need to escape them on form_selectable_cell */ form_alternate_row('line' . $graph['local_graph_id'], true); if (validate_is_regex(get_request_var('rfilter'))) { form_selectable_cell(filter_value($graph['title_cache'], get_request_var('rfilter')), $graph['local_graph_id']); } else { form_selectable_ecell(get_request_var('rfilter') != '' ? aggregate_format_text($graph['title_cache'], get_request_var('rfilter')) : $graph['title_cache'], $graph['local_graph_id']); } form_selectable_cell($graph['local_graph_id'], $graph['local_graph_id'], '', 'right'); form_selectable_cell(($graph['agg_graph_id'] != '' ? "" . __('Yes') . '':"" . __('No') . ""), $graph['local_graph_id']); form_selectable_ecell($graph['height'] . 'x' . $graph['width'], $graph['local_graph_id'], '', 'right'); form_checkbox_cell($graph['title_cache'], $graph['local_graph_id']); form_end_row(); } } else { print '' . __('No Graphs Found') . ''; } html_end_box(false); /* put the nav bar on the bottom as well */ print $nav; /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); /* draw the dropdown containing a list of available actions for this form */ form_hidden_box('local_graph_id', get_request_var('id'), ''); draw_actions_dropdown($agg_item_actions); form_end(); } function aggregate_make_sql_where($sql_where, $items, $field) { if ($sql_where != '') { $sql_where .= ' AND ('; } else { $sql_where = 'WHERE ('; } $indentation = 0; $termcount = 0; if (cacti_sizeof($items)) { foreach($items as $i) { $i = trim($i); while (substr($i,0,1) == '(') { $indentation++; $termcount = 0; $sql_where .= '('; $i = substr($i, 1); } $split = strpos($i, ')'); if ($split !== false) { $end = trim(substr($i, $split)); $i = substr($i, 0, $split); } else { $end = ''; } if ($i != '') { if (strtolower($i) == 'and') { $sql_where .= ' AND '; } elseif (strtolower($i) == 'or') { $sql_where .= ' OR '; } else { $sql_where .= ($termcount > 0 ? ' OR ':'') . $field . " LIKE '%" . trim($i) . "%'"; $termcount++; } } if ($end != '') { while (substr($end, 0, 1) == ')') { $indentation--; $termcount = 0; $sql_where .= ')'; $end = trim(substr($end, 1)); } } } } $sql_where .= ')'; return trim($sql_where); } function aggregate_format_text($text, $filter) { $items = explode(' ', $filter); $tags = array(); foreach($items as $i) { $i = trim($i); $i = str_replace('(','',$i); $i = str_replace(')','',$i); if (strtolower($i) == 'and' || strtolower($i) == 'or') { continue; } if (substr_count($text, $i) !== false) { $tagno = rand(); $tags[$tagno] = $i; $text = str_replace($i, "<<$tagno>>", $text); } } if (cacti_sizeof($tags)) { foreach($tags as $k => $t) { $text = str_replace("<<$k>>", "" . html_escape($t) . "", $text); } } return $text; } function aggregate_graph() { global $graph_actions, $item_rows; /* ================= input validation and session storage ================= */ $filters = array( 'rows' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'template_id' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '', ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'title_cache', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'local_graph_ids' => array( 'filter' => FILTER_VALIDATE_IS_NUMERIC_LIST, 'pageset' => true, 'default' => '' ) ); validate_store_request_vars($filters, 'sess_agraph'); /* ================= input validation ================= */ if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } ?>
    '> ' title=''> ' title=''>
    array('display' => __('Graph Title'), 'align' => 'left', 'sort' => 'ASC', 'tip' => __('The title for the Aggregate Graphs')), 'local_graph_id' => array('display' => __('ID'), 'align' => 'right', 'sort' => 'ASC', 'tip' => __('The internal database identifier for this object')), 'name' => array('display' => __('Aggregate Template'), 'align' => 'left', 'sort' => 'ASC', 'tip' => __('The Aggregate Template that this Aggregate Graphs is based upon')), 'height' => array('display' => __('Size'), 'align' => 'right', 'sort' => 'ASC') ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false, 'aggregate_graphs.php?filter=' . get_request_var('filter')); if (cacti_sizeof($graph_list)) { foreach ($graph_list as $graph) { /* we're escaping strings here, so no need to escape them on form_selectable_cell */ $template_name = html_escape($graph['name']); form_alternate_row('line' . $graph['local_graph_id'], true); form_selectable_cell(filter_value(title_trim($graph['title_cache'], read_config_option('max_title_length')), get_request_var('filter'), 'aggregate_graphs.php?action=edit&id=' . $graph['local_graph_id']), $graph['local_graph_id']); form_selectable_cell($graph['local_graph_id'], $graph['local_graph_id'], '', 'right'); form_selectable_cell((empty($graph['name']) ? '' . __('None') . '' : filter_value($template_name, get_request_var('filter'))), $graph['local_graph_id']); form_selectable_ecell($graph['height'] . 'x' . $graph['width'], $graph['local_graph_id'], '', 'right'); form_checkbox_cell($graph['title_cache'], $graph['local_graph_id']); form_end_row(); } } else { print '' . __('No Aggregate Graphs Found') .''; } html_end_box(false); if (cacti_sizeof($graph_list)) { print $nav; } /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($graph_actions); /* remove old graphs */ purge_old_graphs(); form_end(); } function purge_old_graphs() { /* workaround to handle purged graphs */ $old_graphs = array_rekey(db_fetch_assoc('SELECT DISTINCT local_graph_id FROM aggregate_graphs_items AS pagi LEFT JOIN graph_local AS gl ON pagi.local_graph_id=gl.id WHERE gl.id IS NULL AND local_graph_id>0'), 'local_graph_id', 'local_graph_id'); if (cacti_sizeof($old_graphs)) { db_execute('DELETE FROM aggregate_graphs_items WHERE local_graph_id IN (' . implode(',', $old_graphs) . ')'); } $old_aggregates = array_rekey(db_fetch_assoc('SELECT DISTINCT local_graph_id FROM aggregate_graphs AS pag LEFT JOIN graph_local AS gl ON pag.local_graph_id=gl.id WHERE gl.id IS NULL AND local_graph_id>0'), 'local_graph_id', 'local_graph_id'); $old_agg_ids = array_rekey(db_fetch_assoc('SELECT DISTINCT pag.id FROM aggregate_graphs AS pag LEFT JOIN graph_local AS gl ON pag.local_graph_id=gl.id WHERE gl.id IS NULL'), 'id', 'id'); if (cacti_sizeof($old_aggregates)) { db_execute('DELETE FROM graph_templates_item WHERE local_graph_id IN (' . implode(',', $old_aggregates) . ')'); db_execute('DELETE FROM graph_templates_graph WHERE local_graph_id IN (' . implode(',', $old_aggregates) . ')'); db_execute('DELETE FROM aggregate_graphs WHERE local_graph_id IN (' . implode(',', $old_aggregates) . ')'); } if (cacti_sizeof($old_agg_ids)) { db_execute('DELETE FROM aggregate_graphs_items WHERE aggregate_graph_id IN (' . implode(',', $old_agg_ids) . ')'); } } cacti-release-1.2.26/aggregate_templates.php000066400000000000000000000621561454067461500210460ustar00rootroot00000000000000 __('Delete') ); /* set default action */ set_default_action(); if (get_request_var('action') == 'save') { if (isset_request_var('id') && get_filter_request_var('id') == 0 && isset_request_var('graph_template_id_prev') && get_filter_request_var('graph_template_id_prev') == 0) { set_request_var('action', 'edit'); } } switch (get_request_var('action')) { case 'save': aggregate_form_save(); break; case 'actions': aggregate_form_actions(); break; case 'edit': top_header(); aggregate_template_edit(); bottom_footer(); break; default: top_header(); aggregate_template(); bottom_footer(); break; } /* -------------------------- The Save Function -------------------------- */ /** * aggregate_form_save the save function */ function aggregate_form_save() { /* make sure we are saving aggregate template */ if (!isset_request_var('save_component_template')) { header('Location: aggregate_templates.php?header=false&action=edit&id=' . get_nfilter_request_var('id')); return null; } $save1 = array(); /* updating existing template or creating a new one? */ if (isset_request_var('id') && get_request_var('id') > 0) { $is_new = false; $save1['id'] = get_nfilter_request_var('id'); } else { $is_new = true; $save1['id'] = 0; } /* set some defaults for possibly disabled values */ if (!isset_request_var('total')) set_request_var('total', 0); if (!isset_request_var('total_type')) set_request_var('total_type', 0); if (!isset_request_var('order_type')) set_request_var('order_type', 0); if (!isset_request_var('total_prefix')) set_request_var('total_prefix', ''); /* populate aggregate template save array and validate posted values*/ $save1['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3); $save1['graph_template_id'] = get_filter_request_var('graph_template_id_prev'); $save1['gprint_prefix'] = form_input_validate(get_nfilter_request_var('gprint_prefix'), 'gprint_prefix', '', true, 3); $save1['gprint_format'] = isset_request_var('gprint_format') ? 'on':''; $save1['graph_type'] = form_input_validate(get_nfilter_request_var('graph_type'), 'graph_type', '', false, 3); $save1['total'] = form_input_validate(get_nfilter_request_var('total'), 'total', '', false, 3); $save1['total_type'] = form_input_validate(get_nfilter_request_var('total_type'), 'total_type', '', false, 3); $save1['total_prefix'] = form_input_validate(get_nfilter_request_var('total_prefix'), 'total_prefix', '', true, 3); $save1['order_type'] = form_input_validate(get_nfilter_request_var('order_type'), 'order_type', '', false, 3); $save1['user_id'] = $_SESSION['sess_user_id']; /* form validation failed */ if (is_error_message()) { header('Location: aggregate_templates.php?header=false&action=edit&id=' . get_nfilter_request_var('id')); return null; } cacti_log('AGGREGATE GRAPH TEMPLATE Saved ID: ' . $save1['id'] . ' Name: ' . $save1['name'], false, 'AGGREGATE', POLLER_VERBOSITY_DEBUG); /* do a quick comparison to see if anything changed */ if ($is_new == false) { $old = db_fetch_row_prepared('SELECT * FROM aggregate_graph_templates WHERE id = ?', array($save1['id'])); $save_me = 0; $save_me += ($old['name'] != $save1['name']); $save_me += ($old['gprint_prefix'] != $save1['gprint_prefix']); $save_me += ($old['gprint_format'] != $save1['gprint_format']); $save_me += ($old['graph_type'] != $save1['graph_type']); $save_me += ($old['total'] != $save1['total']); $save_me += ($old['total_type'] != $save1['total_type']); $save_me += ($old['total_prefix'] != $save1['total_prefix']); $save_me += ($old['order_type'] != $save1['order_type']); } else { $save_me = 1; } if ($save_me) { $id = sql_save($save1, 'aggregate_graph_templates', 'id'); /* update children of the template */ db_execute_prepared("UPDATE aggregate_graphs SET gprint_prefix = ?, gprint_format = ?, graph_type = ?, total = ?, total_prefix = ?, order_type = ? WHERE aggregate_template_id = ? AND template_propogation='on'", array($save1['gprint_prefix'], $save1['gprint_format'], $save1['graph_type'], $save1['total'], $save1['total_prefix'], $save1['order_type'], $id)); cacti_log('AGGREGATE GRAPH TEMPLATE Saved ID: ' . $id, false, 'AGGREGATE', POLLER_VERBOSITY_DEBUG); } else { $id = $save1['id']; } if (!$id) { raise_message(2); header('Location: aggregate_templates.php?header=false&action=edit&id=' . get_nfilter_request_var('id')); return null; } /* save extra graph parameters */ /* validate posted graph params */ $params_new = aggregate_validate_graph_params($_POST, true); $params_new['aggregate_template_id'] = $id; /* compare new graph param values with existing in DB. * We need to know if there were changes so we only * rebuild existing graphs if needed. */ $params_changed = false; $params_old = db_fetch_row_prepared('SELECT * FROM aggregate_graph_templates_graph WHERE aggregate_template_id = ?', array($id)); if (!empty($params_old)) { foreach ($params_old as $field => $value_old) { if (isset($params_new[$field]) && $params_new[$field] != $value_old) { $params_changed = true; break; } } } else { $params_changed = true; } /* save only if all posted form fields passed validation */ if ($params_changed && !is_error_message()) { sql_save($params_new, 'aggregate_graph_templates_graph', 'aggregate_template_id', false); } /* save the template items now */ /* get existing item ids and sequences from graph template */ $graph_templates_items = array_rekey( db_fetch_assoc_prepared('SELECT id, sequence FROM graph_templates_item WHERE local_graph_id=0 AND graph_template_id = ?', array($save1['graph_template_id'])), 'id', array('sequence') ); /* get existing aggregate template items */ $aggregate_template_items_old = array_rekey( db_fetch_assoc_prepared('SELECT * FROM aggregate_graph_templates_item WHERE aggregate_template_id = ?', array($id)), 'graph_templates_item_id', array('sequence', 'color_template', 't_graph_type_id', 'graph_type_id', 't_cdef_id', 'cdef_id', 'item_skip', 'item_total') ); /* update graph template item values with posted values */ aggregate_validate_graph_items($_POST, $graph_templates_items); $items_changed = false; $items_to_save = array(); foreach($graph_templates_items as $item_id => $data) { $item_new = array(); $item_new['aggregate_template_id'] = $id; $item_new['graph_templates_item_id'] = $item_id; $item_new['color_template'] = isset($data['color_template']) ? $data['color_template']:0; $item_new['item_skip'] = isset($data['item_skip']) ? 'on':''; $item_new['item_total'] = isset($data['item_total']) ? 'on':''; $item_new['sequence'] = isset($data['sequence']) ? $data['sequence']:0; /* compare with old item to see if we need to push out. */ if (!isset($aggregate_template_items_old[$item_id])) { /* this item does not yet exist */ $items_changed = true; } else { // fill in missing fields with db values $item_new = array_merge($aggregate_template_items_old[$item_id], $item_new); /* compare data from user to data from DB */ foreach ($data as $field => $new_value) { if ($aggregate_template_items_old[$item_id][$field] != $new_value) $items_changed = true; } } $items_to_save[] = $item_new; } if ($items_changed) { aggregate_graph_items_save($items_to_save, 'aggregate_graph_templates_item'); } if ($save_me || $params_changed || $items_changed) { push_out_aggregates($id); } raise_message(1); header('Location: aggregate_templates.php?header=false&action=edit&id=' . (empty($id) ? get_nfilter_request_var('id') : $id)); } function aggregate_get_graph_items($table, $id) { } /* ------------------------ The 'actions' function ------------------------ */ /** * aggregate_form_actions the action function */ function aggregate_form_actions() { global $aggregate_actions, $config; /* ================= input validation ================= */ get_filter_request_var('drp_action'); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ db_execute('DELETE FROM aggregate_graph_templates WHERE ' . array_to_sql_or($selected_items, 'id')); db_execute('DELETE FROM aggregate_graph_templates_item WHERE ' . array_to_sql_or($selected_items, 'aggregate_template_id')); db_execute('DELETE FROM aggregate_graph_templates_graph WHERE ' . array_to_sql_or($selected_items, 'aggregate_template_id')); db_execute("UPDATE aggregate_graphs SET aggregate_template_id=0, template_propogation='' WHERE " . array_to_sql_or($selected_items, 'aggregate_template_id')); } } else { } header('Location: aggregate_templates.php?header=false'); exit; } /* setup some variables */ $aggregate_list = ''; $i = 0; /* loop through each of the color templates selected on the previous page and get more info about them */ foreach ($_POST as $var => $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $aggregate_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT name FROM aggregate_graph_templates WHERE id = ?', array($matches[1]))) . '
  • '; $aggregate_array[] = $matches[1]; } } top_header(); form_start('aggregate_templates.php'); html_start_box($aggregate_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (isset($aggregate_array) && cacti_sizeof($aggregate_array)) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ print "

    " . __('Click \'Continue\' to Delete the following Aggregate Graph Template(s).') . "

      $aggregate_list
    \n"; $save_html = " "; } } else { raise_message(40); header('Location: aggregate_templates.php?header=false'); exit; } print " $save_html \n"; html_end_box(); form_end(); bottom_footer(); } /** * aggregate_template_edit edit the color template */ function aggregate_template_edit() { global $image_types, $struct_aggregate_template; /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ if (!isempty_request_var('id')) { $template = db_fetch_row_prepared('SELECT * FROM aggregate_graph_templates WHERE id = ?', array(get_request_var('id'))); $header_label = __esc('Aggregate Template [edit: %s]', $template['name']); } else { $header_label = __('Aggregate Template [new]'); } /* populate the graph template id if it's set */ if (isset_request_var('graph_template_id') && !isset($template)) { /* ================= input validation ================= */ get_filter_request_var('graph_template_id'); /* ==================================================== */ $template['graph_template_id'] = get_nfilter_request_var('graph_template_id'); $template['id'] = 0; } form_start('aggregate_templates.php', 'template_edit'); html_start_box($header_label, '100%', true, '3', 'center', ''); $helper_string = '|host_description|'; if (isset($template)) { $data_query = db_fetch_cell_prepared('SELECT snmp_query_id FROM snmp_query_graph WHERE graph_template_id = ?', array($template['graph_template_id'])); if ($data_query > 0) { $data_query_info = get_data_query_array($data_query); foreach($data_query_info['fields'] as $field_name => $field_array) { if ($field_array['direction'] == 'input' || $field_array['direction'] == 'input-output') { $helper_string .= ($helper_string != '' ? ', ':'') . '|query_' . $field_name . '|'; } } } } // Append the helper string $struct_aggregate_template['suggestions'] = array( 'method' => 'other', 'friendly_name' => __('Prefix Replacement Values'), 'description' => __('You may use these replacement values for the Prefix in the Aggregate Graph'), 'value' => $helper_string ); draw_edit_form( array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($struct_aggregate_template, (isset($template) ? $template : array())) ) ); html_end_box(true, true); if (isset($template)) { draw_aggregate_graph_items_list(0, $template['graph_template_id'], $template); /* Draw Graph Configuration form, so user can override some parameters from graph template */ draw_aggregate_template_graph_config($template['id'], $template['graph_template_id']); } form_hidden_box('id', (isset($template['id']) ? $template['id'] : '0'), '0'); form_hidden_box('save_component_template', '1', ''); form_save_button('aggregate_templates.php', 'return', 'id'); ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'pgt.name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'has_graphs' => array( 'filter' => FILTER_VALIDATE_REGEXP, 'options' => array('options' => array('regexp' => '(true|false)')), 'pageset' => true, 'default' => read_config_option('default_has') == 'on' ? 'true':'false' ) ); validate_store_request_vars($filters, 'sess_agg_tmp'); /* ================= input validation ================= */ if (get_request_var('rows') == '-1') { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } html_start_box(__('Aggregate Templates'), '100%', '', '3', 'center', 'aggregate_templates.php?action=edit'); $filter_html = '
    ' . __('Search') . ' ' . __('Templates') . '
    '; print $filter_html; html_end_box(); /* form the 'where' clause for our main sql query */ $sql_where = ''; if (get_request_var('filter') != '') { $sql_where = 'WHERE (pgt.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ' OR gt.name LIKE ' . db_qstr('%' . get_request_var('filter') . '%') . ')'; } if (get_request_var('has_graphs') == 'true') { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'graphs.graphs>0'; } $total_rows = db_fetch_cell("SELECT COUNT(pgt.id) FROM aggregate_graph_templates AS pgt LEFT JOIN ( SELECT aggregate_template_id, COUNT(*) AS graphs FROM aggregate_graphs GROUP BY aggregate_template_id ) AS graphs ON pgt.id=graphs.aggregate_template_id LEFT JOIN graph_templates AS gt ON gt.id=pgt.graph_template_id $sql_where"); $sql_order = get_order_string(); $sql_limit = ' LIMIT ' . ($rows*(get_request_var('page')-1)) . ',' . $rows; $template_list = db_fetch_assoc("SELECT pgt.*, graphs.graphs, gt.name AS graph_template_name FROM aggregate_graph_templates AS pgt LEFT JOIN ( SELECT aggregate_template_id, COUNT(*) AS graphs FROM aggregate_graphs GROUP BY aggregate_template_id ) AS graphs ON pgt.id=graphs.aggregate_template_id LEFT JOIN graph_templates AS gt ON gt.id=pgt.graph_template_id $sql_where $sql_order $sql_limit"); $nav = html_nav_bar('aggregate_templates.php', MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 5, __('Aggregate Templates'), 'page', 'main'); form_start('aggregate_templates.php', 'chk'); print $nav; html_start_box('', '100%', '', '3', 'center', ''); $display_text = array( 'pgt.name' => array('display' => __('Template Title'), 'align' => 'left', 'sort' => 'ASC'), 'nosort' => array('display' => __('Deletable'), 'align' => 'right', 'tip' => __('Aggregate Templates that are in use can not be Deleted. In use is defined as being referenced by an Aggregate.')), 'graphs.graphs' => array('display' => __('Graphs Using'), 'align' => 'right', 'sort' => 'DESC'), 'graph_template_name' => array('display' => __('Graph Template'), 'align' => 'left', 'sort' => 'ASC') ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); if (cacti_sizeof($template_list)) { foreach ($template_list as $template) { if ($template['graphs'] > 0) { $disabled = true; } else { $disabled = false; } form_alternate_row('line' . $template['id'], true, $disabled); form_selectable_cell(filter_value($template['name'], get_request_var('filter'), 'aggregate_templates.php?action=edit&id=' . $template['id'] . '&page=1'), $template['id']); form_selectable_cell($disabled ? __('No'):__('Yes'), $template['id'], '', 'right'); form_selectable_cell('' . number_format_i18n($template['graphs'], '-1') . '', $template['id'], '', 'right'); form_selectable_cell(filter_value($template['graph_template_name'], get_request_var('filter')), $template['id']); form_checkbox_cell($template['graph_template_name'], $template['id'], $disabled); form_end_row(); } } else { print "" . __('No Aggregate Templates Found') . "\n"; } html_end_box(false); if (cacti_sizeof($template_list)) { /* put the nav bar on the bottom as well */ print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($aggregate_actions); form_end(); ?> $error"; break; } // Check user password history if (!secpass_check_history($user_id, $password)) { $bad_password = true; $errorMessage = "" . __('You cannot use a previously entered password!') . ""; break; } // Password and Confirmed password checks if ($password !== $password_confirm) { $bad_password = true; $errorMessage = "" . __('Your new passwords do not match, please retype.') . ""; break; } // Compare current password with stored password if ((!empty($user['password']) || !empty($current_password)) && !compat_password_verify($current_password, $user['password'])) { $bad_password = true; $errorMessage = "" . __('Your current password is not correct. Please try again.') . ""; break; } // Check new password does not match stored password if (compat_password_verify($password, $user['password'])) { $bad_password = true; $errorMessage = "" . __('Your new password cannot be the same as the old password. Please try again.') . ""; break; } // If password isn't blank, password change is good to go if ($password != '') { if (read_config_option('secpass_expirepass') > 0) { db_execute_prepared("UPDATE user_auth SET lastchange = ? WHERE id = ? AND realm = 0 AND enabled = 'on'", array(time(), $user_id)); } $history = intval(read_config_option('secpass_history')); if ($history > 0) { $h = db_fetch_row_prepared("SELECT password, password_history FROM user_auth WHERE id = ? AND realm = 0 AND enabled = 'on'", array($user_id)); $op = $h['password']; $h = explode('|', $h['password_history']); while (cacti_count($h) > $history - 1) { array_shift($h); } $h[] = $op; $h = implode('|', $h); db_execute_prepared("UPDATE user_auth SET password_history = ? WHERE id = ? AND realm = 0 AND enabled = 'on'", array($h, $user_id)); } db_execute_prepared('INSERT IGNORE INTO user_log (username, result, time, ip) VALUES (?, 3, NOW(), ?)', array($user['username'], get_client_addr())); db_check_password_length(); db_execute_prepared("UPDATE user_auth SET must_change_password = '', password = ? WHERE id = ?", array(compat_password_hash($password,PASSWORD_DEFAULT), $user_id)); // Clear the auth cache for the user $token = ''; if (isset($_SERVER['HTTP_COOKIE']) && strpos($_SERVER['HTTP_COOKIE'], 'cacti_remembers') !== false) { $parts = explode(';', $_SERVER['HTTP_COOKIE']); foreach($parts as $p) { if (strpos($p, 'cacti_remembers') !== false) { $pparts = explode('%2C', $p); if (isset($pparts[1])) { $token = $pparts[1]; break; } } } } if ($token != '') { $sql_where = 'AND token != ' . db_qstr(hash('sha512', $token, false)); } else { $sql_where = ''; } db_execute_prepared("DELETE FROM user_auth_cache WHERE user_id = ? $sql_where", array($_SESSION['sess_user_id'])); kill_session_var('sess_change_password'); raise_message('password_success'); /* ok, at the point the user has been successfully authenticated; so we must decide what to do next */ /* if no console permissions show graphs otherwise, pay attention to user setting */ $realm_id = $user_auth_realm_filenames['index.php']; $has_console = db_fetch_cell_prepared('SELECT realm_id FROM user_auth_realm WHERE user_id = ? AND realm_id = ?', array($user_id, $realm_id)); if (basename(get_nfilter_request_var('ref')) == 'auth_changepassword.php' || basename(get_nfilter_request_var('ref')) == '') { if ($has_console) { set_request_var('ref', 'index.php'); } else { set_request_var('ref', 'graph_view.php'); } } if (!empty($has_console)) { switch ($user['login_opts']) { case '1': /* referer */ header('Location: ' . sanitize_uri(get_nfilter_request_var('ref'))); break; case '2': /* default console page */ header('Location: index.php'); break; case '3': /* default graph page */ header('Location: graph_view.php'); break; default: api_plugin_hook_function('login_options_navigate', $user['login_opts']); } } else { header('Location: graph_view.php'); } exit; } else { $bad_password = true; } break; } if (api_plugin_hook_function('custom_password', OPER_MODE_NATIVE) == OPER_MODE_RESKIN) { exit; } if (get_request_var('action') == 'force') { $errorMessage = "*** " . __('Forced password change') . " ***"; } /* Create tooltip for password complexity */ $secpass_tooltip = "" . __('Password requirements include:') . "
    "; $secpass_body = ''; if (read_config_option('secpass_minlen') > 0) { $secpass_body .= __('Must be at least %d characters in length', read_config_option('secpass_minlen')); } if (read_config_option('secpass_reqmixcase') == 'on') { $secpass_body .= ($secpass_body != '' ? '
    ':'') . __('Must include mixed case'); } if (read_config_option('secpass_reqnum') == 'on') { $secpass_body .= ($secpass_body != '' ? '
    ':'') . __('Must include at least 1 number'); } if (read_config_option('secpass_reqspec') == 'on') { $secpass_body .= ($secpass_body != '' ? '
    ':'') . __('Must include at least 1 special character'); } if (read_config_option('secpass_history') != '0') { $secpass_body .= ($secpass_body != '' ? '
    ':'') . __('Cannot be reused for %d password changes', read_config_option('secpass_history')+1); } $secpass_tooltip .= $secpass_body; $selectedTheme = get_selected_theme(); if (isset_request_var('ref')) { $ref_parts = parse_url(get_nfilter_request_var('ref')); $valid = true; if (isset($ref_parts['user']) || isset($ref_parts['pass'])) { $valid = false; } elseif (!isset($ref_parts['host'])) { $value = true; } elseif (isset($ref_parts['host'])) { $server_addr = $_SERVER['SERVER_ADDR']; if (!filter_var($_SERVER['SERVER_NAME'], FILTER_VALIDATE_IP)) { $server_info = dns_get_record($_SERVER['SERVER_NAME'], DNS_ANY); $server_ref = gethostbyname($ref_parts['host']); if ($server_ref != $server_addr) { $valid = false; } if (!$valid && sizeof($server_info)) { foreach($server_info as $record) { if (isset($record['host']) && $record['host'] == $server_ref) { $valid = true; break; } elseif (isset($record['target']) && $record['target'] == $server_ref) { $valid = true; break; } elseif (isset($record['id']) && $record['ip'] == $server_addr) { $valid = true; break; } } } } else { $server_ip = gethostbyname($_SERVER['SERVER_NAME']); $server_ref = gethostbyname($ref_parts['host']); if ($server_ip == $server_ref) { $valid = true; } } } else { $valid = false; } if (!$valid) { cacti_log('WARNING: User attempted to access Cacti from unkonwn URL', false, 'AUTH'); raise_message('problems_with_page', __('There are problems with the Change Password page. Contact your Cacti administrator right away.'), MESSAGE_LEVEL_ERROR); header('Location:index.php'); exit; } } ?>
    '> '>
    Cacti password.'); } else { $title_message = __('Please enter your new Cacti password.'); } ?>

    '> ":"";?>
    \n"; cacti-release-1.2.26/auth_login.php000066400000000000000000000355531454067461500171740ustar00rootroot00000000000000 2 && $frv_realm <= 1) { // User picked 'local' from dropdown; $auth_method = 1; } else { $auth_method = read_config_option('auth_method'); } // Compensate as the dropdown for LDAP is off by one if ($frv_realm == 2) { $realm = 3; } elseif ($auth_method == 2) { $realm = $auth_method; } else { $realm = $frv_realm; } cacti_log("DEBUG: User '" . $username . "' attempting to login with realm ". $frv_realm . ", using method " . $auth_method, false, 'AUTH', POLLER_VERBOSITY_DEBUG); switch ($auth_method) { case '0': // No authentication, should not be reachable $error = true; $error_msg = __esc('Cacti no longer supports No Authentication mode. Please contact your System Administrator.'); cacti_log("FATAL: No authentication attempted and not supported.", false, 'AUTH'); auth_display_custom_error_message($error_msg); exit; break; case '1': // Local authentication cacti_log("DEBUG: Local User '" . $username . "' to attempt login.", false, 'AUTH', POLLER_VERBOSITY_DEBUG); $user = local_auth_login_process($username); break; case '2': // Basic authentication cacti_log("DEBUG: Basic Auth User '" . $username . "' attempting to login.", false, 'AUTH', POLLER_VERBOSITY_DEBUG); $user = basic_auth_login_process($username); break; case '3': // LDAP Authentication cacti_log("DEBUG: LDAP User '" . $username . "' to attempt login.", false, 'AUTH', POLLER_VERBOSITY_DEBUG); $user = ldap_login_process($username); break; case '4': // LDAP Domains login cacti_log("DEBUG: Domains User '" . $username . "' to attempt login.", false, 'AUTH', POLLER_VERBOSITY_DEBUG); $user = domains_login_process($username); break; default: // Login Realm not determined $error = true; $error_msg = __esc('Unable to determine user Login Realm or Domain. Please contact your System Administrator.'); cacti_log("LOGIN FAILED: User '" . $username . "' Unable to determine Login Realm. Exiting.", false, 'AUTH'); auth_display_custom_error_message($error_msg); exit; break; } /* Create user from template if available */ if (!$error && !cacti_sizeof($user) && get_template_account($username) > 0 && $username != '') { $user = auth_login_create_user_from_template($username, $realm); } /* Guest account checking - Not for builtin */ if (!$error && !cacti_sizeof($user) && get_guest_account() > 0) { /* Locate guest user record */ $user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', array(get_guest_account())); if ($user) { cacti_log("LOGIN: Authenticated user '" . $username . "' using guest account '" . $user['username'] . "'", false, 'AUTH'); if ($username != '' && get_template_account($username) == 0) { raise_message('template_disabled', __('User was Authenticated, but the Template Account is disabled. Using Guest Account'), MESSAGE_LEVEL_WARN); } $guest_user = true; } else { /* error */ $error = true; $error_msg = __('Access Denied! Guest user id %s does not exist. Please contact your Administrator.', read_config_option('guest_user')); cacti_log("LOGIN FAILED: Unable to locate guest user '" . read_config_option('guest_user') . "'", false, 'AUTH'); if ($auth_method == 2) { auth_display_custom_error_message($error_msg); exit; } } } /* We have a valid user, do final checks, log their login attempt, and redirect as required */ if (!$error && cacti_sizeof($user)) { if (!$guest_user) { cacti_log("LOGIN: User '" . $user['username'] . "' authenticated", false, 'AUTH'); } else { cacti_log("LOGIN: Guest User '" . $user['username'] . "' in use", false, 'AUTH'); } $client_addr = get_client_addr(); db_execute_prepared('INSERT IGNORE INTO user_log (username, user_id, result, ip, time) VALUES (?, ?, 1, ?, NOW())', array($username, $user['id'], $client_addr)); /* check if the user account is enabled with the exception of guest users */ $user_enabled = true; if (!$guest_user && isset($user['enabled'])) { $user_enabled = ($user['enabled'] == 'on' ? true:false); } /* check if the user is enabled */ if (!$user_enabled) { $error = true; $error_msg = __('Access Denied! User account disabled.'); if ($auth_method == 2) { auth_display_custom_error_message($error_msg); exit; } } if (!$error && !auth_user_has_access($user)) { /* error */ $error = true; $error_msg = __('You do not have access to any area of Cacti. Contact your administrator.'); cacti_log(sprintf("LOGIN FAILED: User %s with id %s does not have access to any area of Cacti.", $user['username'], $user['id']), false, 'AUTH'); if ($auth_method == 2) { auth_display_custom_error_message($error_msg); exit; } } /* remember me support. Not for guest of basic auth */ if ($auth_method != 2 && $user['id'] !== get_guest_account()) { if (!$error && isset_request_var('remember_me') && read_config_option('auth_cache_enabled') == 'on') { set_auth_cookie($user); } } if (!$error) { /* set the php session */ $_SESSION['sess_user_id'] = $user['id']; /* handle 'force change password' */ if ($user['must_change_password'] == 'on' && $auth_method == 1 && $user['password_change'] == 'on') { $_SESSION['sess_change_password'] = true; } if (db_table_exists('user_auth_group')) { $group_options = db_fetch_cell_prepared('SELECT MAX(login_opts) FROM user_auth_group AS uag INNER JOIN user_auth_group_members AS uagm ON uag.id=uagm.group_id WHERE user_id = ? AND login_opts != 4', array($_SESSION['sess_user_id'])); if (!empty($group_options)) { $user['login_opts'] = $group_options; } } if (user_setting_exists('user_language', $_SESSION['sess_user_id'])) { $_SESSION['sess_user_language'] = read_user_setting('user_language'); } cacti_log("DEBUG: User '" . $username . "' about to re-direct to preferred login page", false, 'AUTH', POLLER_VERBOSITY_DEBUG); auth_login_redirect($user['login_opts']); } } else { $id = db_fetch_cell_prepared('SELECT id FROM user_auth WHERE username = ? AND realm = ?', array($username, $frv_realm)); switch($frv_realm) { case '0': case '1': $realm_name = 'Local'; break; case '2': $realm_name = 'LDAP'; break; default: $realm_name = 'Domains LDAP'; break; } /* BAD username/password builtin and LDAP */ db_execute_prepared('INSERT IGNORE INTO user_log (username, user_id, result, ip, time) VALUES (?, ?, 0, ?, NOW())', array($username, !empty($id) ? $id:0, get_client_addr())); cacti_log('LOGIN FAILED: ' . $realm_name . " Login Failed for user '" . $username . "' from IP Address '" . get_client_addr() . "'.", false, 'AUTH'); } } if (api_plugin_hook_function('custom_login', OPER_MODE_NATIVE) == OPER_MODE_RESKIN) { return; } $selectedTheme = get_selected_theme(); ?>
    $error, 'error_msg' => $error_msg, 'username' => $username, 'user_enabled' => $user_enabled, 'action' => get_nfilter_request_var('action') ) ); ?>

    array( 'name' => __('Local'), 'selected' => false ), '2' => array( 'name' => __('LDAP'), 'selected' => true ) ) ); } else { $realms = get_auth_realms(true); } // try and remember previously selected realm if ($frv_realm && array_key_exists($frv_realm, $realms)) { foreach ($realms as $key => $realm) { $realms[$key]['selected'] = ($frv_realm == $key); } } ?>
    '>
    >
    '>
    cacti-release-1.2.26/auth_profile.php000066400000000000000000000453311454067461500175170ustar00rootroot00000000000000 array('regexp' => '/^([a-z_A-Z]+)$/'))); /* ==================================================== */ /* present a tabbed interface */ $tabs = array( 'general' => array( 'display' => __('General'), 'url' => $config['url_path'] . 'auth_profile.php?tab=general&header=false' ) ); $tabs = api_plugin_hook_function('auth_profile_tabs', $tabs); /* set the default tab */ load_current_session_value('tab', 'sess_profile_tabs', 'general'); $current_tab = get_nfilter_request_var('tab'); if (cacti_sizeof($tabs) > 1) { $i = 0; /* draw the tabs */ print "
    \n"; } if ($current_tab == 'general') { settings(); settings_javascript(); } else { api_plugin_hook_function('auth_profile_run_action', get_request_var('tab')); } bottom_footer(); break; } /* -------------------------- The Save Function -------------------------- */ function api_auth_logout_everywhere() { $user = $_SESSION['sess_user_id']; if (!empty($user)) { db_execute_prepared('DELETE FROM user_auth_cache WHERE user_id = ?', array($user)); } } function api_auth_clear_user_settings() { $user = $_SESSION['sess_user_id']; if (!empty($user)) { if (isset_request_var('tab') && get_nfilter_request_var('tab') == 'general') { db_execute_prepared('DELETE FROM settings_user WHERE user_id = ?', array($user)); kill_session_var('sess_user_config_array'); } elseif (isset_request_var('tab')) { api_plugin_hook('auth_profile_reset'); } raise_message('37'); } } function api_auth_clear_user_setting($name) { global $settings_user; $user = $_SESSION['sess_user_id']; if (read_config_option('client_timezone_support') == '0') { unset($settings_user['client_timezone_support']); } if (!empty($user)) { if (isset_request_var('tab') && get_nfilter_request_var('tab') == 'general') { db_execute_prepared('DELETE FROM settings_user WHERE user_id = ? AND name = ?', array($user, $name)); foreach($settings_user as $tab => $settings) { if (isset($settings[$name])) { if (isset($settings[$name]['default'])) { db_execute_prepared('INSERT INTO settings_user (name, value, user_id) VALUES (?, ?, ?)', array($name, $settings[$name]['default'], $user)); print $settings[$name]['default']; kill_session_var('sess_user_config_array'); break; } } } } else { api_plugin_hook_function('auth_profile_reset_value', $name); } } } function api_auth_update_user_setting($name, $value) { global $settings_user; $user = $_SESSION['sess_user_id']; if (!empty($user)) { if ($name == 'full_name' || $name == 'email_address') { db_execute_prepared("UPDATE user_auth SET $name = ? WHERE id = ?", array($value, $user)); } else { foreach($settings_user as $tab => $settings) { if (isset($settings[$name])) { db_execute_prepared('REPLACE INTO settings_user (name, value, user_id) VALUES (?, ?, ?)', array($name, $value, $user)); kill_session_var('sess_user_config_array'); kill_session_var('selected_theme'); kill_session_var('sess_user_language'); break; } } } } } function form_save() { global $settings_user; // Save the users profile information if (isset_request_var('full_name') && isset_request_var('email_address') && isset($_SESSION['sess_user_id'])) { db_execute_prepared("UPDATE user_auth SET full_name = ?, email_address = ? WHERE id = ?", array( get_nfilter_request_var('full_name'), get_nfilter_request_var('email_address'), $_SESSION['sess_user_id'] ) ); } $errors = array(); // Save the users graph settings if they have permission if (is_view_allowed('graph_settings') == true && isset_request_var('tab') && get_nfilter_request_var('tab') == 'general') { save_user_settings($_SESSION['sess_user_id']); } elseif (isset_request_var('tab')) { api_plugin_hook('auth_profile_save'); } if (cacti_sizeof($errors) == 0) { raise_message(1); } else { raise_message(35); foreach($errors as $error) { raise_message($error); } } /* reset local settings cache so the user sees the new settings */ kill_session_var('sess_user_language'); kill_session_var('sess_user_config_array'); kill_session_var('selected_theme'); } /* -------------------------- User Settings Functions -------------------------- */ function settings() { global $tabs_graphs, $settings_user, $current_user, $graph_views, $current_user; /* you cannot have per-user graph settings if cacti's user management is not turned on */ if (read_config_option('auth_method') == 0) { raise_message(6); return; } if (isset($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; if (strpos($referer, 'auth_profile.php') === false) { $timespan_sel_pos = strpos($referer, '&predefined_timespan'); if ($timespan_sel_pos) { $referer = substr($referer, 0, $timespan_sel_pos); } $_SESSION['profile_referer'] = $referer; } } elseif (!isset($_SESSION['profile_referer'])) { $_SESSION['profile_referer'] = 'graph_view.php'; } form_start('auth_profile.php', 'chk'); html_start_box(__('User Account Details'), '100%', true, '3', 'center', ''); $current_user = db_fetch_row_prepared('SELECT * FROM user_auth WHERE id = ?', array($_SESSION['sess_user_id'])); if (!cacti_sizeof($current_user)) { return; } // Set the graph views the user has permission to unset($graph_views); if (is_view_allowed('show_tree')) { $graph_views[1] = __('Tree View'); } if (is_view_allowed('show_list')) { $graph_views[2] = __('List View'); } if (is_view_allowed('show_preview')) { $graph_views[2] = __('Preview View'); } if (cacti_sizeof($graph_views)) { $settings_user['general']['default_view_mode']['array'] = $graph_views; } else { unset($settings_user['general']['default_view_mode']); } /* file: user_admin.php, action: user_edit (host) */ $fields_user = array( 'username' => array( 'method' => 'value', 'friendly_name' => __('User Name'), 'description' => __('The login name for this user.'), 'value' => '|arg1:username|', 'max_length' => '40', 'size' => '40' ), 'full_name' => array( 'method' => 'textbox', 'friendly_name' => __('Full Name'), 'description' => __('A more descriptive name for this user, that can include spaces or special characters.'), 'value' => '|arg1:full_name|', 'max_length' => '120', 'size' => '60' ), 'email_address' => array( 'method' => 'textbox', 'friendly_name' => __('Email Address'), 'description' => __('An Email Address you be reached at.'), 'value' => '|arg1:email_address|', 'max_length' => '60', 'size' => '60' ), 'clear_settings' => array( 'method' => 'button', 'friendly_name' => __('Clear User Settings'), 'description' => __('Return all User Settings to Default values.'), 'value' => __('Clear User Settings'), 'on_click' => 'clearUserSettings()' ), 'private_data' => array( 'method' => 'button', 'friendly_name' => __('Clear Private Data'), 'description' => __('Clear Private Data including Column sizing.'), 'value' => __('Clear Private Data'), 'on_click' => 'clearPrivateData()' ) ); if (read_config_option('auth_cache_enabled') == 'on') { $fields_user += array( 'logout_everywhere' => array( 'method' => 'button', 'friendly_name' => __('Logout Everywhere'), 'description' => __('Clear all your Login Session Tokens.'), 'value' => __('Logout Everywhere'), 'on_click' => 'logoutEverywhere()' ) ); } draw_edit_form( array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($fields_user, (isset($current_user) ? $current_user : array())) ) ); html_end_box(true, true); if (is_view_allowed('graph_settings') == true) { if (read_config_option('auth_method') != 0) { $settings_user['tree']['default_tree_id']['sql'] = get_allowed_trees(false, true); } html_start_box(__('User Settings'), '100%', true, '3', 'center', ''); foreach ($settings_user as $tab_short_name => $tab_fields) { $collapsible = true; print "
    " . $tabs_graphs[$tab_short_name] . ($collapsible ? "
    ":"") . "
    \n"; $form_array = array(); foreach ($tab_fields as $field_name => $field_array) { $form_array += array($field_name => $tab_fields[$field_name]); if ((isset($field_array['items'])) && (is_array($field_array['items']))) { foreach ($field_array['items'] as $sub_field_name => $sub_field_array) { if (graph_config_value_exists($sub_field_name, $_SESSION['sess_user_id'])) { $form_array[$field_name]['items'][$sub_field_name]['form_id'] = 1; } $form_array[$field_name]['items'][$sub_field_name]['value'] = db_fetch_cell_prepared('SELECT value FROM settings_user WHERE name = ? AND user_id = ?', array($sub_field_name, $_SESSION['sess_user_id'])); } } else { if (graph_config_value_exists($field_name, $_SESSION['sess_user_id'])) { $form_array[$field_name]['form_id'] = 1; } $user_row = db_fetch_row_prepared('SELECT value FROM settings_user WHERE name = ? AND user_id = ?', array($field_name, $_SESSION['sess_user_id'])); if (cacti_sizeof($user_row)) { $form_array[$field_name]['user_set'] = true; $form_array[$field_name]['value'] = $user_row['value']; } else { $form_array[$field_name]['user_set'] = false; $form_array[$field_name]['value'] = null; } } } draw_edit_form( array( 'config' => array( 'no_form_tag' => true ), 'fields' => $form_array ) ); } print "\n"; html_end_box(true, true); } form_hidden_box('save_component_graph_config','1',''); form_save_buttons(array(array('id' => 'return', 'value' => __esc('Return')))); form_end(); } function settings_javascript() { global $config; ?> __('Add Device'), 2 => __('Delete Device') ); $os_arr = array_rekey(db_fetch_assoc('SELECT DISTINCT os FROM automation_devices WHERE os IS NOT NULL AND os!=""'), 'os', 'os'); $status_arr = array( __('Down'), __('Up') ); $networks = array_rekey(db_fetch_assoc('SELECT an.id, an.name FROM automation_networks AS an INNER JOIN automation_devices AS ad ON an.id=ad.network_id ORDER BY name'), 'id', 'name'); set_default_action(); process_request_vars(); switch(get_request_var('action')) { case 'purge': purge_discovery_results(); break; case 'actions': form_actions(); break; case 'export': export_discovery_results(); break; default: display_discovery_page(); break; } function form_actions() { global $device_actions, $availability_options; /* ================= input validation ================= */ get_filter_request_var('drp_action', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-zA-Z0-9_]+)$/'))); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* add to cacti */ $i = 0; foreach($selected_items as $id) { $d = db_fetch_row_prepared('SELECT * FROM automation_devices WHERE id = ?', array($id)); $d['poller_id'] = get_filter_request_var('poller_id'); $d['host_template'] = get_filter_request_var('host_template'); $d['availability_method'] = get_filter_request_var('availability_method'); $d['notes'] = __('Added manually through device automation interface.'); $d['snmp_sysName'] = $d['sysName']; // pull ping options from network_id $n = db_fetch_row_prepared('SELECT * FROM automation_networks WHERE id = ?', array($d['network_id'])); if (cacti_sizeof($n)) { $d['ping_method'] = $n['ping_method']; $d['ping_port'] = $n['ping_port']; $d['ping_timeout'] = $n['ping_timeout']; $d['ping_retries'] = $n['ping_retries']; } $host_id = automation_add_device($d, true); $description = (trim($d['hostname']) != '' ? $d['hostname'] : $d['ip']); if ($host_id) { raise_message('automation_msg_' . $i, __esc('Device %s Added to Cacti', $description), MESSAGE_LEVEL_INFO); } else { raise_message('automation_msg_' . $i, __esc('Device %s Not Added to Cacti', $description), MESSAGE_LEVEL_ERROR); } $i++; } } elseif (get_nfilter_request_var('drp_action') == 2) { /* remove device */ foreach($selected_items as $id) { db_execute_prepared('DELETE FROM automation_devices WHERE id = ?', array($id)); } raise_message('automation_remove', __('Devices Removed from Cacti Automation database'), MESSAGE_LEVEL_INFO); } } header('Location: automation_devices.php?header=false'); exit; } /* setup some variables */ $device_list = ''; $device_array = array(); $i = 0; /* loop through each of the graphs selected on the previous page and get more info about them */ foreach ($_POST as $var => $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $device_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT CONCAT(IF(hostname!="", hostname, "unknown"), " (", ip, ")") FROM automation_devices WHERE id = ?', array($matches[1]))) . '
  • '; $device_array[$i] = $matches[1]; $i++; } } top_header(); form_start('automation_devices.php', 'chk'); html_start_box($device_actions[get_request_var('drp_action')], '60%', '', '3', 'center', ''); $available_host_templates = db_fetch_assoc_prepared('SELECT id, name FROM host_template ORDER BY name'); if (isset($device_array) && cacti_sizeof($device_array)) { if (get_request_var('drp_action') == '1') { /* add */ $pollers = db_fetch_assoc_prepared('SELECT id, name FROM poller ORDER BY name'); $availability_method = 0; $host_template = 0; $devices = db_fetch_assoc('SELECT id, sysName, sysDescr FROM automation_devices WHERE id IN (' . implode(',', $device_array) . ')'); foreach ($devices as $device) { $os = automation_find_os($device['sysDescr'], '', $device['sysName']); if (isset($os['host_template']) && $os['host_template'] > 0) { if ($host_template == 0) { $host_template = $os['host_template']; $availability_method = $os['availability_method']; } else if ($host_template != $os['host_template']) { // End up here if we have 2 devices with different Host Template matches $host_template = 0; $availability_method = 0; break; } } else { // Couldn't determine the Host Template for a device, so abort and don't set a default $host_template = 0; $availability_method = 0; break; } } print "

    " . __('Click \'Continue\' to add the following Discovered device(s).') . "

      $device_list
    "; print "
    " . __('Pollers') . ""; form_dropdown('poller_id', $pollers, 'name', 'id', '', '', ''); print "
    " . __('Select Template') . ""; form_dropdown('host_template', $available_host_templates, 'name', 'id', '', '', $host_template); print "
    " . __('Availability Method') . ""; form_dropdown('availability_method', $availability_options, '', '', '', '', $availability_method); print "
    "; $save_html = " "; } elseif (get_request_var('drp_action') == '2') { /* remove */ print "

    " . __('Click \'Continue\' to Delete the following Discovered device(s).') . "

      $device_list
    "; $save_html = " "; } } else { raise_message(40); header('Location: automation_devices.php?header=false'); exit; } print " $save_html "; html_end_box(); form_end(); bottom_footer(); } function display_discovery_page() { global $item_rows, $os_arr, $status_arr, $networks, $device_actions; top_header(); draw_filter(); $total_rows = 0; if (get_request_var('rows') == '-1') { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } $results = get_discovery_results($total_rows, $rows); /* generate page list */ $nav = html_nav_bar('automation_devices.php', MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 12, __('Devices'), 'page', 'main'); form_start('automation_devices.php', 'chk'); print $nav; html_start_box('', '100%', '', '3', 'center', ''); $display_text = array( 'hostname' => array('display' => __('Device Name'), 'align' => 'left', 'sort' => 'ASC'), 'ip' => array('display' => __('IP'), 'align' => 'left', 'sort' => 'ASC'), 'sysName' => array('display' => __('SNMP Name'), 'align' => 'left', 'sort' => 'ASC'), 'sysLocation' => array('display' => __('Location'), 'align' => 'left', 'sort' => 'ASC'), 'sysContact' => array('display' => __('Contact'), 'align' => 'left', 'sort' => 'ASC'), 'sysDescr' => array('display' => __('Description'), 'align' => 'left', 'sort' => 'ASC'), 'os' => array('display' => __('OS'), 'align' => 'left', 'sort' => 'ASC'), 'time' => array('display' => __('Uptime'), 'align' => 'right', 'sort' => 'DESC'), 'snmp' => array('display' => __('SNMP'), 'align' => 'right', 'sort' => 'DESC'), 'up' => array('display' => __('Status'), 'align' => 'right', 'sort' => 'ASC'), 'mytime' => array('display' => __('Last Check'), 'align' => 'right', 'sort' => 'DESC')); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); $snmp_version = read_config_option('snmp_version'); $snmp_port = read_config_option('snmp_port'); $snmp_timeout = read_config_option('snmp_timeout'); $snmp_username = read_config_option('snmp_username'); $snmp_password = read_config_option('snmp_password'); $max_oids = read_config_option('max_get_size'); $ping_method = read_config_option('ping_method'); $availability_method = read_config_option('availability_method'); $status = array("" . __('Down') . '',"" . __('Up') . ''); if (cacti_sizeof($results)) { foreach($results as $host) { form_alternate_row('line' . base64_encode($host['ip']), true); if ($host['hostname'] == '') { $host['hostname'] = __('Not Detected'); } form_selectable_cell(filter_value($host['hostname'], get_request_var('filter')), $host['id']); form_selectable_cell(filter_value($host['ip'], get_request_var('filter')), $host['id']); form_selectable_cell(filter_value(snmp_data($host['sysName']), get_request_var('filter')), $host['id'], '', 'text-align:left'); form_selectable_cell(filter_value(snmp_data($host['sysLocation']), get_request_var('filter')), $host['id'], '', 'text-align:left'); form_selectable_cell(filter_value(snmp_data($host['sysContact']), get_request_var('filter')), $host['id'], '', 'text-align:left'); form_selectable_cell(filter_value(snmp_data($host['sysDescr']), get_request_var('filter')), $host['id'], '', 'text-align:left;white-space:normal;'); form_selectable_cell(filter_value(snmp_data($host['os']), get_request_var('filter')), $host['id'], '', 'text-align:left'); form_selectable_cell(snmp_data(get_uptime($host)), $host['id'], '', 'text-align:right'); form_selectable_cell($status[$host['snmp']], $host['id'], '', 'text-align:right'); form_selectable_cell($status[$host['up']], $host['id'], '', 'text-align:right'); form_selectable_cell(substr($host['mytime'],0,16), $host['id'], '', 'text-align:right'); form_checkbox_cell($host['ip'], $host['id']); form_end_row(); } } else { print "" . __('No Devices Found') . ""; } html_end_box(false); if (cacti_sizeof($results)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($device_actions); form_end(); bottom_footer(); } function process_request_vars() { /* ================= input validation and session storage ================= */ $filters = array( 'rows' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'hostname', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'status' => array( 'filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string') ), 'network' => array( 'filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string') ), 'snmp' => array( 'filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string') ), 'os' => array( 'filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string') ) ); validate_store_request_vars($filters, 'sess_autom'); /* ================= input validation ================= */ } function get_discovery_results(&$total_rows = 0, $rows = 0, $export = false) { global $os_arr, $status_arr, $networks, $device_actions; $sql_where = ''; $status = get_request_var('status'); $network = get_request_var('network'); $snmp = get_request_var('snmp'); $os = get_request_var('os'); $filter = get_request_var('filter'); if ($status == __('Down')) { $sql_where .= 'WHERE up=0'; } else if ($status == __('Up')) { $sql_where .= 'WHERE up=1'; } if ($network > 0) { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'network_id=' . $network; } if ($snmp == __('Down')) { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'snmp=0'; } else if ($snmp == __('Up')) { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'snmp=1'; } if ($os != '-1' && in_array($os, $os_arr)) { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . "os='$os'"; } if ($filter != '') { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . '(hostname LIKE ' . db_qstr('%' . $filter . '%') . ' OR ip LIKE ' . db_qstr('%' . $filter . '%') . ' OR sysName LIKE ' . db_qstr('%' . $filter . '%') . ' OR sysDescr LIKE ' . db_qstr('%' . $filter . '%') . ' OR sysLocation LIKE ' . db_qstr('%' . $filter . '%') . ' OR sysContact LIKE ' . db_qstr('%' . $filter . '%') . ' )'; } if ($export) { return db_fetch_assoc("SELECT * FROM automation_devices $sql_where ORDER BY INET_ATON(ip)"); } else { $total_rows = db_fetch_cell("SELECT COUNT(*) FROM automation_devices $sql_where"); $page = get_request_var('page'); $sql_order = get_order_string(); $sql_limit = ' LIMIT ' . ($rows*($page-1)) . ',' . $rows; $sql_query = "SELECT *,sysUptime snmp_sysUpTimeInstance, FROM_UNIXTIME(time) AS mytime FROM automation_devices $sql_where $sql_order $sql_limit"; return db_fetch_assoc($sql_query); } } function draw_filter() { global $item_rows, $os_arr, $status_arr, $networks, $device_actions; html_start_box(__('Discovery Filters'), '100%', '', '3', 'center', ''); ?>
    '> ' title=''> ' title=''> ' title=''> ' title=''>
    $r) { $host['$h'] = str_replace(',','',$r); } print ($host['hostname'] == '' ? __('Not Detected'):$host['hostname']) . ','; print $host['ip'] . ','; print export_data($host['sysName']) . ','; print export_data($host['sysLocation']) . ','; print export_data($host['sysContact']) . ','; print export_data($host['sysDescr']) . ','; print export_data($host['os']) . ','; print export_data($uptime) . ','; print ($host['snmp'] == 1 ? __('Up'):__('Down')) . ','; print ($host['up'] == 1 ? __('Up'):__('Down')) . "\n"; } } } function purge_discovery_results() { get_filter_request_var('network'); if (get_request_var('network') > 0) { db_execute_prepared('DELETE FROM automation_devices WHERE network_id = ?', array(get_request_var('network'))); } else { db_execute('TRUNCATE TABLE automation_devices'); } header('Location: automation_devices.php?header=false'); exit; } function snmp_data($item) { if ($item == '') { return __('N/A'); } else { return html_escape(str_replace(':',' ', $item)); } } function export_data($item) { if ($item == '') { return 'N/A'; } else { return $item; } } cacti-release-1.2.26/automation_graph_rules.php000066400000000000000000001076061454067461500216150ustar00rootroot00000000000000 __('Duplicate'), AUTOMATION_ACTION_GRAPH_ENABLE => __('Enable'), AUTOMATION_ACTION_GRAPH_DISABLE => __('Disable'), AUTOMATION_ACTION_GRAPH_DELETE => __('Delete'), ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': save(); break; case 'actions': automation_graph_rules_form_actions(); break; case 'item_movedown': automation_graph_rules_item_movedown(); header('Location: automation_graph_rules.php?action=edit&id=' . get_filter_request_var('id')); break; case 'item_moveup': automation_graph_rules_item_moveup(); header('Location: automation_graph_rules.php?action=edit&id=' . get_filter_request_var('id')); break; case 'item_remove': automation_graph_rules_item_remove(); header('Location: automation_graph_rules.php?action=edit&id=' . get_filter_request_var('id')); break; case 'item_edit': top_header(); automation_graph_rules_item_edit(); bottom_footer(); break; case 'qedit': automation_change_query_type(); header('Location: automation_graph_rules.php?header=false&action=edit&name=' . get_request_var('name') . '&id=' . get_filter_request_var('id') . '&snmp_query_id=' . get_request_var('snmp_query_id')); break; case 'remove': automation_graph_rules_remove(); header ('Location: automation_graph_rules.php'); break; case 'edit': top_header(); automation_graph_rules_edit(); bottom_footer(); break; default: top_header(); automation_graph_rules(); bottom_footer(); break; } /* -------------------------- The Save Function -------------------------- */ function save() { if (isset_request_var('save_component_automation_graph_rule')) { /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ $save['id'] = get_nfilter_request_var('id'); $save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3); $save['snmp_query_id'] = form_input_validate(get_nfilter_request_var('snmp_query_id'), 'snmp_query_id', '^[0-9]+$', false, 3); $save['graph_type_id'] = (isset_request_var('graph_type_id')) ? form_input_validate(get_nfilter_request_var('graph_type_id'), 'graph_type_id', '^[0-9]+$', false, 3) : 0; $save['enabled'] = (isset_request_var('enabled') ? 'on' : ''); if (!is_error_message()) { $rule_id = sql_save($save, 'automation_graph_rules'); if ($rule_id) { raise_message(1); } else { raise_message(2); } } header('Location: automation_graph_rules.php?header=false&action=edit&id=' . (empty($rule_id) ? get_nfilter_request_var('id') : $rule_id)); } elseif (isset_request_var('save_component_automation_graph_rule_item')) { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); /* ==================================================== */ $save = array(); $save['id'] = form_input_validate(get_request_var('item_id'), 'item_id', '^[0-9]+$', false, 3); $save['rule_id'] = form_input_validate(get_request_var('id'), 'id', '^[0-9]+$', false, 3); $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); $save['operation'] = form_input_validate(get_nfilter_request_var('operation'), 'operation', '^[-0-9]+$', true, 3); $save['field'] = form_input_validate(((isset_request_var('field') && get_nfilter_request_var('field') != '0') ? get_nfilter_request_var('field') : ''), 'field', '', true, 3); $save['operator'] = form_input_validate((isset_request_var('operator') ? get_nfilter_request_var('operator') : ''), 'operator', '^[0-9]+$', true, 3); $save['pattern'] = form_input_validate((isset_request_var('pattern') ? get_nfilter_request_var('pattern') : ''), 'pattern', '', true, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_graph_rule_items'); if ($item_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message()) { header('Location: automation_graph_rules.php?header=false&action=item_edit&id=' . get_request_var('id') . '&item_id=' . (empty($item_id) ? get_request_var('item_id') : $item_id) . '&rule_type=' . AUTOMATION_RULE_TYPE_GRAPH_ACTION); } else { header('Location: automation_graph_rules.php?header=false&action=edit&id=' . get_request_var('id') . '&rule_type=' . AUTOMATION_RULE_TYPE_GRAPH_ACTION); } } elseif (isset_request_var('save_component_automation_match_item')) { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); /* ==================================================== */ unset($save); $save['id'] = form_input_validate(get_request_var('item_id'), 'item_id', '^[0-9]+$', false, 3); $save['rule_id'] = form_input_validate(get_request_var('id'), 'id', '^[0-9]+$', false, 3); $save['rule_type'] = AUTOMATION_RULE_TYPE_GRAPH_MATCH; $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); $save['operation'] = form_input_validate(get_nfilter_request_var('operation'), 'operation', '^[-0-9]+$', true, 3); $save['field'] = form_input_validate(((isset_request_var('field') && get_nfilter_request_var('field') != '0') ? get_nfilter_request_var('field') : ''), 'field', '', true, 3); $save['operator'] = form_input_validate((isset_request_var('operator') ? get_nfilter_request_var('operator') : ''), 'operator', '^[0-9]+$', true, 3); $save['pattern'] = form_input_validate((isset_request_var('pattern') ? get_nfilter_request_var('pattern') : ''), 'pattern', '', true, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_match_rule_items'); if ($item_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message()) { header('Location: automation_graph_rules.php?header=false&action=item_edit&id=' . get_request_var('id') . '&item_id=' . (empty($item_id) ? get_request_var('item_id') : $item_id) . '&rule_type=' . AUTOMATION_RULE_TYPE_GRAPH_MATCH); } else { header('Location: automation_graph_rules.php?header=false&action=edit&id=' . get_request_var('id') . '&rule_type=' . AUTOMATION_RULE_TYPE_GRAPH_MATCH); } } else { raise_message(2); header('Location: automation_graph_rules.php?header=false'); } } /* ------------------------ The 'actions' function ------------------------ */ function automation_graph_rules_form_actions() { global $config, $automation_graph_rules_actions; /* ================= input validation ================= */ get_filter_request_var('drp_action'); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_DELETE) { /* delete */ db_execute('DELETE FROM automation_graph_rules WHERE ' . array_to_sql_or($selected_items, 'id')); db_execute('DELETE FROM automation_graph_rule_items WHERE ' . array_to_sql_or($selected_items, 'rule_id')); db_execute('DELETE FROM automation_match_rule_items WHERE ' . array_to_sql_or($selected_items, 'rule_id')); } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_DUPLICATE) { /* duplicate */ for ($i=0;($i $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $automation_graph_rules_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT name FROM automation_graph_rules WHERE id = ?', array($matches[1]))) . '
  • '; $automation_graph_rules_array[] = $matches[1]; } } top_header(); form_start('automation_graph_rules.php', 'automation_graph_rules'); html_start_box($automation_graph_rules_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_DELETE) { /* delete */ print "

    " . __('Press \'Continue\' to delete the following Graph Rules.') . "

      $automation_graph_rules_list
    "; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_DUPLICATE) { /* duplicate */ print "

    " . __('Click \'Continue\' to duplicate the following Rule(s). You can optionally change the title format for the new Graph Rules.') . "

      $automation_graph_rules_list

    " . __('Title Format') . '
    '; form_text_box('name_format', '<' . __('rule_name') . '> (1)', '', '255', '30', 'text'); print "

    \n"; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_ENABLE) { /* enable */ print "

    " . __('Click \'Continue\' to enable the following Rule(s).') . "

      $automation_graph_rules_list

    " . __('Make sure, that those rules have successfully been tested!') . "

    \n"; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_GRAPH_DISABLE) { /* disable */ print "

    " . __('Click \'Continue\' to disable the following Rule(s).') . "

      $automation_graph_rules_list
    \n"; } if (!isset($automation_graph_rules_array)) { raise_message(40); header('Location: automation_graph_rules.php?header=false'); exit; } else { $save_html = " "; } print " $save_html \n"; html_end_box(); form_end(); bottom_footer(); } /* -------------------------- Rule Item Functions -------------------------- */ function automation_graph_rules_item_movedown() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_MATCH) { move_item_down('automation_match_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id') . ' AND rule_type=' . get_request_var('rule_type')); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_ACTION) { move_item_down('automation_graph_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id')); } } function automation_graph_rules_item_moveup() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_MATCH) { move_item_up('automation_match_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id') . ' AND rule_type=' . get_request_var('rule_type')); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_ACTION) { move_item_up('automation_graph_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id')); } } function automation_graph_rules_item_remove() { /* ================= input validation ================= */ get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_MATCH) { db_execute_prepared('DELETE FROM automation_match_rule_items WHERE id = ?', array(get_request_var('item_id'))); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_ACTION) { db_execute_prepared('DELETE FROM automation_graph_rule_items WHERE id = ?', array(get_request_var('item_id'))); } } function automation_graph_rules_item_edit() { global $config; /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ global_item_edit(get_request_var('id'), get_request_var('item_id'), get_request_var('rule_type')); form_hidden_box('rule_type', get_request_var('rule_type'), get_request_var('rule_type')); form_hidden_box('id', (isset_request_var('id') ? get_request_var('id') : '0'), ''); form_hidden_box('item_id', (isset_request_var('item_id') ? get_request_var('item_id') : '0'), ''); if(get_request_var('rule_type') == AUTOMATION_RULE_TYPE_GRAPH_MATCH) { form_hidden_box('save_component_automation_match_item', '1', ''); } else { form_hidden_box('save_component_automation_graph_rule_item', '1', ''); } form_save_button('automation_graph_rules.php?action=edit&id=' . get_request_var('id') . '&rule_type='. get_request_var('rule_type')); ?> 0) { $snmp_query_id = get_filter_request_var('snmp_query_id'); $name = get_nfilter_request_var('name'); db_execute_prepared('UPDATE automation_graph_rules SET snmp_query_id = ?, name = ? WHERE id = ?', array($snmp_query_id, $name, $id)); $graph_type = db_fetch_cell_prepared('SELECT id FROM snmp_query_graph WHERE snmp_query_id = ? ORDER BY name LIMIT 1', array($snmp_query_id)); db_execute_prepared('UPDATE automation_graph_rules SET graph_type_id = ? WHERE id = ?', array($graph_type, $id)); } elseif (isset_request_var('graph_type_id') && $id > 0) { $snmp_query_id = get_filter_request_var('graph_type_id'); $name = get_nfilter_request_var('name'); db_execute_prepared('UPDATE automation_graph_rules SET graph_type_id = ?, name = ? WHERE id = ?', array($snmp_query_id, $name, $id)); } } function automation_graph_rules_edit() { global $config; global $fields_automation_graph_rules_edit1, $fields_automation_graph_rules_edit2, $fields_automation_graph_rules_edit3; /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('snmp_query_id'); get_filter_request_var('graph_type_id'); get_filter_request_var('show_graphs'); get_filter_request_var('show_hosts'); get_filter_request_var('show_rule'); /* ==================================================== */ /* clean up rule name */ if (isset_request_var('name')) { set_request_var('name', sanitize_search_string(get_request_var('name'))); } /* handle show_rule mode */ if (isset_request_var('show_rule')) { if (get_request_var('show_rule') == '0') { kill_session_var('automation_graph_rules_show_rule'); $_SESSION['automation_graph_rules_show_rule'] = false; } elseif (get_request_var('show_rule') == '1') { $_SESSION['automation_graph_rules_show_rule'] = true; } } elseif (!isset($_SESSION['automation_graph_rules_show_rule'])) { $_SESSION['automation_graph_rules_show_rule'] = true; } /* handle show_graphs mode */ if (isset_request_var('show_graphs')) { if (get_request_var('show_graphs') == '0') { kill_session_var('automation_graph_rules_show_graphs'); } elseif (get_request_var('show_graphs') == '1') { $_SESSION['automation_graph_rules_show_graphs'] = true; } } /* handle show_hosts mode */ if (isset_request_var('show_hosts')) { if (get_request_var('show_hosts') == '0') { kill_session_var('automation_graph_rules_show_hosts'); } elseif (get_request_var('show_hosts') == '1') { $_SESSION['automation_graph_rules_show_hosts'] = true; } } /* * display the rule ------------------------------------------------------------------------------------- */ $rule = array(); if (!isempty_request_var('id')) { $rule = db_fetch_row_prepared('SELECT * FROM automation_graph_rules where id = ?', array(get_request_var('id'))); if (!isempty_request_var('graph_type_id')) { $rule['graph_type_id'] = get_request_var('graph_type_id'); # set query_type for display } # setup header $header_label = __esc('Rule Selection [edit: %s]', $rule['name']); } else { $rule = array ( 'name' => get_request_var('name'), 'snmp_query_id' => get_request_var('snmp_query_id'), ); $header_label = __('Rule Selection [new]'); } /* * show rule? ------------------------------------------------------------------------------------------ */ if (!isempty_request_var('id')) { ?>
    *'>
    *'>
    0) { ?>
    *'>
    array('no_form_tag' => true), 'fields' => inject_form_variables($form_array, (isset($rule) ? $rule : array())) )); html_end_box(true, true); form_hidden_box('id', (isset($rule['id']) ? $rule['id'] : '0'), ''); form_hidden_box('item_id', (isset($rule['item_id']) ? $rule['item_id'] : '0'), ''); form_hidden_box('save_component_automation_graph_rule', '1', ''); /* * display the rule items ------------------------------------------------------------------------------- */ if (!empty($rule['id'])) { # display graph rules for host match display_match_rule_items(__('Device Selection Criteria'), $rule['id'], AUTOMATION_RULE_TYPE_GRAPH_MATCH, 'automation_graph_rules.php'); # fetch graph action rules display_graph_rule_items(__('Graph Creation Criteria'), $rule['id'], AUTOMATION_RULE_TYPE_GRAPH_ACTION, 'automation_graph_rules.php'); } form_save_button('automation_graph_rules.php', 'return'); print '
    '; } if (!empty($rule['id'])) { /* display list of matching hosts */ if (isset($_SESSION['automation_graph_rules_show_hosts'])) { if ($_SESSION['automation_graph_rules_show_hosts']) { display_matching_hosts($rule, AUTOMATION_RULE_TYPE_GRAPH_MATCH, 'automation_graph_rules.php?action=edit&id=' . get_request_var('id')); } } /* display list of new graphs */ if (isset($_SESSION['automation_graph_rules_show_graphs'])) { if ($_SESSION['automation_graph_rules_show_graphs']) { display_new_graphs($rule, 'automation_graph_rules.php?action=edit&id=' . get_request_var('id')); } } } ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'status' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'snmp_query_id' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '' ) ); validate_store_request_vars($filters, 'sess_autom_gr'); /* ================= input validation ================= */ if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } if ((!empty($_SESSION['sess_autom_gr_status'])) && (!isempty_request_var('status'))) { if ($_SESSION['sess_autom_gr_status'] != get_nfilter_request_var('status')) { set_request_var('page', 1); } } html_start_box(__('Graph Rules'), '100%', '', '3', 'center', 'automation_graph_rules.php?action=edit'); ?>
    '> '> '>
    array('display' => __('Rule Name'), 'align' => 'left', 'sort' => 'ASC', 'tip' => __('The name of this rule.')), 'id' => array('display' => __('ID'), 'align' => 'right', 'sort' => 'ASC', 'tip' => __('The internal database ID for this rule. Useful in performing debugging and automation.')), 'snmp_query_name' => array('display' => __('Data Query'), 'align' => 'left', 'sort' => 'ASC'), 'graph_type_name' => array('display' => __('Graph Type'), 'align' => 'left', 'sort' => 'ASC'), 'enabled' => array('display' => __('Enabled'), 'align' => 'right', 'sort' => 'ASC'), ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); if (cacti_sizeof($automation_graph_rules_list)) { foreach ($automation_graph_rules_list as $automation_graph_rules) { $snmp_query_name = ((empty($automation_graph_rules['snmp_query_name'])) ? __('None') : html_escape($automation_graph_rules['snmp_query_name'])); $graph_type_name = ((empty($automation_graph_rules['graph_type_name'])) ? __('None') : html_escape($automation_graph_rules['graph_type_name'])); form_alternate_row('line' . $automation_graph_rules['id'], true); form_selectable_cell(filter_value($automation_graph_rules['name'], get_request_var('filter'), 'automation_graph_rules.php?action=edit&id=' . $automation_graph_rules['id'] . '&page=1'), $automation_graph_rules['id']); form_selectable_cell($automation_graph_rules['id'], $automation_graph_rules['id'], '', 'text-align:right'); form_selectable_cell(filter_value($snmp_query_name, get_request_var('filter')), $automation_graph_rules['id']); form_selectable_cell(filter_value($graph_type_name, get_request_var('filter')), $automation_graph_rules['id']); form_selectable_cell($automation_graph_rules['enabled'] ? __('Enabled') : __('Disabled'), $automation_graph_rules['id'], '', 'text-align:right'); form_checkbox_cell($automation_graph_rules['name'], $automation_graph_rules['id']); form_end_row(); } } else { print "" . __('No Graph Rules Found') . "\n"; } html_end_box(false); if (cacti_sizeof($automation_graph_rules_list)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($automation_graph_rules_actions); form_end(); } cacti-release-1.2.26/automation_networks.php000066400000000000000000001236211454067461500211510ustar00rootroot00000000000000 __('Delete'), 2 => __('Disable'), 3 => __('Enable'), 4 => __('Discover Now'), 5 => __('Cancel Discovery') ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': form_save(); break; case 'actions': form_actions(); break; case 'edit': top_header(); network_edit(); bottom_footer(); break; default: top_header(); networks(); bottom_footer(); break; } /* -------------------------- The Save Function -------------------------- */ function form_save() { if (isset_request_var('save_component_network')) { $network_id = api_networks_save($_POST); header('Location: automation_networks.php?header=false&action=edit&id=' . (empty($network_id) ? get_nfilter_request_var('id') : $network_id)); } } function api_networks_remove($network_id){ db_execute_prepared('DELETE FROM automation_networks WHERE id = ?', array($network_id)); db_execute_prepared('DELETE FROM automation_devices WHERE network_id = ?', array($network_id)); } function api_networks_enable($network_id){ db_execute_prepared('UPDATE automation_networks SET enabled="on" WHERE id = ?', array($network_id)); } function api_networks_disable($network_id){ db_execute_prepared('UPDATE automation_networks SET enabled="" WHERE id = ?', array($network_id)); } function api_networks_cancel($network_id){ db_execute_prepared('UPDATE IGNORE automation_processes SET command="cancel" WHERE task="tmaster" AND network_id = ?', array($network_id)); } function api_networks_discover($network_id, $discover_debug) { global $config; $enabled = db_fetch_cell_prepared('SELECT enabled FROM automation_networks WHERE id = ?', array($network_id)); $running = db_fetch_cell_prepared('SELECT count(*) FROM automation_processes WHERE network_id = ?', array($network_id)); $name = db_fetch_cell_prepared('SELECT name FROM automation_networks WHERE id = ?', array($network_id)); $poller_id = db_fetch_cell_prepared('SELECT poller_id FROM automation_networks WHERE id = ?', array($network_id)); if ($enabled == 'on') { if (!$running) { if ($config['poller_id'] == $poller_id) { $args_debug = ($discover_debug) ? ' --debug' : ''; exec_background(read_config_option('path_php_binary'), '-q ' . read_config_option('path_webroot') . "/poller_automation.php --network=$network_id --force" . $args_debug); } else { $args_debug = ($discover_debug) ? '&debug=true' : ''; $hostname = db_fetch_cell_prepared('SELECT hostname FROM poller WHERE id = ?', array($poller_id)); $fgc_contextoption = get_default_contextoption(); $fgc_context = stream_context_create($fgc_contextoption); $response = @file_get_contents(get_url_type() .'://' . $hostname . $config['url_path'] . 'remote_agent.php?action=discover&network=' . $network_id . $args_debug, false, $fgc_context); } } else { $_SESSION['automation_message'] = __esc('Can Not Restart Discovery for Discovery in Progress for Network \'%s\'', $name); raise_message('automation_message'); } } else { $_SESSION['automation_message'] = __esc('Can Not Perform Discovery for Disabled Network \'%s\'', $name); raise_message('automation_message'); } force_session_data(); } function api_networks_save($post) { if (empty($post['network_id'])) { $save['id'] = form_input_validate($post['id'], 'id', '^[0-9]+$', false, 3); /* general information */ $save['name'] = form_input_validate($post['name'], 'name', '', false, 3); $save['poller_id'] = form_input_validate($post['poller_id'], 'poller_id', '^[0-9]+$', false, 3); $save['site_id'] = form_input_validate($post['site_id'], 'site_id', '^[0-9]+$', false, 3); $save['subnet_range'] = form_input_validate($post['subnet_range'], 'subnet_range', '', false, 3); $save['dns_servers'] = form_input_validate($post['dns_servers'], 'dns_servers', '', true, 3); $save['threads'] = form_input_validate($post['threads'], 'threads', '^[0-9]+$', false, 3); $save['run_limit'] = form_input_validate($post['run_limit'], 'run_limit', '^[0-9]+$', false, 3); $save['enabled'] = (isset($post['enabled']) ? 'on':''); /* notification settings */ $save['notification_enabled'] = (isset($post['notification_enabled']) ? 'on':''); $save['notification_email'] = form_input_validate($post['notification_email'], 'notification_email', '', true, 3); $save['notification_fromname'] = form_input_validate($post['notification_fromname'], 'notification_fromname', '', true, 3); $save['notification_fromemail'] = form_input_validate($post['notification_fromemail'], 'notification_fromemail', '', true, 3); $save['enable_netbios'] = (isset($post['enable_netbios']) ? 'on':''); $save['add_to_cacti'] = (isset($post['add_to_cacti']) ? 'on':''); $save['same_sysname'] = (isset($post['same_sysname']) ? 'on':''); $save['rerun_data_queries'] = (isset($post['rerun_data_queries']) ? 'on':''); /* discovery connectivity settings */ $save['snmp_id'] = form_input_validate($post['snmp_id'], 'snmp_id', '^[0-9]+$', false, 3); $save['ping_method'] = form_input_validate($post['ping_method'], 'ping_method', '^[0-9]+$', false, 3); $save['ping_port'] = form_input_validate($post['ping_port'], 'ping_port', '^[0-9]+$', false, 3); $save['ping_timeout'] = form_input_validate($post['ping_timeout'], 'ping_timeout', '^[0-9]+$', false, 3); $save['ping_retries'] = form_input_validate($post['ping_retries'], 'ping_retries', '^[0-9]+$', false, 3); /* discovery schedule settings */ $save['sched_type'] = form_input_validate($post['sched_type'], 'sched_type', '^[0-9]+$', false, 3); $save['start_at'] = form_input_validate($post['start_at'], 'start_at', '', false, 3);; // accomodate a schedule start change if ($post['orig_start_at'] != $post['start_at']) { $save['next_start'] = '0000-00-00'; } if ($post['orig_sched_type'] != $post['sched_type']) { $save['next_start'] = '0000-00-00'; } $save['recur_every'] = form_input_validate($post['recur_every'], 'recur_every', '', true, 3); $save['day_of_week'] = form_input_validate(isset($post['day_of_week']) ? implode(',', $post['day_of_week']):'', 'day_of_week', '', true, 3); $save['month'] = form_input_validate(isset($post['month']) ? implode(',', $post['month']):'', 'month', '', true, 3); $save['day_of_month'] = form_input_validate(isset($post['day_of_month']) ? implode(',', $post['day_of_month']):'', 'day_of_month', '', true, 3); $save['monthly_week'] = form_input_validate(isset($post['monthly_week']) ? implode(',', $post['monthly_week']):'', 'monthly_week', '', true, 3); $save['monthly_day'] = form_input_validate(isset($post['monthly_day']) ? implode(',', $post['monthly_day']):'', 'monthly_day', '', true, 3); /* check for bad rules */ if ($save['sched_type'] == '3') { if ($save['day_of_week'] == '') { $save['enabled'] = ''; $_SESSION['automation_message'] = __esc('ERROR: You must specify the day of the week. Disabling Network %s!.', $save['name']); raise_message('automation_message'); } } elseif ($save['sched_type'] == '4') { if ($save['month'] == '' || $save['day_of_month'] == '') { $save['enabled'] = ''; $_SESSION['automation_message'] = __esc('ERROR: You must specify both the Months and Days of Month. Disabling Network %s!', $save['name']); raise_message('automation_message'); } } elseif ($save['sched_type'] == '5') { if ($save['month'] == '' || $save['monthly_day'] == '' || $save['monthly_week'] == '') { $save['enabled'] = ''; $_SESSION['automation_message'] = __esc('ERROR: You must specify the Months, Weeks of Months, and Days of Week. Disabling Network %s!', $save['name']); raise_message('automation_message'); } } /* validate the network definitions and rais error if failed */ $continue = true; $total_ips = 0; $networks = explode(',', $save['subnet_range']); if (cacti_sizeof($networks)) { foreach($networks as $net) { $ips = automation_calculate_total_ips($net); if ($ips !== false) { $total_ips += $ips; } else { $continue = false; $_SESSION['automation_message'] = __esc('ERROR: Network \'%s\' is Invalid.', $net); raise_message('automation_message'); break; } } } if ($continue) { $save['total_ips'] = $total_ips; $network_id = 0; if (!is_error_message()) { $network_id = sql_save($save, 'automation_networks'); if ($network_id) { raise_message(1); } else { raise_message(2); } } return $network_id; } } } /* ------------------------ The 'actions' function ------------------------ */ function form_actions() { global $config, $network_actions, $fields_networkss_edit; /* ================= input validation ================= */ get_filter_request_var('drp_action'); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ foreach($selected_items as $item) { api_networks_remove($item); } } elseif (get_nfilter_request_var('drp_action') == '3') { /* enable */ foreach($selected_items as $item) { api_networks_enable($item); } } elseif (get_nfilter_request_var('drp_action') == '2') { /* disable */ foreach($selected_items as $item) { api_networks_disable($item); } } elseif (get_nfilter_request_var('drp_action') == '4') { /* run now */ $discover_debug = isset_request_var('discover_debug'); foreach($selected_items as $item) { api_networks_discover($item, $discover_debug); } sleep(2); } elseif (get_nfilter_request_var('drp_action') == '5') { /* cancel */ foreach($selected_items as $item) { api_networks_cancel($item); } } } header('Location: automation_networks.php?header=false'); exit; } /* setup some variables */ $networks_list = ''; $i = 0; /* loop through each of the device types selected on the previous page and get more info about them */ foreach ($_POST as $var => $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $networks_info = db_fetch_row_prepared('SELECT name FROM automation_networks WHERE id = ?', array($matches[1])); $networks_list .= '
  • ' . html_escape($networks_info['name']) . '
  • '; $networks_array[$i] = $matches[1]; } $i++; } top_header(); form_start('automation_networks.php'); html_start_box($network_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (get_nfilter_request_var('drp_action') == '1') { /* delete */ print "

    " . __('Click \'Continue\' to delete the following Network(s).') . "

      $networks_list
    "; } elseif (get_nfilter_request_var('drp_action') == '3') { /* enable */ print "

    " . __('Click \'Continue\' to enable the following Network(s).') . "

      $networks_list
    "; } elseif (get_nfilter_request_var('drp_action') == '2') { /* disable */ print "

    " . __('Click \'Continue\' to disable the following Network(s).') . "

      $networks_list
    "; } elseif (get_nfilter_request_var('drp_action') == '4') { /* discover now */ print "

    " . __('Click \'Continue\' to discover the following Network(s).') . "

      $networks_list

    "; } elseif (get_nfilter_request_var('drp_action') == '5') { /* cancel discovery now */ print "

    " . __('Click \'Continue\' to cancel on going Network Discovery(s).') . "

      $networks_list
    "; } if (!isset($networks_array)) { raise_message(40); header('Location: automation_networks.php?header=false'); exit; } else { $save_html = ""; } print " " . ($save_html != '' ? " $save_html" : "") . " "; html_end_box(); form_end(); bottom_footer(); } function network_edit() { global $config, $ping_methods;; $ping_methods[PING_SNMP] = __('SNMP Get'); /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ $sched_types = array( '1' => __('Manual'), '2' => __('Daily'), '3' => __('Weekly'), '4' => __('Monthly'), '5' => __('Monthly on Day')); if (!isempty_request_var('id')) { $network = db_fetch_row_prepared('SELECT * FROM automation_networks WHERE id = ?', array(get_request_var('id'))); $header_label = __esc('Network Discovery Range [edit: %s]', $network['name']); } else { $header_label = __('Network Discovery Range [new]'); } /* file: mactrack_device_types.php, action: edit */ $fields = array( 'spacer0' => array( 'method' => 'spacer', 'friendly_name' => __('General Settings'), 'collapsible' => 'true' ), 'name' => array( 'method' => 'textbox', 'friendly_name' => __('Name'), 'description' => __('Give this Network a meaningful name.'), 'value' => '|arg1:name|', 'max_length' => '250', 'placeholder' => __('New Network Discovery Range') ), 'poller_id' => array( 'method' => 'drop_sql', 'friendly_name' => __('Data Collector'), 'description' => __('Choose the Cacti Data Collector/Poller to be used to gather data from this Device.'), 'value' => '|arg1:poller_id|', 'default' => read_config_option('default_poller'), 'sql' => 'SELECT id, name FROM poller ORDER BY name', ), 'site_id' => array( 'method' => 'drop_sql', 'friendly_name' => __('Associated Site'), 'description' => __('Choose the Cacti Site that you wish to associate discovered Devices with.'), 'value' => '|arg1:site_id|', 'default' => read_config_option('default_site'), 'sql' => 'SELECT id, name FROM sites ORDER BY name', 'none_value' => __('None') ), 'subnet_range' => array( 'method' => 'textarea', 'friendly_name' => __('Subnet Range'), 'description' => __('Enter valid Network Ranges separated by commas. You may use an IP address, a Network range such as 192.168.1.0/24 or 192.168.1.0/255.255.255.0, or using wildcards such as 192.168.*.*'), 'value' => '|arg1:subnet_range|', 'textarea_rows' => '4', 'textarea_cols' => '80', 'max_length' => '1024', 'placeholder' => '192.168.1.0/24' ), 'total_ips' => array( 'method' => 'other', 'friendly_name' => __('Total IP Addresses'), 'description' => __('Total addressable IP Addresses in this Network Range.'), 'value' => (isset($network['total_ips']) ? number_format_i18n($network['total_ips']) : 0) ), 'dns_servers' => array( 'method' => 'textbox', 'friendly_name' => __('Alternate DNS Servers'), 'description' => __('A space delimited list of alternate DNS Servers to use for DNS resolution. If blank, the poller OS will be used to resolve DNS names.'), 'value' => '|arg1:dns_servers|', 'max_length' => '250', 'placeholder' => __('Enter IPs or FQDNs of DNS Servers') ), 'sched_type' => array( 'method' => 'drop_array', 'friendly_name' => __('Schedule Type'), 'description' => __('Define the collection frequency.'), 'value' => '|arg1:sched_type|', 'array' => $sched_types, 'default' => 1 ), 'threads' => array( 'method' => 'drop_array', 'friendly_name' => __('Discovery Threads'), 'description' => __('Define the number of threads to use for discovering this Network Range.'), 'value' => '|arg1:threads|', 'array' => array( '1' => __('%d Thread', 1), '2' => __('%d Threads', 2), '3' => __('%d Threads', 3), '4' => __('%d Threads', 4), '5' => __('%d Threads', 5), '6' => __('%d Threads', 6), '7' => __('%d Threads', 7), '8' => __('%d Threads', 8), '9' => __('%d Threads', 9), '10' => __('%d Threads', 10), '20' => __('%d Threads', 20), '50' => __('%d Threads', 50) ), 'default' => 1 ), 'run_limit' => array( 'method' => 'drop_array', 'friendly_name' => __('Run Limit'), 'description' => __('After the selected Run Limit, the discovery process will be terminated.'), 'value' => '|arg1:run_limit|', 'array' => array( '60' => __('%d Minute', 1), '300' => __('%d Minutes', 5), '600' => __('%d Minutes', 10), '1200' => __('%d Minutes', 20), '1800' => __('%d Minutes', 30), '3600' => __('%d Hour', 1), '7200' => __('%d Hours', 2), '14400' => __('%d Hours', 4), '28800' => __('%d Hours', 8), ), 'default' => 1200 ), 'enabled' => array( 'method' => 'checkbox', 'friendly_name' => __('Enabled'), 'description' => __('Enable this Network Range.'), 'value' => '|arg1:enabled|' ), 'enable_netbios' => array( 'method' => 'checkbox', 'friendly_name' => __('Enable NetBIOS'), 'description' => __('Use NetBIOS to attempt to resolve the hostname of up hosts.'), 'value' => '|arg1:enable_netbios|', 'default' => '' ), 'add_to_cacti' => array( 'method' => 'checkbox', 'friendly_name' => __('Automatically Add to Cacti'), 'description' => __('For any newly discovered Devices that are reachable using SNMP and who match a Device Rule, add them to Cacti.'), 'value' => '|arg1:add_to_cacti|' ), 'same_sysname' => array( 'method' => 'checkbox', 'friendly_name' => __('Allow same sysName on different hosts'), 'description' => __('When discovering devices, allow duplicate sysnames to be added on different hosts'), 'value' => '|arg1:same_sysname|' ), 'rerun_data_queries' => array( 'method' => 'checkbox', 'friendly_name' => __('Rerun Data Queries'), 'description' => __('If a device previously added to Cacti is found, rerun its data queries.'), 'value' => '|arg1:rerun_data_queries|' ), 'spacern' => array( 'method' => 'spacer', 'friendly_name' => __('Notification Settings'), 'collapsible' => 'true' ), 'notification_enabled' => array( 'method' => 'checkbox', 'friendly_name' => __('Notification Enabled'), 'description' => __('If checked, when the Automation Network is scanned, a report will be sent to the Notification Email account..'), 'value' => '|arg1:notification_enabled|', 'default' => '' ), 'notification_email' => array( 'method' => 'textbox', 'friendly_name' => __('Notification Email'), 'description' => __('The Email account to be used to send the Notification Email to.'), 'value' => '|arg1:notification_email|', 'max_length' => '250', 'default' => '' ), 'notification_fromname' => array( 'method' => 'textbox', 'friendly_name' => __('Notification From Name'), 'description' => __('The Email account name to be used as the senders name for the Notification Email. If left blank, Cacti will use the default Automation Notification Name if specified, otherwise, it will use the Cacti system default Email name'), 'value' => '|arg1:notification_fromname|', 'max_length' => '32', 'size' => '30', 'default' => '' ), 'notification_fromemail' => array( 'method' => 'textbox', 'friendly_name' => __('Notification From Email Address'), 'description' => __('The Email Address to be used as the senders Email for the Notification Email. If left blank, Cacti will use the default Automation Notification Email Address if specified, otherwise, it will use the Cacti system default Email Address'), 'value' => '|arg1:notification_fromemail|', 'max_length' => '128', 'default' => '' ), 'spacer2' => array( 'method' => 'spacer', 'friendly_name' => __('Discovery Timing'), 'collapsible' => 'true' ), 'start_at' => array( 'method' => 'textbox', 'friendly_name' => __('Starting Date/Time'), 'description' => __('What time will this Network discover item start?'), 'value' => '|arg1:start_at|', 'max_length' => '30', 'default' => date('Y-m-d H:i:s'), 'size' => 20 ), 'recur_every' => array( 'method' => 'drop_array', 'friendly_name' => __('Rerun Every'), 'description' => __('Rerun discovery for this Network Range every X.'), 'value' => '|arg1:recur_every|', 'default' => '1', 'array' => array( 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7' ), ), 'day_of_week' => array( 'method' => 'drop_multi', 'friendly_name' => __('Days of Week'), 'description' => __('What Day(s) of the week will this Network Range be discovered.'), 'array' => array( 1 => __('Sunday'), 2 => __('Monday'), 3 => __('Tuesday'), 4 => __('Wednesday'), 5 => __('Thursday'), 6 => __('Friday'), 7 => __('Saturday') ), 'value' => '|arg1:day_of_week|', 'class' => 'day_of_week' ), 'month' => array( 'method' => 'drop_multi', 'friendly_name' => __('Months of Year'), 'description' => __('What Months(s) of the Year will this Network Range be discovered.'), 'array' => array( 1 => __('January'), 2 => __('February'), 3 => __('March'), 4 => __('April'), 5 => __('May'), 6 => __('June'), 7 => __('July'), 8 => __('August'), 9 => __('September'), 10 => __('October'), 11 => __('November'), 12 => __('December') ), 'value' => '|arg1:month|', 'class' => 'month' ), 'day_of_month' => array( 'method' => 'drop_multi', 'friendly_name' => __('Days of Month'), 'description' => __('What Day(s) of the Month will this Network Range be discovered.'), 'array' => array(1 => '1', 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 => __('Last')), 'value' => '|arg1:day_of_month|', 'class' => 'days_of_month' ), 'monthly_week' => array( 'method' => 'drop_multi', 'friendly_name' => __('Week(s) of Month'), 'description' => __('What Week(s) of the Month will this Network Range be discovered.'), 'array' => array( 1 => __('First'), 2 => __('Second'), 3 => __('Third'), '32' => __('Last') ), 'value' => '|arg1:monthly_week|', 'class' => 'monthly_week' ), 'monthly_day' => array( 'method' => 'drop_multi', 'friendly_name' => __('Day(s) of Week'), 'description' => __('What Day(s) of the week will this Network Range be discovered.'), 'array' => array( 1 => __('Sunday'), 2 => __('Monday'), 3 => __('Tuesday'), 4 => __('Wednesday'), 5 => __('Thursday'), 6 => __('Friday'), 7 => __('Saturday') ), 'value' => '|arg1:monthly_day|', 'class' => 'monthly_day' ), 'spacer1' => array( 'method' => 'spacer', 'friendly_name' => __('Reachability Settings'), 'collapsible' => 'true' ), 'snmp_id' => array( 'method' => 'drop_sql', 'friendly_name' => __('SNMP Options'), 'description' => __('Select the SNMP Options to use for discovery of this Network Range.'), 'value' => '|arg1:snmp_id|', 'sql' => 'SELECT id, name FROM automation_snmp ORDER BY name' ), 'ping_method' => array( 'friendly_name' => __('Ping Method'), 'description' => __('The type of ping packet to send.'), 'value' => '|arg1:ping_method|', 'method' => 'drop_array', 'default' => read_config_option('ping_method'), 'array' => $ping_methods ), 'ping_port' => array( 'method' => 'textbox', 'friendly_name' => __('Ping Port'), 'value' => '|arg1:ping_port|', 'description' => __('TCP or UDP port to attempt connection.'), 'default' => read_config_option('ping_port'), 'max_length' => 5, 'size' => 5 ), 'ping_timeout' => array( 'friendly_name' => __('Ping Timeout Value'), 'description' => __('The timeout value to use for host ICMP and UDP pinging. This host SNMP timeout value applies for SNMP pings.'), 'method' => 'textbox', 'value' => '|arg1:ping_timeout|', 'default' => read_config_option('ping_timeout'), 'max_length' => 5, 'size' => 5 ), 'ping_retries' => array( 'friendly_name' => __('Ping Retry Count'), 'description' => __('After an initial failure, the number of ping retries Cacti will attempt before failing.'), 'method' => 'textbox', 'value' => '|arg1:ping_retries|', 'default' => read_config_option('ping_retries'), 'max_length' => 5, 'size' => 5 ), 'orig_start_at' => array( 'method' => 'hidden', 'value' => '|arg1:start_at|', ), 'orig_sched_type' => array( 'method' => 'hidden', 'value' => '|arg1:sched_type|', ) ); form_start('automation_networks.php', 'form_network'); html_start_box($header_label, '100%', true, '3', 'center', ''); draw_edit_form( array( 'config' => array('no_form_tag' => 'true'), 'fields' => inject_form_variables($fields, (isset($network) ? $network : array())) ) ); html_end_box(true, true); form_hidden_box('save_component_network', '1', ''); form_hidden_box('id', !isempty_request_var('id') ? get_request_var('id'):0, 0); form_save_button('automation_networks.php', 'return'); ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'refresh' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '20' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ) ); validate_store_request_vars($filters, 'sess_networks'); /* ================= input validation ================= */ $refresh['page'] = 'automation_networks.php?header=false'; $refresh['seconds'] = get_request_var('refresh'); $refresh['logout'] = 'false'; set_page_refresh($refresh); if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } elseif (get_request_var('rows') == -2) { $rows = 99999999; } else { $rows = get_request_var('rows'); } html_start_box(__('Network Filters'), '100%', '', '3', 'center', 'automation_networks.php?action=edit'); networks_filter(); html_end_box(); $sql_where = ''; $networks = get_networks($sql_where, $rows); $total_rows = db_fetch_cell('SELECT COUNT(*) FROM automation_networks ' . $sql_where); $nav = html_nav_bar('automation_networks.php', MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 14, __('Networks'), 'page', 'main'); form_start('automation_networks.php', 'chk'); print $nav; html_start_box('', '100%', '', '3', 'center', ''); $sched_types = array( '1' => __('Manual'), '2' => __('Daily'), '3' => __('Weekly'), '4' => __('Monthly'), '5' => __('Monthly on Day') ); $display_text = array( 'name' => array('display' => __('Network Name'), 'align' => 'left', 'sort' => 'ASC'), 'data_collector' => array('display' => __('Data Collector'), 'align' => 'left', 'sort' => 'DESC'), 'sched_type' => array('display' => __('Schedule'), 'align' => 'left', 'sort' => 'DESC'), 'total_ips' => array('display' => __('Total IPs'), 'align' => 'right', 'sort' => 'DESC'), 'nosort1' => array('display' => __('Status'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __('The Current Status of this Networks Discovery')), 'nosort2' => array('display' => __('Progress'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __('Pending/Running/Done')), 'nosort3' => array('display' => __('Up/SNMP Hosts'), 'align' => 'right', 'sort' => 'DESC'), 'threads' => array('display' => __('Threads'), 'align' => 'right', 'sort' => 'DESC'), 'last_runtime' => array('display' => __('Last Runtime'), 'align' => 'right', 'sort' => 'ASC'), 'nosort4' => array('display' => __('Next Start'), 'align' => 'right', 'sort' => 'ASC'), 'last_started' => array('display' => __('Last Started'), 'align' => 'right', 'sort' => 'ASC')); $status = 'Idle'; html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); if (cacti_sizeof($networks)) { foreach ($networks as $network) { if ($network['enabled'] == '') { $mystat = "" . __('Disabled') . ""; $progress = "0/0/0"; $status = array(); $updown['up'] = $updown['snmp'] = '0'; } else { $running = db_fetch_cell_prepared('SELECT COUNT(*) FROM automation_processes WHERE network_id = ? AND status != "done"', array($network['id'])); if ($running > 0) { $status = db_fetch_row_prepared('SELECT COUNT(*) AS total, SUM(CASE WHEN status=0 THEN 1 ELSE 0 END) AS pending, SUM(CASE WHEN status=1 THEN 1 ELSE 0 END) AS running, SUM(CASE WHEN status=2 THEN 1 ELSE 0 END) AS done FROM automation_ips WHERE network_id = ?', array($network['id'])); $mystat = "" . __('Running') . ""; if (empty($status['total'])) { $progress = "0/0/0"; } else { $progress = $status['pending'] . '/' . $status['running'] . '/' . $status['done']; } $updown = db_fetch_row_prepared("SELECT SUM(up_hosts) AS up, SUM(snmp_hosts) AS snmp FROM automation_processes WHERE network_id = ?", array($network['id'])); if (empty($updown['up'])) { $updown['up'] = 0; $updown['snmp'] = 0; } } else { db_execute_prepared('DELETE FROM automation_processes WHERE network_id = ?', array($network['id'])); $updown['up'] = $network['up_hosts']; $updown['snmp'] = $network['snmp_hosts']; $mystat = "" . __('Idle') . ""; $progress = "0/0/0"; } } form_alternate_row('line' . $network['id'], true); form_selectable_cell('' . html_escape($network['name']) . '', $network['id']); form_selectable_ecell($network['data_collector'], $network['id']); form_selectable_cell($sched_types[$network['sched_type']], $network['id']); form_selectable_cell(number_format_i18n($network['total_ips']), $network['id'], '', 'right'); form_selectable_cell($mystat, $network['id'], '', 'right'); form_selectable_cell($progress, $network['id'], '', 'right'); form_selectable_cell(number_format_i18n($updown['up']) . '/' . number_format_i18n($updown['snmp']), $network['id'], '', 'right'); form_selectable_cell(number_format_i18n($network['threads']), $network['id'], '', 'right'); form_selectable_cell(round($network['last_runtime'],2), $network['id'], '', 'right'); form_selectable_cell($network['enabled'] == '' || $network['sched_type'] == '1' ? __('N/A'):($network['next_start'] == '0000-00-00 00:00:00' ? substr($network['start_at'],0,16):substr($network['next_start'],0,16)), $network['id'], '', 'right'); form_selectable_cell($network['last_started'] == '0000-00-00 00:00:00' ? __('Never'):substr($network['last_started'],0,16), $network['id'], '', 'right'); form_checkbox_cell($network['name'], $network['id']); form_end_row(); } } else { print "" . __('No Networks Found') . ""; } html_end_box(false); if (cacti_sizeof($networks)) { /* put the nav bar on the bottom as well */ print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($network_actions); form_end(); } function networks_filter() { global $item_rows; ?>
    '> ' value=''> ' value=''>
    __('Delete'), 2 => __('Duplicate'), ); /* set default action */ set_default_action(); /* correct for a cancel button */ if (isset_request_var('cancel')) { set_request_var('action', ''); } switch (get_request_var('action')) { case 'save': form_automation_snmp_save(); break; case 'actions': form_automation_snmp_actions(); break; case 'ajax_dnd': automation_snmp_item_dnd(); break; case 'item_movedown': get_filter_request_var('id'); automation_snmp_item_movedown(); header('Location: automation_snmp.php?action=edit&id=' . get_request_var('id')); break; case 'item_moveup': get_filter_request_var('id'); automation_snmp_item_moveup(); header('Location: automation_snmp.php?action=edit&id=' . get_request_var('id')); break; case 'item_remove_confirm': automation_snmp_item_remove_confirm(); break; case 'item_remove': get_filter_request_var('id'); automation_snmp_item_remove(); header('Location: automation_snmp.php?header=false&action=edit&header=false&id=' . get_request_var('id')); break; case 'item_edit': top_header(); automation_snmp_item_edit(); bottom_footer(); break; case 'edit': top_header(); automation_snmp_edit(); bottom_footer(); break; default: top_header(); automation_snmp(); bottom_footer(); break; } function form_automation_snmp_save() { if (isset_request_var('save_component_automation_snmp')) { /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ $save['id'] = get_nfilter_request_var('id'); $save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3); if (!is_error_message()) { $id = sql_save($save, 'automation_snmp'); if ($id) { raise_message(1); } else { raise_message(2); } } header('Location: automation_snmp.php?header=false&action=edit&id=' . (empty($id) ? get_nfilter_request_var('id') : $id)); } elseif (isset_request_var('save_component_automation_snmp_item')) { /* ================= input validation ================= */ get_filter_request_var('item_id'); get_filter_request_var('id'); /* ==================================================== */ $save = array(); $save['id'] = form_input_validate(get_nfilter_request_var('item_id'), '', '^[0-9]+$', false, 3); $save['snmp_id'] = form_input_validate(get_nfilter_request_var('id'), 'snmp_id', '^[0-9]+$', false, 3); $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); $save['snmp_community'] = form_input_validate(get_nfilter_request_var('snmp_community'), 'snmp_community', '', false, 3); $save['snmp_version'] = form_input_validate(get_nfilter_request_var('snmp_version'), 'snmp_version', '', false, 3); $save['snmp_username'] = form_input_validate(get_nfilter_request_var('snmp_username'), 'snmp_username', '', true, 3); $save['snmp_password'] = form_input_validate(get_nfilter_request_var('snmp_password'), 'snmp_password', '', true, 3); $save['snmp_auth_protocol'] = form_input_validate(get_nfilter_request_var('snmp_auth_protocol'), 'snmp_auth_protocol', '', true, 3); $save['snmp_priv_passphrase'] = form_input_validate(get_nfilter_request_var('snmp_priv_passphrase'), 'snmp_priv_passphrase', '', true, 3); $save['snmp_priv_protocol'] = form_input_validate(get_nfilter_request_var('snmp_priv_protocol'), 'snmp_priv_protocol', '', true, 3); $save['snmp_context'] = form_input_validate(get_nfilter_request_var('snmp_context'), 'snmp_context', '', true, 3); $save['snmp_engine_id'] = form_input_validate(get_nfilter_request_var('snmp_engine_id'), 'snmp_engine_id', '', true, 3); $save['snmp_port'] = form_input_validate(get_nfilter_request_var('snmp_port'), 'snmp_port', '^[0-9]+$', false, 3); $save['snmp_timeout'] = form_input_validate(get_nfilter_request_var('snmp_timeout'), 'snmp_timeout', '^[0-9]+$', false, 3); $save['snmp_retries'] = form_input_validate(get_nfilter_request_var('snmp_retries'), 'snmp_retries', '^[0-9]+$', false, 3); $save['max_oids'] = form_input_validate(get_nfilter_request_var('max_oids'), 'max_oids', '^[0-9]+$', false, 3); $save['bulk_walk_size'] = form_input_validate(get_nfilter_request_var('bulk_walk_size'), 'bulk_walk_size', '^[\-0-9]+$', false, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_snmp_items'); if ($item_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message()) { header('Location: automation_snmp.php?header=false&action=item_edit&id=' . get_nfilter_request_var('id') . '&item_id=' . (empty($item_id) ? get_filter_request_var('id') : $item_id)); } else { header('Location: automation_snmp.php?header=false&action=edit&id=' . get_nfilter_request_var('id')); } } else { raise_message(2); header('Location: automation_snmp.php?header=false'); } } /* ------------------------ The 'actions' function ------------------------ */ function form_automation_snmp_actions() { global $config, $automation_snmp_actions; /* ================= input validation ================= */ get_filter_request_var('drp_action'); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ db_execute('DELETE FROM automation_snmp WHERE ' . array_to_sql_or($selected_items, 'id')); db_execute('DELETE FROM automation_snmp_items WHERE ' . str_replace('id', 'snmp_id', array_to_sql_or($selected_items, 'id'))); } elseif (get_nfilter_request_var('drp_action') == '2') { /* duplicate */ for ($i=0;($i $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $snmp_groups .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT name FROM automation_snmp WHERE id = ?', array($matches[1]))) . '
  • '; $automation_array[$i] = $matches[1]; $i++; } } general_header(); ?> "; if (get_nfilter_request_var('drp_action') == '1') { /* delete */ print "

    " . __('Click \'Continue\' to delete the following SNMP Option(s).') . "

      $snmp_groups
    "; } elseif (get_nfilter_request_var('drp_action') == '2') { /* duplicate */ print "

    " . __('Click \'Continue\' to duplicate the following SNMP Options. You can optionally change the title format for the new SNMP Options.') . "

      $snmp_groups

    " . __('Name Format') . '
    '; form_text_box('name_format', '<' . __('name') . '> (1)', '', '255', '30', 'text'); print "

    "; } } print " $save_html "; html_end_box(); form_end(); bottom_footer(); } /* -------------------------- SNMP Options Functions -------------------------- */ function automation_duplicate_snmp_option($id, $new_name) { $name = db_fetch_cell_prepared('SELECT name FROM automation_snmp WHERE id = ?', array($id)); $new_name = str_replace('', $name, $new_name); $save['id'] = 0; $save['name'] = $new_name; $newid = sql_save($save, 'automation_snmp'); if ($newid > 0 && $id > 0) { db_execute_prepared("INSERT INTO automation_snmp_items (snmp_id, sequence, snmp_version, snmp_community, snmp_port, snmp_timeout, snmp_retries, max_oids, snmp_username, snmp_password, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context, snmp_engine_id) SELECT $newid AS snmp_id, sequence, snmp_version, snmp_community, snmp_port, snmp_timeout, snmp_retries, max_oids, snmp_username, snmp_password, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context, snmp_engine_id FROM automation_snmp_items WHERE snmp_id = ?", array($id)); raise_message('option_duplicated', __('Automation SNMP Options has been Duplicated.'), MESSAGE_LEVEL_INFO); } else { raise_message('missing_options', __('Automation Item does not exist. Can not Duplicate.'), MESSAGE_LEVEL_ERROR); } } function automation_snmp_item_dnd() { /* ================= Input validation ================= */ get_filter_request_var('id'); /* ================= Input validation ================= */ if (isset_request_var('snmp_item') && is_array(get_nfilter_request_var('snmp_item'))) { $items = get_request_var('snmp_item'); $sequence = 1; foreach($items as $item) { $item = str_replace('line', '', $item); input_validate_input_number($item); db_execute_prepared('UPDATE automation_snmp_items SET sequence = ? WHERE id = ?', array($sequence, $item)); $sequence++; } } header('Location: automation_snmp.php?action=edit&header=false&id=' . get_request_var('id')); exit; } function automation_snmp_item_movedown() { /* ================= input validation ================= */ get_filter_request_var('item_id'); get_filter_request_var('id'); /* ==================================================== */ move_item_down('automation_snmp_items', get_request_var('item_id'), 'snmp_id=' . get_request_var('id')); } function automation_snmp_item_moveup() { /* ================= input validation ================= */ get_filter_request_var('item_id'); get_filter_request_var('id'); /* ==================================================== */ move_item_up('automation_snmp_items', get_request_var('item_id'), 'snmp_id=' . get_request_var('id')); } function automation_snmp_item_remove_confirm() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); /* ==================================================== */ form_start('automation_snmp.php'); html_start_box('', '100%', '', '3', 'center', ''); $snmp = db_fetch_row_prepared('SELECT * FROM automation_snmp WHERE id = ?', array(get_request_var('id'))); $item = db_fetch_row_prepared('SELECT * FROM automation_snmp_items WHERE id = ?', array(get_request_var('item_id'))); ?>


    %s', $item['snmp_version']);?>
    %s', ($item['snmp_version'] != 3 ? html_escape($item['snmp_community']):html_escape($item['snmp_username'])));?>

    ' onClick='$("#cdialog").dialog("close");' name='cancel'> ' name='continue' title=''> array( 'method' => 'view', 'friendly_name' => __('Sequence'), 'description' => __('Sequence of Item.'), 'value' => '|arg1:sequence|'), ); draw_edit_form(array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($fields_automation_snmp_item_edit, (isset($automation_snmp_item) ? $automation_snmp_item : array())) )); html_end_box(true, true); form_hidden_box('item_id', (isset_request_var('item_id') ? get_request_var('item_id') : '0'), ''); form_hidden_box('id', (isset($automation_snmp_item['snmp_id']) ? $automation_snmp_item['snmp_id'] : '0'), ''); form_hidden_box('save_component_automation_snmp_item', '1', ''); form_save_button('automation_snmp.php?action=edit&id=' . get_request_var('id')); ?> array( 'method' => 'textbox', 'friendly_name' => __('Name'), 'description' => __('Fill in the name of this SNMP Option Set.'), 'value' => '|arg1:name|', 'default' => '', 'max_length' => '100', 'size' => '40' ) ); draw_edit_form(array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($fields_automation_snmp_edit, $snmp_group) )); html_end_box(true, true); form_hidden_box('id', (isset_request_var('id') ? get_request_var('id'): '0'), ''); form_hidden_box('save_component_automation_snmp', '1', ''); if (!isempty_request_var('id')) { $items = db_fetch_assoc_prepared('SELECT * FROM automation_snmp_items WHERE snmp_id = ? ORDER BY sequence', array(get_request_var('id'))); html_start_box(__('Automation SNMP Options'), '100%', '', '3', 'center', 'automation_snmp.php?action=item_edit&id=' . get_request_var('id')); $display_text = array( array('display' => __('Item'), 'align' => 'left'), array('display' => __('Version'), 'align' => 'left'), array('display' => __('Community'), 'align' => 'left'), array('display' => __('Port'), 'align' => 'right'), array('display' => __('Timeout'), 'align' => 'right'), array('display' => __('Retries'), 'align' => 'right'), array('display' => __('Max OIDS'), 'align' => 'right'), array('display' => __('Auth Username'), 'align' => 'left'), array('display' => __('Auth Password'), 'align' => 'left'), array('display' => __('Auth Protocol'), 'align' => 'left'), array('display' => __('Priv Passphrase'), 'align' => 'left'), array('display' => __('Priv Protocol'), 'align' => 'left'), array('display' => __('Context'), 'align' => 'left'), array('display' => __('Action'), 'align' => 'right') ); html_header($display_text); $i = 1; $total_items = cacti_sizeof($items); if (cacti_sizeof($items)) { foreach ($items as $item) { form_alternate_row('line' . $item['id'], true, true); $form_data = "" . __('Item#%d', $i) . ''; $form_data .= '' . $item['snmp_version'] . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? __('none') : html_escape($item['snmp_community'])) . ''; $form_data .= '' . $item['snmp_port'] . ''; $form_data .= '' . $item['snmp_timeout'] . ''; $form_data .= '' . $item['snmp_retries'] . ''; $form_data .= '' . $item['max_oids'] . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? html_escape($item['snmp_username']) : __('N/A')) . ''; $form_data .= '' . (($item['snmp_version'] == 3 AND $item['snmp_password'] !== '') ? '*********' : __('N/A')) . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? $item['snmp_auth_protocol'] : __('N/A')) . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? '*********' : __('N/A')) . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? $item['snmp_priv_protocol'] : __('N/A')) . ''; $form_data .= '' . ($item['snmp_version'] == 3 ? html_escape($item['snmp_context']) : __('N/A')) . ''; $form_data .= ''; if (read_config_option('drag_and_drop') == '') { if ($i < $total_items && $total_items > 1) { $form_data .= ''; } else { $form_data .= ''; } if ($i > 1 && $i <= $total_items) { $form_data .= ''; } else { $form_data .= ''; } } $form_data .= ''; $form_data .= ''; print $form_data; $i++; } } else { print "" . __('No SNMP Items') . ""; } html_end_box(); } form_save_button('automation_snmp.php', 'return'); ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ) ); validate_store_request_vars($filters, 'sess_autom_snmp'); if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } html_start_box(__('Automation SNMP Options'), '100%', '', '3', 'center', 'automation_snmp.php?action=edit'); ?>
    '> ' title=''> ' title=''>
    array('display' => __('SNMP Option Set'), 'align' => 'left', 'sort' => 'ASC'), 'networks' => array('display' => __('Networks Using'), 'align' => 'right', 'sort' => 'DESC'), 'totals' => array('display' => __('SNMP Entries'), 'align' => 'right', 'sort' => 'DESC'), 'v1entries' => array('display' => __('V1 Entries'), 'align' => 'right', 'sort' => 'DESC'), 'v2entries' => array('display' => __('V2 Entries'), 'align' => 'right', 'sort' => 'DESC'), 'v3entries' => array('display' => __('V3 Entries'), 'align' => 'right', 'sort' => 'DESC') ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); if (cacti_sizeof($snmp_groups)) { foreach ($snmp_groups as $snmp_group) { form_alternate_row('line' . $snmp_group['id'], true); form_selectable_cell(filter_value($snmp_group['name'], get_request_var('filter'), 'automation_snmp.php?action=edit&id=' . $snmp_group['id'] . '&page=1'), $snmp_group['id']); form_selectable_cell($snmp_group['networks'], $snmp_group['id'], '', 'text-align:right;'); form_selectable_cell($snmp_group['totals'], $snmp_group['id'], '', 'text-align:right;'); form_selectable_cell($snmp_group['v1entries'], $snmp_group['id'], '', 'text-align:right;'); form_selectable_cell($snmp_group['v2entries'], $snmp_group['id'], '', 'text-align:right;'); form_selectable_cell($snmp_group['v3entries'], $snmp_group['id'], '', 'text-align:right;'); form_checkbox_cell($snmp_group['name'], $snmp_group['id']); form_end_row(); } } else { print "" . __('No SNMP Option Sets Found') . ""; } html_end_box(false); if (cacti_sizeof($snmp_groups)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($automation_snmp_actions); form_end(); ?> __('Delete') ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': form_save(); break; case 'ajax_dnd': automation_template_dnd(); break; case 'actions': form_actions(); break; case 'movedown': automation_movedown(); header('Location: automation_templates.php?header=false'); break; case 'moveup': automation_moveup(); header('Location: automation_templates.php?header=false'); break; case 'remove': automation_remove(); header('Location: automation_templates.php?header=false'); break; case 'edit': top_header(); template_edit(); bottom_footer(); break; default: top_header(); template(); bottom_footer(); break; } function automation_template_dnd() { /* ================= Input validation ================= */ get_filter_request_var('id'); /* ================= Input validation ================= */ if (isset_request_var('template_ids') && is_array(get_nfilter_request_var('template_ids'))) { $aids = get_nfilter_request_var('template_ids'); $sequence = 1; foreach($aids as $id) { $id = str_replace('line', '', $id); input_validate_input_number($id); db_execute_prepared('UPDATE automation_templates SET sequence = ? WHERE id = ?', array($sequence, $id)); $sequence++; } } header('Location: automation_templates.php?header=false'); exit; } function automation_movedown() { move_item_down('automation_templates', get_filter_request_var('id')); } function automation_moveup() { move_item_up('automation_templates', get_filter_request_var('id')); } function automation_remove() { db_execute_prepared('DELETE FROM automation_templates WHERE id = ?', array(get_filter_request_var('id'))); } function form_actions() { global $at_actions; /* ================= input validation ================= */ get_filter_request_var('drp_action', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-zA-Z0-9_]+)$/'))); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ db_execute('DELETE FROM automation_templates WHERE ' . array_to_sql_or($selected_items, 'id')); } } header('Location: automation_templates.php?header=false'); exit; } /* setup some variables */ $at_list = ''; $i = 0; foreach ($_POST as $var => $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $at_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT ht.name FROM automation_templates AS at INNER JOIN host_template AS ht ON ht.id=at.host_template WHERE at.id = ?', array($matches[1]))) . '
  • '; $at_array[$i] = $matches[1]; $i++; } } top_header(); form_start('automation_templates.php'); html_start_box($at_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (isset($at_array) && cacti_sizeof($at_array)) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ print "

    " . __('Click \'Continue\' to delete the following Automation Template(s).') . "

      $at_list
    \n"; $save_html = " "; } } else { raise_message(40); header('Location: automation_templates.php?header=false'); exit; } print " $save_html \n"; html_end_box(); form_end(); bottom_footer(); } function form_save() { if (isset_request_var('save_component_template')) { $redirect_back = false; $save['id'] = get_nfilter_request_var('id'); $save['host_template'] = form_input_validate(get_nfilter_request_var('host_template'), 'host_template', '', false, 3); $save['availability_method'] = form_input_validate(get_nfilter_request_var('availability_method'), 'availability_method', '', false, 3); $save['sysDescr'] = get_nfilter_request_var('sysDescr'); $save['sysName'] = get_nfilter_request_var('sysName'); $save['sysOid'] = get_nfilter_request_var('sysOid'); if (function_exists('filter_var')) { $save['sysDescr'] = filter_var($save['sysDescr'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); } else { $save['sysDescr'] = strip_tags($save['sysDescr']); } if (!is_error_message()) { $template_id = sql_save($save, 'automation_templates'); if ($template_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message() || isempty_request_var('id')) { header('Location: automation_templates.php?header=false&id=' . (empty($template_id) ? get_nfilter_request_var('id') : $template_id)); } else { header('Location: automation_templates.php?header=false'); } } } function automation_get_child_branches($tree_id, $id, $spaces, $headers) { $items = db_fetch_assoc_prepared('SELECT id, title FROM graph_tree_items WHERE graph_tree_id = ? AND host_id=0 AND local_graph_id=0 AND parent = ? ORDER BY position', array($tree_id, $id)); $spaces .= '--'; if (cacti_sizeof($items)) { foreach($items as $i) { $headers['tr_' . $tree_id . '_bi_' . $i['id']] = $spaces . ' ' . $i['title']; $headers = automation_get_child_branches($tree_id, $i['id'], $spaces, $headers); } } return $headers; } function automation_get_tree_headers() { $headers = array(); $trees = db_fetch_assoc('SELECT id, name FROM graph_tree ORDER BY name'); foreach ($trees as $tree) { $headers['tr_' . $tree['id'] . '_br_0'] = $tree['name']; $spaces = ''; $headers = automation_get_child_branches($tree['id'], 0, $spaces, $headers); } return $headers; } function template_edit() { global $availability_options; $host_template_names = db_fetch_assoc('SELECT id, name FROM host_template'); $template_names = array(); if (cacti_sizeof($host_template_names)) { foreach ($host_template_names as $ht) { $template_names[$ht['id']] = $ht['name']; } } $fields_automation_template_edit = array( 'host_template' => array( 'method' => 'drop_array', 'friendly_name' => __('Device Template'), 'description' => __('Select a Device Template that Devices will be matched to.'), 'value' => '|arg1:host_template|', 'array' => $template_names, ), 'availability_method' => array( 'method' => 'drop_array', 'friendly_name' => __('Availability Method'), 'description' => __('Choose the Availability Method to use for Discovered Devices.'), 'value' => '|arg1:availability_method|', 'default' => read_config_option('availability_method'), 'array' => $availability_options, ), 'sysDescr' => array( 'method' => 'textbox', 'friendly_name' => __('System Description Match'), 'description' => __('This is a unique string that will be matched to a devices sysDescr string to pair it to this Automation Template. Any Perl regular expression can be used in addition to any SQL Where expression.'), 'value' => '|arg1:sysDescr|', 'max_length' => '255', ), 'sysName' => array( 'method' => 'textbox', 'friendly_name' => __('System Name Match'), 'description' => __('This is a unique string that will be matched to a devices sysName string to pair it to this Automation Template. Any Perl regular expression can be used in addition to any SQL Where expression.'), 'value' => '|arg1:sysName|', 'max_length' => '128', ), 'sysOid' => array( 'method' => 'textbox', 'friendly_name' => __('System OID Match'), 'description' => __('This is a unique string that will be matched to a devices sysOid string to pair it to this Automation Template. Any Perl regular expression can be used in addition to any SQL Where expression.'), 'value' => '|arg1:sysOid|', 'max_length' => '128', ), 'id' => array( 'method' => 'hidden_zero', 'value' => '|arg1:id|' ), 'save_component_template' => array( 'method' => 'hidden', 'value' => '1' ) ); /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ if (!isempty_request_var('id')) { $host_template = db_fetch_row_prepared('SELECT * FROM automation_templates WHERE id = ?', array(get_request_var('id'))); if (isset($template_names[$host_template['host_template']])) { $header_label = __esc('Automation Templates [edit: %s]', $template_names[$host_template['host_template']]); } else { $header_label = __('Automation Templates for [Deleted Template]'); } } else { $header_label = __('Automation Templates [new]'); set_request_var('id', 0); } form_start('automation_templates.php', 'form_network'); html_start_box($header_label, '100%', true, '3', 'center', ''); draw_edit_form( array( 'config' => array('no_form_tag' => 'true'), 'fields' => inject_form_variables($fields_automation_template_edit, (isset($host_template) ? $host_template : array())) ) ); html_end_box(true, true); form_save_button('automation_templates.php'); } function template() { global $at_actions, $item_rows, $availability_options; /* ================= input validation and session storage ================= */ $filters = array( 'rows' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ) ); validate_store_request_vars($filters, 'sess_autot'); /* ================= input validation ================= */ if (get_request_var('rows') == '-1') { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } html_start_box(__('Device Automation Templates'), '100%', '', '3', 'center', 'automation_templates.php?action=edit'); ?>
    '> ' title=''> ' title=''>
    __('Template Name'), 'align' => 'left'), array('display' => __('Availability Method'), 'align' => 'left'), array('display' => __('System Description Match'), 'align' => 'left'), array('display' => __('System Name Match'), 'align' => 'left'), array('display' => __('System ObjectId Match'), 'align' => 'left') ); if (read_config_option('drag_and_drop') == '') { $display_text[] = array('display' => __('Order'), 'align' => 'center'); } html_header_checkbox($display_text, false); $i = 1; $total_items = cacti_sizeof($dts); if (cacti_sizeof($dts)) { foreach ($dts as $dt) { if ($dt['name'] == '') { $name = __('Unknown Template'); } else { $name = $dt['name']; } form_alternate_row('line' . $dt['id'], true); form_selectable_cell(filter_value($name, get_request_var('filter'), 'automation_templates.php?action=edit&id=' . $dt['id']), $dt['id']); form_selectable_cell($availability_options[$dt['availability_method']], $dt['id']); form_selectable_cell(filter_value($dt['sysDescr'], get_request_var('filter')), $dt['id']); form_selectable_cell(filter_value($dt['sysName'], get_request_var('filter')), $dt['id']); form_selectable_cell(filter_value($dt['sysOid'], get_request_var('filter')), $dt['id']); if (read_config_option('drag_and_drop') == '') { $add_text = ''; if ($i < $total_items && $total_items > 1) { $add_text .= ''; } else { $add_text .= ''; } if ($i > 1 && $i <= $total_items) { $add_text .= ''; } else { $add_text .= ''; } form_selectable_cell($add_text, $dt['id'], '', 'center'); } form_checkbox_cell($name, $dt['id']); form_end_row(); $i++; } } else { print "" . __('No Automation Device Templates Found') . "\n"; } html_end_box(false); if (cacti_sizeof($dts)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($at_actions); form_end(); ?> __('Duplicate'), AUTOMATION_ACTION_TREE_ENABLE => __('Enable'), AUTOMATION_ACTION_TREE_DISABLE => __('Disable'), AUTOMATION_ACTION_TREE_DELETE => __('Delete'), ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': automation_tree_rules_form_save(); break; case 'actions': automation_tree_rules_form_actions(); break; case 'change_leaf': automation_tree_rules_change_leaf(); header('Location: automation_tree_rules.php?header=false&action=edit&id=' . get_request_var('id')); break; case 'item_movedown': automation_tree_rules_item_movedown(); header('Location: automation_tree_rules.php?action=edit&id=' . get_request_var('id')); break; case 'item_moveup': automation_tree_rules_item_moveup(); header('Location: automation_tree_rules.php?action=edit&id=' . get_request_var('id')); break; case 'item_remove': automation_tree_rules_item_remove(); header('Location: automation_tree_rules.php?action=edit&id=' . get_request_var('id')); break; case 'item_edit': top_header(); automation_tree_rules_item_edit(); bottom_footer(); break; case 'remove': automation_tree_rules_remove(); header ('Location: automation_tree_rules.php'); break; case 'edit': top_header(); automation_tree_rules_edit(); bottom_footer(); break; default: top_header(); automation_tree_rules(); bottom_footer(); break; } /* -------------------------- The Save Function -------------------------- */ function automation_tree_rules_form_save() { if (isset_request_var('save_component_automation_tree_rule')) { /* ================= input validation ================= */ get_filter_request_var('id'); /* ==================================================== */ $save['id'] = get_request_var('id'); $save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', true, 3); $save['tree_id'] = form_input_validate(get_nfilter_request_var('tree_id'), 'tree_id', '^[0-9]+$', false, 3); $save['tree_item_id'] = isset_request_var('tree_item_id') ? form_input_validate(get_nfilter_request_var('tree_item_id'), 'tree_item_id', '^[0-9]+$', false, 3) : 0; $save['leaf_type'] = (isset_request_var('leaf_type')) ? form_input_validate(get_nfilter_request_var('leaf_type'), 'leaf_type', '^[0-9]+$', false, 3) : 0; $save['host_grouping_type'] = isset_request_var('host_grouping_type') ? form_input_validate(get_nfilter_request_var('host_grouping_type'), 'host_grouping_type', '^[0-9]+$', false, 3) : 0; $save['enabled'] = (isset_request_var('enabled') ? 'on' : ''); if (!is_error_message()) { $rule_id = sql_save($save, 'automation_tree_rules'); if ($rule_id) { raise_message(1); } else { raise_message(2); } } header('Location: automation_tree_rules.php?header=false&action=edit&id=' . (empty($rule_id) ? get_request_var('id') : $rule_id)); } elseif (isset_request_var('save_component_automation_match_item')) { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); /* ==================================================== */ $save = array(); $save['id'] = form_input_validate(get_request_var('item_id'), 'item_id', '^[0-9]+$', false, 3); $save['rule_id'] = form_input_validate(get_request_var('id'), 'id', '^[0-9]+$', false, 3); $save['rule_type'] = AUTOMATION_RULE_TYPE_TREE_MATCH; $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); $save['operation'] = form_input_validate(get_nfilter_request_var('operation'), 'operation', '^[-0-9]+$', true, 3); $save['field'] = form_input_validate(((isset_request_var('field') && get_nfilter_request_var('field') != '0') ? get_nfilter_request_var('field') : ''), 'field', '', true, 3); $save['operator'] = form_input_validate((isset_request_var('operator') ? get_nfilter_request_var('operator') : ''), 'operator', '^[0-9]+$', true, 3); $save['pattern'] = form_input_validate((isset_request_var('pattern') ? get_nfilter_request_var('pattern') : ''), 'pattern', '', true, 3); if (!is_error_message()) { $item_id = sql_save($save, 'automation_match_rule_items'); if ($item_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message()) { header('Location: automation_tree_rules.php?header=false&action=item_edit&id=' . get_request_var('id') . '&item_id=' . (empty($item_id) ? get_request_var('item_id') : $item_id) . '&rule_type=' . AUTOMATION_RULE_TYPE_TREE_MATCH); } else { header('Location: automation_tree_rules.php?header=false&action=edit&id=' . get_request_var('id') . '&rule_type=' . AUTOMATION_RULE_TYPE_TREE_MATCH); } } elseif (isset_request_var('save_component_automation_tree_rule_item')) { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); /* ==================================================== */ unset($save); $save['id'] = form_input_validate(get_request_var('item_id'), 'item_id', '^[0-9]+$', false, 3); $save['rule_id'] = form_input_validate(get_request_var('id'), 'id', '^[0-9]+$', false, 3); $save['sequence'] = form_input_validate(get_nfilter_request_var('sequence'), 'sequence', '^[0-9]+$', false, 3); $save['field'] = form_input_validate((isset_request_var('field') ? get_nfilter_request_var('field') : ''), 'field', '', true, 3); $save['sort_type'] = form_input_validate(get_nfilter_request_var('sort_type'), 'sort_type', '^[0-9]+$', false, 3); $save['propagate_changes'] = (isset_request_var('propagate_changes') ? 'on' : ''); $save['search_pattern'] = isset_request_var('search_pattern') ? form_input_validate(get_nfilter_request_var('search_pattern'), 'search_pattern', '', false, 3) : ''; $save['replace_pattern'] = isset_request_var('replace_pattern') ? form_input_validate(get_nfilter_request_var('replace_pattern'), 'replace_pattern', '', true, 3) : ''; if (!is_error_message()) { $automation_graph_rule_item_id = sql_save($save, 'automation_tree_rule_items'); if ($automation_graph_rule_item_id) { raise_message(1); } else { raise_message(2); } } if (is_error_message()) { header('Location: automation_tree_rules.php?header=false&action=item_edit&id=' . get_request_var('id') . '&item_id=' . (empty($automation_graph_rule_item_id) ? get_request_var('item_id') : $automation_graph_rule_item_id) . '&rule_type=' . AUTOMATION_RULE_TYPE_TREE_ACTION); } else { header('Location: automation_tree_rules.php?header=false&action=edit&id=' . get_request_var('id') . '&rule_type=' . AUTOMATION_RULE_TYPE_TREE_ACTION); } } else { raise_message(2); header('Location: automation_tree_rules.php?header=false'); } } /* ------------------------ The 'actions' function ------------------------ */ function automation_tree_rules_form_actions() { global $automation_tree_rules_actions; global $config; /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_DELETE) { /* DELETE */ cacti_log('form_actions DELETE: ' . serialize($selected_items), true, 'AUTOM8 TRACE', POLLER_VERBOSITY_MEDIUM); db_execute('DELETE FROM automation_tree_rules WHERE ' . array_to_sql_or($selected_items, 'id')); db_execute('DELETE FROM automation_tree_rule_items WHERE ' . array_to_sql_or($selected_items, 'rule_id')); db_execute('DELETE FROM automation_match_rule_items WHERE ' . array_to_sql_or($selected_items, 'rule_id')); } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_DUPLICATE) { /* duplicate */ for ($i=0;($i $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $automation_tree_rules_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT name FROM automation_tree_rules WHERE id = ?', array($matches[1]))) . '
  • '; $automation_tree_rules_array[] = $matches[1]; } } top_header(); form_start('automation_tree_rules.php', 'automation_tree_rules_action'); html_start_box($automation_tree_rules_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_DELETE) { /* DELETE */ print "

    " . __('Click \'Continue\' to delete the following Rule(s).') . "

      $automation_tree_rules_list
    \n"; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_DUPLICATE) { /* duplicate */ print "

    " . __('Click \'Continue\' to duplicate the following Rule(s). You can optionally change the title format for the new Rules.') . "

      $automation_tree_rules_list

    " . __('Title Format') . '
    '; form_text_box('name_format', '<' . __('rule_name') . '> (1)', '', '255', '30', 'text'); print "

    \n"; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_ENABLE) { /* enable */ print "

    " . __('Click \'Continue\' to enable the following Rule(s).') . "

      $automation_tree_rules_list

    " . __('Make sure, that those rules have successfully been tested!') . "

    \n"; } elseif (get_nfilter_request_var('drp_action') == AUTOMATION_ACTION_TREE_DISABLE) { /* disable */ print "

    " . __('Click \'Continue\' to disable the following Rule(s).') . "

      $automation_tree_rules_list
    \n"; } if (!isset($automation_tree_rules_array)) { raise_message(40); header('Location: automation_tree_rules.php?header=false'); exit; }else { $save_html = " "; } print " $save_html \n"; html_end_box(); form_end(); bottom_footer(); } function automation_tree_rules_change_leaf() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('leaf_type'); /* ==================================================== */ automation_change_tree_rule_leaf_type(get_request_var('leaf_type'), get_request_var('id')); } /* -------------------------- Rule Item Functions -------------------------- */ function automation_tree_rules_item_movedown() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_MATCH) { move_item_down('automation_match_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id') . ' AND rule_type=' . get_request_var('rule_type')); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_ACTION) { move_item_down('automation_tree_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id')); } } function automation_tree_rules_item_moveup() { /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_MATCH) { move_item_up('automation_match_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id') . ' AND rule_type=' . get_request_var('rule_type')); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_ACTION) { move_item_up('automation_tree_rule_items', get_request_var('item_id'), 'rule_id=' . get_request_var('id')); } } function automation_tree_rules_item_remove() { /* ================= input validation ================= */ get_filter_request_var('item_id'); get_filter_request_var('rule_type'); /* ==================================================== */ if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_MATCH) { db_execute_prepared('DELETE FROM automation_match_rule_items WHERE id = ?', array(get_request_var('item_id'))); } elseif (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_ACTION) { db_execute_prepared('DELETE FROM automation_tree_rule_items WHERE id = ?', array(get_request_var('item_id'))); } } function automation_tree_rules_item_edit() { global $config; /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('item_id'); get_filter_request_var('rule_type'); get_filter_request_var('show_trees'); /* ==================================================== */ /* handle show_trees mode */ if (isset_request_var('show_trees')) { if (get_request_var('show_trees') == '0') { kill_session_var('automation_tree_rules_show_trees'); } elseif (get_request_var('show_trees') == '1') { $_SESSION['automation_tree_rules_show_trees'] = true; } } if (!isempty_request_var('rule_type') && !isempty_request_var('item_id')) { if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_ACTION) { $item = db_fetch_row_prepared('SELECT * FROM automation_tree_rule_items WHERE id = ?', array(get_request_var('item_id'))); if ($item['field'] != AUTOMATION_TREE_ITEM_TYPE_STRING) { ?>
    *'>

    '; /* display list of matching trees */ if (!isempty_request_var('rule_type') && !isempty_request_var('item_id')) { if (get_request_var('rule_type') == AUTOMATION_RULE_TYPE_TREE_ACTION) { if (isset($_SESSION['automation_tree_rules_show_trees']) && ($item['field'] != AUTOMATION_TREE_ITEM_TYPE_STRING)) { if ($_SESSION['automation_tree_rules_show_trees']) { display_matching_trees(get_request_var('id'), AUTOMATION_RULE_TYPE_TREE_ACTION, $item, 'automation_tree_rules.php?action=item_edit&id=' . get_request_var('id') . '&item_id=' . get_request_var('item_id') . '&rule_type=' . get_request_var('rule_type')); } } } } //Now we need some javascript to make it dynamic ?>
    *'>
    array('no_form_tag' => true), 'fields' => inject_form_variables($form_array, (isset($rule) ? $rule : array())) )); form_hidden_box('id', (isset($rule['id']) ? $rule['id'] : '0'), ''); form_hidden_box('item_id', (isset($rule['item_id']) ? $rule['item_id'] : '0'), ''); form_hidden_box('save_component_automation_tree_rule', '1', ''); html_end_box(true, true); /* * display the rule items ------------------------------------------------------------------------------- */ if (!empty($rule['id'])) { # display tree rules for host match display_match_rule_items(__('Object Selection Criteria'), $rule['id'], AUTOMATION_RULE_TYPE_TREE_MATCH, 'automation_tree_rules.php'); # fetch tree action rules display_tree_rule_items(__('Tree Creation Criteria'), $rule['id'], $rule['leaf_type'], AUTOMATION_RULE_TYPE_TREE_ACTION, 'automation_tree_rules.php'); } form_save_button('automation_tree_rules.php', 'return'); print '
    '; if (!empty($rule['id'])) { /* display list of matching hosts */ if (isset($_SESSION['automation_tree_rules_show_objects'])) { if ($_SESSION['automation_tree_rules_show_objects']) { if ($rule['leaf_type'] == TREE_ITEM_TYPE_HOST) { display_matching_hosts($rule, AUTOMATION_RULE_TYPE_TREE_MATCH, 'automation_tree_rules.php?action=edit&id=' . get_request_var('id')); } elseif ($rule['leaf_type'] == TREE_ITEM_TYPE_GRAPH) { display_matching_graphs($rule, AUTOMATION_RULE_TYPE_TREE_MATCH, 'automation_tree_rules.php?action=edit&id=' . get_request_var('id')); } } } } ?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'status' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '' ) ); validate_store_request_vars($filters, 'sess_autom_tr'); /* ================= input validation ================= */ if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } html_start_box(__('Tree Rules'), '100%', '', '3', 'center', 'automation_tree_rules.php?action=edit'); ?>
    '> '> '>
    array('display' => __('Rule Name'), 'align' => 'left', 'sort' => 'ASC'), 'id' => array('display' => __('ID'), 'align' => 'right', 'sort' => 'ASC'), 'tree_name' => array('display' => __('Hook into Tree'), 'align' => 'left', 'sort' => 'ASC'), 'subtree_name' => array('display' => __('At Subtree'), 'align' => 'left', 'sort' => 'ASC'), 'leaf_type' => array('display' => __('This Type'), 'align' => 'left', 'sort' => 'ASC'), 'host_grouping_type' => array('display' => __('Using Grouping'), 'align' => 'left', 'sort' => 'ASC'), 'enabled' => array('display' => __('Enabled'), 'align' => 'right', 'sort' => 'ASC') ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); if (cacti_sizeof($automation_tree_rules)) { foreach ($automation_tree_rules as $automation_tree_rule) { $tree_item_type_name = ((empty($automation_tree_rule['leaf_type'])) ? '' . __('None') . '' : $automation_tree_item_types[$automation_tree_rule['leaf_type']]); $subtree_name = ((empty($automation_tree_rule['subtree_name'])) ? '' . __('ROOT') . '' : html_escape($automation_tree_rule['subtree_name'])); $tree_host_grouping_type = ((empty($host_group_types[$automation_tree_rule['host_grouping_type']])) ? '' : $host_group_types[$automation_tree_rule['host_grouping_type']]); form_alternate_row('line' . $automation_tree_rule['id'], true); form_selectable_cell(filter_value($automation_tree_rule['name'], get_request_var('filter'), 'automation_tree_rules.php?action=edit&id=' . $automation_tree_rule['id'] . '&page=1'), $automation_tree_rule['id']); form_selectable_cell($automation_tree_rule['id'], $automation_tree_rule['id'], '', 'text-align:right'); form_selectable_ecell($automation_tree_rule['tree_name'], $automation_tree_rule['id']); form_selectable_cell($subtree_name, $automation_tree_rule['id']); form_selectable_cell($tree_item_type_name, $automation_tree_rule['id']); form_selectable_cell($tree_host_grouping_type, $automation_tree_rule['id']); form_selectable_cell($automation_tree_rule['enabled'] ? __('Enabled'):__('Disabled'), $automation_tree_rule['id'], '', 'text-align:right'); form_checkbox_cell($automation_tree_rule['name'], $automation_tree_rule['id']); form_end_row(); } } else { print "" . __('No Tree Rules Found') . "\n"; } html_end_box(false); if (cacti_sizeof($automation_tree_rules)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($automation_tree_rules_actions); form_end(); } cacti-release-1.2.26/boost_rrdupdate.php000077500000000000000000000056171454067461500202440ustar00rootroot00000000000000#!/usr/bin/env php Require all denied # Apache 2.2 Order Allow,Deny Deny from all cacti-release-1.2.26/cache/boost/index.php000066400000000000000000000030621454067461500203310ustar00rootroot00000000000000 Require all denied # Apache 2.2 Order Allow,Deny Deny from all cacti-release-1.2.26/cache/mibcache/index.php000066400000000000000000000030651454067461500207410ustar00rootroot00000000000000 Require all denied # Apache 2.2 Order Allow,Deny Deny from all cacti-release-1.2.26/cache/realtime/index.php000066400000000000000000000030621454067461500210050ustar00rootroot00000000000000 Require all denied # Apache 2.2 Order Allow,Deny Deny from all cacti-release-1.2.26/cache/spikekill/index.php000066400000000000000000000030621454067461500211720ustar00rootroot00000000000000 dark, 4 colors'); INSERT INTO `color_templates` VALUES (2,'Red: light yellow > dark red, 8 colors'); INSERT INTO `color_templates` VALUES (3,'Red: light -> dark, 16 colors'); INSERT INTO `color_templates` VALUES (4,'Green: dark -> light, 16 colors'); -- -- Table structure for table `color_template_items` -- CREATE TABLE `color_template_items` ( `color_template_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `color_template_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `color_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `sequence` mediumint(8) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`color_template_item_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Color Items for Color Templates'; -- -- Dumping data for table `color_template_items` -- INSERT INTO `color_template_items` VALUES (1,1,4,1); INSERT INTO `color_template_items` VALUES (2,1,24,2); INSERT INTO `color_template_items` VALUES (3,1,98,3); INSERT INTO `color_template_items` VALUES (4,1,25,4); INSERT INTO `color_template_items` VALUES (5,2,25,1); INSERT INTO `color_template_items` VALUES (6,2,29,2); INSERT INTO `color_template_items` VALUES (7,2,30,3); INSERT INTO `color_template_items` VALUES (8,2,31,4); INSERT INTO `color_template_items` VALUES (9,2,33,5); INSERT INTO `color_template_items` VALUES (10,2,35,6); INSERT INTO `color_template_items` VALUES (11,2,41,7); INSERT INTO `color_template_items` VALUES (12,2,9,8); INSERT INTO `color_template_items` VALUES (13,3,15,1); INSERT INTO `color_template_items` VALUES (14,3,31,2); INSERT INTO `color_template_items` VALUES (15,3,28,3); INSERT INTO `color_template_items` VALUES (16,3,8,4); INSERT INTO `color_template_items` VALUES (17,3,34,5); INSERT INTO `color_template_items` VALUES (18,3,33,6); INSERT INTO `color_template_items` VALUES (19,3,35,7); INSERT INTO `color_template_items` VALUES (20,3,41,8); INSERT INTO `color_template_items` VALUES (21,3,36,9); INSERT INTO `color_template_items` VALUES (22,3,42,10); INSERT INTO `color_template_items` VALUES (23,3,44,11); INSERT INTO `color_template_items` VALUES (24,3,48,12); INSERT INTO `color_template_items` VALUES (25,3,9,13); INSERT INTO `color_template_items` VALUES (26,3,49,14); INSERT INTO `color_template_items` VALUES (27,3,51,15); INSERT INTO `color_template_items` VALUES (28,3,52,16); INSERT INTO `color_template_items` VALUES (29,4,76,1); INSERT INTO `color_template_items` VALUES (30,4,84,2); INSERT INTO `color_template_items` VALUES (31,4,89,3); INSERT INTO `color_template_items` VALUES (32,4,17,4); INSERT INTO `color_template_items` VALUES (33,4,86,5); INSERT INTO `color_template_items` VALUES (34,4,88,6); INSERT INTO `color_template_items` VALUES (35,4,90,7); INSERT INTO `color_template_items` VALUES (36,4,94,8); INSERT INTO `color_template_items` VALUES (37,4,96,9); INSERT INTO `color_template_items` VALUES (38,4,93,10); INSERT INTO `color_template_items` VALUES (39,4,91,11); INSERT INTO `color_template_items` VALUES (40,4,22,12); INSERT INTO `color_template_items` VALUES (41,4,12,13); INSERT INTO `color_template_items` VALUES (42,4,95,14); INSERT INTO `color_template_items` VALUES (43,4,6,15); INSERT INTO `color_template_items` VALUES (44,4,92,16); -- -- Table structure for table `colors` -- CREATE TABLE colors ( id mediumint(8) unsigned NOT NULL auto_increment, name varchar(40) default '', hex varchar(6) NOT NULL default '', read_only char(2) default '', PRIMARY KEY (id), UNIQUE KEY hex (hex) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `colors` -- INSERT INTO colors VALUES (1,'Black','000000','on'); INSERT INTO colors VALUES (2,'White','FFFFFF','on'); INSERT INTO colors VALUES (4,'','FAFD9E',''); INSERT INTO colors VALUES (5,'','C0C0C0',''); INSERT INTO colors VALUES (6,'','74C366',''); INSERT INTO colors VALUES (7,'','6DC8FE',''); INSERT INTO colors VALUES (8,'','EA8F00',''); INSERT INTO colors VALUES (9,'Red','FF0000','on'); INSERT INTO colors VALUES (10,'','4444FF',''); INSERT INTO colors VALUES (11,'Magenta','FF00FF','on'); INSERT INTO colors VALUES (12,'Green','00FF00','on'); INSERT INTO colors VALUES (13,'','8D85F3',''); INSERT INTO colors VALUES (14,'','AD3B6E',''); INSERT INTO colors VALUES (15,'','EACC00',''); INSERT INTO colors VALUES (16,'','12B3B5',''); INSERT INTO colors VALUES (17,'','157419',''); INSERT INTO colors VALUES (18,'','C4FD3D',''); INSERT INTO colors VALUES (19,'','817C4E',''); INSERT INTO colors VALUES (20,'','002A97',''); INSERT INTO colors VALUES (21,'','0000FF',''); INSERT INTO colors VALUES (22,'','00CF00',''); INSERT INTO colors VALUES (24,'','F9FD5F',''); INSERT INTO colors VALUES (25,'','FFF200',''); INSERT INTO colors VALUES (26,'','CCBB00',''); INSERT INTO colors VALUES (27,'','837C04',''); INSERT INTO colors VALUES (28,'','EAAF00',''); INSERT INTO colors VALUES (29,'','FFD660',''); INSERT INTO colors VALUES (30,'','FFC73B',''); INSERT INTO colors VALUES (31,'','FFAB00',''); INSERT INTO colors VALUES (33,'','FF7D00',''); INSERT INTO colors VALUES (34,'','ED7600',''); INSERT INTO colors VALUES (35,'','FF5700',''); INSERT INTO colors VALUES (36,'','EE5019',''); INSERT INTO colors VALUES (37,'','B1441E',''); INSERT INTO colors VALUES (38,'','FFC3C0',''); INSERT INTO colors VALUES (39,'','FF897C',''); INSERT INTO colors VALUES (40,'','FF6044',''); INSERT INTO colors VALUES (41,'','FF4105',''); INSERT INTO colors VALUES (42,'','DA4725',''); INSERT INTO colors VALUES (43,'','942D0C',''); INSERT INTO colors VALUES (44,'','FF3932',''); INSERT INTO colors VALUES (45,'','862F2F',''); INSERT INTO colors VALUES (46,'','FF5576',''); INSERT INTO colors VALUES (47,'','562B29',''); INSERT INTO colors VALUES (48,'','F51D30',''); INSERT INTO colors VALUES (49,'','DE0056',''); INSERT INTO colors VALUES (50,'','ED5394',''); INSERT INTO colors VALUES (51,'','B90054',''); INSERT INTO colors VALUES (52,'','8F005C',''); INSERT INTO colors VALUES (53,'','F24AC8',''); INSERT INTO colors VALUES (54,'','E8CDEF',''); INSERT INTO colors VALUES (55,'','D8ACE0',''); INSERT INTO colors VALUES (56,'','A150AA',''); INSERT INTO colors VALUES (57,'','750F7D',''); INSERT INTO colors VALUES (58,'','8D00BA',''); INSERT INTO colors VALUES (59,'','623465',''); INSERT INTO colors VALUES (60,'','55009D',''); INSERT INTO colors VALUES (61,'','3D168B',''); INSERT INTO colors VALUES (62,'','311F4E',''); INSERT INTO colors VALUES (63,'','D2D8F9',''); INSERT INTO colors VALUES (64,'','9FA4EE',''); INSERT INTO colors VALUES (65,'','6557D0',''); INSERT INTO colors VALUES (66,'','4123A1',''); INSERT INTO colors VALUES (67,'','4668E4',''); INSERT INTO colors VALUES (68,'','0D006A',''); INSERT INTO colors VALUES (69,'','00004D',''); INSERT INTO colors VALUES (70,'','001D61',''); INSERT INTO colors VALUES (71,'','00234B',''); INSERT INTO colors VALUES (72,'','002A8F',''); INSERT INTO colors VALUES (73,'','2175D9',''); INSERT INTO colors VALUES (74,'','7CB3F1',''); INSERT INTO colors VALUES (75,'','005199',''); INSERT INTO colors VALUES (76,'','004359',''); INSERT INTO colors VALUES (77,'','00A0C1',''); INSERT INTO colors VALUES (78,'','007283',''); INSERT INTO colors VALUES (79,'','00BED9',''); INSERT INTO colors VALUES (80,'','AFECED',''); INSERT INTO colors VALUES (81,'','55D6D3',''); INSERT INTO colors VALUES (82,'','00BBB4',''); INSERT INTO colors VALUES (83,'','009485',''); INSERT INTO colors VALUES (84,'','005D57',''); INSERT INTO colors VALUES (85,'','008A77',''); INSERT INTO colors VALUES (86,'','008A6D',''); INSERT INTO colors VALUES (87,'','00B99B',''); INSERT INTO colors VALUES (88,'','009F67',''); INSERT INTO colors VALUES (89,'','00694A',''); INSERT INTO colors VALUES (90,'','00A348',''); INSERT INTO colors VALUES (91,'','00BF47',''); INSERT INTO colors VALUES (92,'','96E78A',''); INSERT INTO colors VALUES (93,'','00BD27',''); INSERT INTO colors VALUES (94,'','35962B',''); INSERT INTO colors VALUES (95,'','7EE600',''); INSERT INTO colors VALUES (96,'','6EA100',''); INSERT INTO colors VALUES (97,'','CAF100',''); INSERT INTO colors VALUES (98,'','F5F800',''); INSERT INTO colors VALUES (99,'','CDCFC4',''); INSERT INTO colors VALUES (100,'','BCBEB3',''); INSERT INTO colors VALUES (101,'','AAABA1',''); INSERT INTO colors VALUES (102,'','8F9286',''); INSERT INTO colors VALUES (103,'','797C6E',''); INSERT INTO colors VALUES (104,'','2E3127',''); INSERT INTO colors VALUES (105,'Night','0C090A','on'); INSERT INTO colors VALUES (106,'Gunmetal','2C3539','on'); INSERT INTO colors VALUES (107,'Midnight','2B1B17','on'); INSERT INTO colors VALUES (108,'Charcoal','34282C','on'); INSERT INTO colors VALUES (109,'Dark Slate Grey','25383C','on'); INSERT INTO colors VALUES (110,'Oil','3B3131','on'); INSERT INTO colors VALUES (111,'Black Cat','413839','on'); INSERT INTO colors VALUES (112,'Iridium','3D3C3A','on'); INSERT INTO colors VALUES (113,'Black Eel','463E3F','on'); INSERT INTO colors VALUES (114,'Black Cow','4C4646','on'); INSERT INTO colors VALUES (115,'Gray Wolf','504A4B','on'); INSERT INTO colors VALUES (116,'Vampire Gray','565051','on'); INSERT INTO colors VALUES (117,'Gray Dolphin','5C5858','on'); INSERT INTO colors VALUES (118,'Carbon Gray','625D5D','on'); INSERT INTO colors VALUES (119,'Ash Gray','666362','on'); INSERT INTO colors VALUES (120,'Cloudy Gray','6D6968','on'); INSERT INTO colors VALUES (121,'Smokey Gray','726E6D','on'); INSERT INTO colors VALUES (122,'Gray','736F6E','on'); INSERT INTO colors VALUES (123,'Granite','837E7C','on'); INSERT INTO colors VALUES (124,'Battleship Gray','848482','on'); INSERT INTO colors VALUES (125,'Gray Cloud','B6B6B4','on'); INSERT INTO colors VALUES (126,'Gray Goose','D1D0CE','on'); INSERT INTO colors VALUES (127,'Platinum','E5E4E2','on'); INSERT INTO colors VALUES (128,'Metallic Silver','BCC6CC','on'); INSERT INTO colors VALUES (129,'Blue Gray','98AFC7','on'); INSERT INTO colors VALUES (130,'Light Slate Gray','6D7B8D','on'); INSERT INTO colors VALUES (131,'Slate Gray','657383','on'); INSERT INTO colors VALUES (132,'Jet Gray','616D7E','on'); INSERT INTO colors VALUES (133,'Mist Blue','646D7E','on'); INSERT INTO colors VALUES (134,'Marble Blue','566D7E','on'); INSERT INTO colors VALUES (135,'Slate Blue','737CA1','on'); INSERT INTO colors VALUES (136,'Steel Blue','4863A0','on'); INSERT INTO colors VALUES (137,'Blue Jay','2B547E','on'); INSERT INTO colors VALUES (138,'Dark Slate Blue','2B3856','on'); INSERT INTO colors VALUES (139,'Midnight Blue','151B54','on'); INSERT INTO colors VALUES (140,'Navy Blue','000080','on'); INSERT INTO colors VALUES (141,'Blue Whale','342D7E','on'); INSERT INTO colors VALUES (142,'Lapis Blue','15317E','on'); INSERT INTO colors VALUES (143,'Cornflower Blue','151B8D','on'); INSERT INTO colors VALUES (144,'Earth Blue','0000A0','on'); INSERT INTO colors VALUES (145,'Cobalt Blue','0020C2','on'); INSERT INTO colors VALUES (146,'Blueberry Blue','0041C2','on'); INSERT INTO colors VALUES (147,'Sapphire Blue','2554C7','on'); INSERT INTO colors VALUES (148,'Blue Eyes','1569C7','on'); INSERT INTO colors VALUES (149,'Royal Blue','2B60DE','on'); INSERT INTO colors VALUES (150,'Blue Orchid','1F45FC','on'); INSERT INTO colors VALUES (151,'Blue Lotus','6960EC','on'); INSERT INTO colors VALUES (152,'Light Slate Blue','736AFF','on'); INSERT INTO colors VALUES (153,'Slate Blue','357EC7','on'); INSERT INTO colors VALUES (154,'Glacial Blue Ice','368BC1','on'); INSERT INTO colors VALUES (155,'Silk Blue','488AC7','on'); INSERT INTO colors VALUES (156,'Blue Ivy','3090C7','on'); INSERT INTO colors VALUES (157,'Blue Koi','659EC7','on'); INSERT INTO colors VALUES (158,'Columbia Blue','87AFC7','on'); INSERT INTO colors VALUES (159,'Baby Blue','95B9C7','on'); INSERT INTO colors VALUES (160,'Light Steel Blue','728FCE','on'); INSERT INTO colors VALUES (161,'Ocean Blue','2B65EC','on'); INSERT INTO colors VALUES (162,'Blue Ribbon','306EFF','on'); INSERT INTO colors VALUES (163,'Blue Dress','157DEC','on'); INSERT INTO colors VALUES (164,'Dodger Blue','1589FF','on'); INSERT INTO colors VALUES (165,'Cornflower Blue','6495ED','on'); INSERT INTO colors VALUES (166,'Sky Blue','6698FF','on'); INSERT INTO colors VALUES (167,'Butterfly Blue','38ACEC','on'); INSERT INTO colors VALUES (168,'Iceberg','56A5EC','on'); INSERT INTO colors VALUES (169,'Crystal Blue','5CB3FF','on'); INSERT INTO colors VALUES (170,'Deep Sky Blue','3BB9FF','on'); INSERT INTO colors VALUES (171,'Denim Blue','79BAEC','on'); INSERT INTO colors VALUES (172,'Light Sky Blue','82CAFA','on'); INSERT INTO colors VALUES (173,'Day Sky Blue','82CAFF','on'); INSERT INTO colors VALUES (174,'Jeans Blue','A0CFEC','on'); INSERT INTO colors VALUES (175,'Blue Angel','B7CEEC','on'); INSERT INTO colors VALUES (176,'Pastel Blue','B4CFEC','on'); INSERT INTO colors VALUES (177,'Sea Blue','C2DFFF','on'); INSERT INTO colors VALUES (178,'Powder Blue','C6DEFF','on'); INSERT INTO colors VALUES (179,'Coral Blue','AFDCEC','on'); INSERT INTO colors VALUES (180,'Light Blue','ADDFFF','on'); INSERT INTO colors VALUES (181,'Robin Egg Blue','BDEDFF','on'); INSERT INTO colors VALUES (182,'Pale Blue Lily','CFECEC','on'); INSERT INTO colors VALUES (183,'Light Cyan','E0FFFF','on'); INSERT INTO colors VALUES (184,'Water','EBF4FA','on'); INSERT INTO colors VALUES (185,'Alice Blue','F0F8FF','on'); INSERT INTO colors VALUES (186,'Azure','F0FFFF','on'); INSERT INTO colors VALUES (187,'Light Slate','CCFFFF','on'); INSERT INTO colors VALUES (188,'Light Aquamarine','93FFE8','on'); INSERT INTO colors VALUES (189,'Electric Blue','9AFEFF','on'); INSERT INTO colors VALUES (190,'Aquamarine','7FFFD4','on'); INSERT INTO colors VALUES (191,'Cyan or Aqua','00FFFF','on'); INSERT INTO colors VALUES (192,'Tron Blue','7DFDFE','on'); INSERT INTO colors VALUES (193,'Blue Zircon','57FEFF','on'); INSERT INTO colors VALUES (194,'Blue Lagoon','8EEBEC','on'); INSERT INTO colors VALUES (195,'Celeste','50EBEC','on'); INSERT INTO colors VALUES (196,'Blue Diamond','4EE2EC','on'); INSERT INTO colors VALUES (197,'Tiffany Blue','81D8D0','on'); INSERT INTO colors VALUES (198,'Cyan Opaque','92C7C7','on'); INSERT INTO colors VALUES (199,'Blue Hosta','77BFC7','on'); INSERT INTO colors VALUES (200,'Northern Lights Blue','78C7C7','on'); INSERT INTO colors VALUES (201,'Medium Turquoise','48CCCD','on'); INSERT INTO colors VALUES (202,'Turquoise','43C6DB','on'); INSERT INTO colors VALUES (203,'Jellyfish','46C7C7','on'); INSERT INTO colors VALUES (204,'Macaw Blue Green','43BFC7','on'); INSERT INTO colors VALUES (205,'Light Sea Green','3EA99F','on'); INSERT INTO colors VALUES (206,'Dark Turquoise','3B9C9C','on'); INSERT INTO colors VALUES (207,'Sea Turtle Green','438D80','on'); INSERT INTO colors VALUES (208,'Medium Aquamarine','348781','on'); INSERT INTO colors VALUES (209,'Greenish Blue','307D7E','on'); INSERT INTO colors VALUES (210,'Grayish Turquoise','5E7D7E','on'); INSERT INTO colors VALUES (211,'Beetle Green','4C787E','on'); INSERT INTO colors VALUES (212,'Teal','008080','on'); INSERT INTO colors VALUES (213,'Sea Green','4E8975','on'); INSERT INTO colors VALUES (214,'Camouflage Green','78866B','on'); INSERT INTO colors VALUES (215,'Sage Green','848b79','on'); INSERT INTO colors VALUES (216,'Hazel Green','617C58','on'); INSERT INTO colors VALUES (217,'Venom Green','728C00','on'); INSERT INTO colors VALUES (218,'Fern Green','667C26','on'); INSERT INTO colors VALUES (219,'Dark Forrest Green','254117','on'); INSERT INTO colors VALUES (220,'Medium Sea Green','306754','on'); INSERT INTO colors VALUES (221,'Medium Forest Green','347235','on'); INSERT INTO colors VALUES (222,'Seaweed Green','437C17','on'); INSERT INTO colors VALUES (223,'Pine Green','387C44','on'); INSERT INTO colors VALUES (224,'Jungle Green','347C2C','on'); INSERT INTO colors VALUES (225,'Shamrock Green','347C17','on'); INSERT INTO colors VALUES (226,'Medium Spring Green','348017','on'); INSERT INTO colors VALUES (227,'Forest Green','4E9258','on'); INSERT INTO colors VALUES (228,'Green Onion','6AA121','on'); INSERT INTO colors VALUES (229,'Spring Green','4AA02C','on'); INSERT INTO colors VALUES (230,'Lime Green','41A317','on'); INSERT INTO colors VALUES (231,'Clover Green','3EA055','on'); INSERT INTO colors VALUES (232,'Green Snake','6CBB3C','on'); INSERT INTO colors VALUES (233,'Alien Green','6CC417','on'); INSERT INTO colors VALUES (234,'Green Apple','4CC417','on'); INSERT INTO colors VALUES (235,'Yellow Green','52D017','on'); INSERT INTO colors VALUES (236,'Kelly Green','4CC552','on'); INSERT INTO colors VALUES (237,'Zombie Green','54C571','on'); INSERT INTO colors VALUES (238,'Frog Green','99C68E','on'); INSERT INTO colors VALUES (239,'Green Peas','89C35C','on'); INSERT INTO colors VALUES (240,'Dollar Bill Green','85BB65','on'); INSERT INTO colors VALUES (241,'Dark Sea Green','8BB381','on'); INSERT INTO colors VALUES (242,'Iguana Green','9CB071','on'); INSERT INTO colors VALUES (243,'Avocado Green','B2C248','on'); INSERT INTO colors VALUES (244,'Pistachio Green','9DC209','on'); INSERT INTO colors VALUES (245,'Salad Green','A1C935','on'); INSERT INTO colors VALUES (246,'Hummingbird Green','7FE817','on'); INSERT INTO colors VALUES (247,'Nebula Green','59E817','on'); INSERT INTO colors VALUES (248,'Stoplight Go Green','57E964','on'); INSERT INTO colors VALUES (249,'Algae Green','64E986','on'); INSERT INTO colors VALUES (250,'Jade Green','5EFB6E','on'); INSERT INTO colors VALUES (251,'Emerald Green','5FFB17','on'); INSERT INTO colors VALUES (252,'Lawn Green','87F717','on'); INSERT INTO colors VALUES (253,'Chartreuse','8AFB17','on'); INSERT INTO colors VALUES (254,'Dragon Green','6AFB92','on'); INSERT INTO colors VALUES (255,'Mint green','98FF98','on'); INSERT INTO colors VALUES (256,'Green Thumb','B5EAAA','on'); INSERT INTO colors VALUES (257,'Light Jade','C3FDB8','on'); INSERT INTO colors VALUES (258,'Tea Green','CCFB5D','on'); INSERT INTO colors VALUES (259,'Green Yellow','B1FB17','on'); INSERT INTO colors VALUES (260,'Slime Green','BCE954','on'); INSERT INTO colors VALUES (261,'Goldenrod','EDDA74','on'); INSERT INTO colors VALUES (262,'Harvest Gold','EDE275','on'); INSERT INTO colors VALUES (263,'Sun Yellow','FFE87C','on'); INSERT INTO colors VALUES (264,'Yellow','FFFF00','on'); INSERT INTO colors VALUES (265,'Corn Yellow','FFF380','on'); INSERT INTO colors VALUES (266,'Parchment','FFFFC2','on'); INSERT INTO colors VALUES (267,'Cream','FFFFCC','on'); INSERT INTO colors VALUES (268,'Lemon Chiffon','FFF8C6','on'); INSERT INTO colors VALUES (269,'Cornsilk','FFF8DC','on'); INSERT INTO colors VALUES (270,'Beige','F5F5DC','on'); INSERT INTO colors VALUES (271,'Blonde','FBF6D9','on'); INSERT INTO colors VALUES (272,'Antique White','FAEBD7','on'); INSERT INTO colors VALUES (273,'Champagne','F7E7CE','on'); INSERT INTO colors VALUES (274,'Blanched Almond','FFEBCD','on'); INSERT INTO colors VALUES (275,'Vanilla','F3E5AB','on'); INSERT INTO colors VALUES (276,'Tan Brown','ECE5B6','on'); INSERT INTO colors VALUES (277,'Peach','FFE5B4','on'); INSERT INTO colors VALUES (278,'Mustard','FFDB58','on'); INSERT INTO colors VALUES (279,'Rubber Ducky Yellow','FFD801','on'); INSERT INTO colors VALUES (280,'Bright Gold','FDD017','on'); INSERT INTO colors VALUES (281,'Golden Brown','EAC117','on'); INSERT INTO colors VALUES (282,'Macaroni and Cheese','F2BB66','on'); INSERT INTO colors VALUES (283,'Saffron','FBB917','on'); INSERT INTO colors VALUES (284,'Beer','FBB117','on'); INSERT INTO colors VALUES (285,'Cantaloupe','FFA62F','on'); INSERT INTO colors VALUES (286,'Bee Yellow','E9AB17','on'); INSERT INTO colors VALUES (287,'Brown Sugar','E2A76F','on'); INSERT INTO colors VALUES (288,'BurlyWood','DEB887','on'); INSERT INTO colors VALUES (289,'Deep Peach','FFCBA4','on'); INSERT INTO colors VALUES (290,'Ginger Brown','C9BE62','on'); INSERT INTO colors VALUES (291,'School Bus Yellow','E8A317','on'); INSERT INTO colors VALUES (292,'Sandy Brown','EE9A4D','on'); INSERT INTO colors VALUES (293,'Fall Leaf Brown','C8B560','on'); INSERT INTO colors VALUES (294,'Orange Gold','D4A017','on'); INSERT INTO colors VALUES (295,'Sand','C2B280','on'); INSERT INTO colors VALUES (296,'Cookie Brown','C7A317','on'); INSERT INTO colors VALUES (297,'Caramel','C68E17','on'); INSERT INTO colors VALUES (298,'Brass','B5A642','on'); INSERT INTO colors VALUES (299,'Khaki','ADA96E','on'); INSERT INTO colors VALUES (300,'Camel Brown','C19A6B','on'); INSERT INTO colors VALUES (301,'Bronze','CD7F32','on'); INSERT INTO colors VALUES (302,'Tiger Orange','C88141','on'); INSERT INTO colors VALUES (303,'Cinnamon','C58917','on'); INSERT INTO colors VALUES (304,'Bullet Shell','AF9B60','on'); INSERT INTO colors VALUES (305,'Dark Goldenrod','AF7817','on'); INSERT INTO colors VALUES (306,'Copper','B87333','on'); INSERT INTO colors VALUES (307,'Wood','966F33','on'); INSERT INTO colors VALUES (308,'Oak Brown','806517','on'); INSERT INTO colors VALUES (309,'Moccasin','827839','on'); INSERT INTO colors VALUES (310,'Army Brown','827B60','on'); INSERT INTO colors VALUES (311,'Sandstone','786D5F','on'); INSERT INTO colors VALUES (312,'Mocha','493D26','on'); INSERT INTO colors VALUES (313,'Taupe','483C32','on'); INSERT INTO colors VALUES (314,'Coffee','6F4E37','on'); INSERT INTO colors VALUES (315,'Brown Bear','835C3B','on'); INSERT INTO colors VALUES (316,'Red Dirt','7F5217','on'); INSERT INTO colors VALUES (317,'Sepia','7F462C','on'); INSERT INTO colors VALUES (318,'Orange Salmon','C47451','on'); INSERT INTO colors VALUES (319,'Rust','C36241','on'); INSERT INTO colors VALUES (320,'Red Fox','C35817','on'); INSERT INTO colors VALUES (321,'Chocolate','C85A17','on'); INSERT INTO colors VALUES (322,'Sedona','CC6600','on'); INSERT INTO colors VALUES (323,'Papaya Orange','E56717','on'); INSERT INTO colors VALUES (324,'Halloween Orange','E66C2C','on'); INSERT INTO colors VALUES (325,'Pumpkin Orange','F87217','on'); INSERT INTO colors VALUES (326,'Construction Cone Orange','F87431','on'); INSERT INTO colors VALUES (327,'Sunrise Orange','E67451','on'); INSERT INTO colors VALUES (328,'Mango Orange','FF8040','on'); INSERT INTO colors VALUES (329,'Dark Orange','F88017','on'); INSERT INTO colors VALUES (330,'Coral','FF7F50','on'); INSERT INTO colors VALUES (331,'Basket Ball Orange','F88158','on'); INSERT INTO colors VALUES (332,'Light Salmon','F9966B','on'); INSERT INTO colors VALUES (333,'Tangerine','E78A61','on'); INSERT INTO colors VALUES (334,'Dark Salmon','E18B6B','on'); INSERT INTO colors VALUES (335,'Light Coral','E77471','on'); INSERT INTO colors VALUES (336,'Bean Red','F75D59','on'); INSERT INTO colors VALUES (337,'Valentine Red','E55451','on'); INSERT INTO colors VALUES (338,'Shocking Orange','E55B3C','on'); INSERT INTO colors VALUES (339,'Scarlet','FF2400','on'); INSERT INTO colors VALUES (340,'Ruby Red','F62217','on'); INSERT INTO colors VALUES (341,'Ferrari Red','F70D1A','on'); INSERT INTO colors VALUES (342,'Fire Engine Red','F62817','on'); INSERT INTO colors VALUES (343,'Lava Red','E42217','on'); INSERT INTO colors VALUES (344,'Love Red','E41B17','on'); INSERT INTO colors VALUES (345,'Grapefruit','DC381F','on'); INSERT INTO colors VALUES (346,'Chestnut Red','C34A2C','on'); INSERT INTO colors VALUES (347,'Cherry Red','C24641','on'); INSERT INTO colors VALUES (348,'Mahogany','C04000','on'); INSERT INTO colors VALUES (349,'Chilli Pepper','C11B17','on'); INSERT INTO colors VALUES (350,'Cranberry','9F000F','on'); INSERT INTO colors VALUES (351,'Red Wine','990012','on'); INSERT INTO colors VALUES (352,'Burgundy','8C001A','on'); INSERT INTO colors VALUES (353,'Chestnut','954535','on'); INSERT INTO colors VALUES (354,'Blood Red','7E3517','on'); INSERT INTO colors VALUES (355,'Sienna','8A4117','on'); INSERT INTO colors VALUES (356,'Sangria','7E3817','on'); INSERT INTO colors VALUES (357,'Firebrick','800517','on'); INSERT INTO colors VALUES (358,'Maroon','810541','on'); INSERT INTO colors VALUES (359,'Plum Pie','7D0541','on'); INSERT INTO colors VALUES (360,'Velvet Maroon','7E354D','on'); INSERT INTO colors VALUES (361,'Plum Velvet','7D0552','on'); INSERT INTO colors VALUES (362,'Rosy Finch','7F4E52','on'); INSERT INTO colors VALUES (363,'Puce','7F5A58','on'); INSERT INTO colors VALUES (364,'Dull Purple','7F525D','on'); INSERT INTO colors VALUES (365,'Rosy Brown','B38481','on'); INSERT INTO colors VALUES (366,'Khaki Rose','C5908E','on'); INSERT INTO colors VALUES (367,'Pink Bow','C48189','on'); INSERT INTO colors VALUES (368,'Lipstick Pink','C48793','on'); INSERT INTO colors VALUES (369,'Rose','E8ADAA','on'); INSERT INTO colors VALUES (370,'Desert Sand','EDC9AF','on'); INSERT INTO colors VALUES (371,'Pig Pink','FDD7E4','on'); INSERT INTO colors VALUES (372,'Cotton Candy','FCDFFF','on'); INSERT INTO colors VALUES (373,'Pink Bubblegum','FFDFDD','on'); INSERT INTO colors VALUES (374,'Misty Rose','FBBBB9','on'); INSERT INTO colors VALUES (375,'Pink','FAAFBE','on'); INSERT INTO colors VALUES (376,'Light Pink','FAAFBA','on'); INSERT INTO colors VALUES (377,'Flamingo Pink','F9A7B0','on'); INSERT INTO colors VALUES (378,'Pink Rose','E7A1B0','on'); INSERT INTO colors VALUES (379,'Pink Daisy','E799A3','on'); INSERT INTO colors VALUES (380,'Cadillac Pink','E38AAE','on'); INSERT INTO colors VALUES (381,'Carnation Pink','F778A1','on'); INSERT INTO colors VALUES (382,'Blush Red','E56E94','on'); INSERT INTO colors VALUES (383,'Hot Pink','F660AB','on'); INSERT INTO colors VALUES (384,'Watermelon Pink','FC6C85','on'); INSERT INTO colors VALUES (385,'Violet Red','F6358A','on'); INSERT INTO colors VALUES (386,'Deep Pink','F52887','on'); INSERT INTO colors VALUES (387,'Pink Cupcake','E45E9D','on'); INSERT INTO colors VALUES (388,'Pink Lemonade','E4287C','on'); INSERT INTO colors VALUES (389,'Neon Pink','F535AA','on'); INSERT INTO colors VALUES (390,'Dimorphotheca Magenta','E3319D','on'); INSERT INTO colors VALUES (391,'Bright Neon Pink','F433FF','on'); INSERT INTO colors VALUES (392,'Pale Violet Red','D16587','on'); INSERT INTO colors VALUES (393,'Tulip Pink','C25A7C','on'); INSERT INTO colors VALUES (394,'Medium Violet Red','CA226B','on'); INSERT INTO colors VALUES (395,'Rogue Pink','C12869','on'); INSERT INTO colors VALUES (396,'Burnt Pink','C12267','on'); INSERT INTO colors VALUES (397,'Bashful Pink','C25283','on'); INSERT INTO colors VALUES (398,'Carnation Pink','C12283','on'); INSERT INTO colors VALUES (399,'Plum','B93B8F','on'); INSERT INTO colors VALUES (400,'Viola Purple','7E587E','on'); INSERT INTO colors VALUES (401,'Purple Iris','571B7E','on'); INSERT INTO colors VALUES (402,'Plum Purple','583759','on'); INSERT INTO colors VALUES (403,'Indigo','4B0082','on'); INSERT INTO colors VALUES (404,'Purple Monster','461B7E','on'); INSERT INTO colors VALUES (405,'Purple Haze','4E387E','on'); INSERT INTO colors VALUES (406,'Eggplant','614051','on'); INSERT INTO colors VALUES (407,'Grape','5E5A80','on'); INSERT INTO colors VALUES (408,'Purple Jam','6A287E','on'); INSERT INTO colors VALUES (409,'Dark Orchid','7D1B7E','on'); INSERT INTO colors VALUES (410,'Purple Flower','A74AC7','on'); INSERT INTO colors VALUES (411,'Medium Orchid','B048B5','on'); INSERT INTO colors VALUES (412,'Purple Amethyst','6C2DC7','on'); INSERT INTO colors VALUES (413,'Dark Violet','842DCE','on'); INSERT INTO colors VALUES (414,'Violet','8D38C9','on'); INSERT INTO colors VALUES (415,'Purple Sage Bush','7A5DC7','on'); INSERT INTO colors VALUES (416,'Lovely Purple','7F38EC','on'); INSERT INTO colors VALUES (417,'Purple','8E35EF','on'); INSERT INTO colors VALUES (418,'Aztech Purple','893BFF','on'); INSERT INTO colors VALUES (419,'Medium Purple','8467D7','on'); INSERT INTO colors VALUES (420,'Jasmine Purple','A23BEC','on'); INSERT INTO colors VALUES (421,'Purple Daffodil','B041FF','on'); INSERT INTO colors VALUES (422,'Tyrian Purple','C45AEC','on'); INSERT INTO colors VALUES (423,'Crocus Purple','9172EC','on'); INSERT INTO colors VALUES (424,'Purple Mimosa','9E7BFF','on'); INSERT INTO colors VALUES (425,'Heliotrope Purple','D462FF','on'); INSERT INTO colors VALUES (426,'Crimson','E238EC','on'); INSERT INTO colors VALUES (427,'Purple Dragon','C38EC7','on'); INSERT INTO colors VALUES (428,'Lilac','C8A2C8','on'); INSERT INTO colors VALUES (429,'Blush Pink','E6A9EC','on'); INSERT INTO colors VALUES (430,'Mauve','E0B0FF','on'); INSERT INTO colors VALUES (431,'Wisteria Purple','C6AEC7','on'); INSERT INTO colors VALUES (432,'Blossom Pink','F9B7FF','on'); INSERT INTO colors VALUES (433,'Thistle','D2B9D3','on'); INSERT INTO colors VALUES (434,'Periwinkle','E9CFEC','on'); INSERT INTO colors VALUES (435,'Lavender Pinocchio','EBDDE2','on'); INSERT INTO colors VALUES (436,'Lavender Blue','E3E4FA','on'); INSERT INTO colors VALUES (437,'Pearl','FDEEF4','on'); INSERT INTO colors VALUES (438,'SeaShell','FFF5EE','on'); INSERT INTO colors VALUES (439,'Milk White','FEFCFF','on'); -- -- Table structure for table `data_input` -- CREATE TABLE data_input ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', name varchar(200) NOT NULL default '', input_string varchar(512) default NULL, type_id tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (id), KEY `name_type_id` (`name`(171), `type_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_input` -- INSERT INTO data_input VALUES (1,'3eb92bb845b9660a7445cf9740726522','Get SNMP Data','',2); INSERT INTO data_input VALUES (2,'bf566c869ac6443b0c75d1c32b5a350e','Get SNMP Data (Indexed)','',3); INSERT INTO data_input VALUES (3,'274f4685461170b9eb1b98d22567ab5e','Unix - Get Free Disk Space','/scripts/diskfree.sh ',1); INSERT INTO data_input VALUES (4,'95ed0993eb3095f9920d431ac80f4231','Unix - Get Load Average','perl /scripts/loadavg_multi.pl',1); INSERT INTO data_input VALUES (5,'79a284e136bb6b061c6f96ec219ac448','Unix - Get Logged In Users','perl /scripts/unix_users.pl ',1); INSERT INTO data_input VALUES (6,'362e6d4768937c4f899dd21b91ef0ff8','Linux - Get Memory Usage','perl /scripts/linux_memory.pl ',1); INSERT INTO data_input VALUES (7,'a637359e0a4287ba43048a5fdf202066','Unix - Get System Processes','perl /scripts/unix_processes.pl',1); INSERT INTO data_input VALUES (8,'47d6bfe8be57a45171afd678920bd399','Unix - Get TCP Connections','perl /scripts/unix_tcp_connections.pl ',1); INSERT INTO data_input VALUES (9,'cc948e4de13f32b6aea45abaadd287a3','Unix - Get Web Hits','perl /scripts/webhits.pl ',1); INSERT INTO data_input VALUES (10,'8bd153aeb06e3ff89efc73f35849a7a0','Unix - Ping Host','perl /scripts/ping.pl ',1); INSERT INTO data_input VALUES (11,'80e9e4c4191a5da189ae26d0e237f015','Get Script Data (Indexed)','',4); INSERT INTO data_input VALUES (12,'332111d8b54ac8ce939af87a7eac0c06','Get Script Server Data (Indexed)','',6); -- -- Table structure for table `data_input_data` -- CREATE TABLE data_input_data ( data_input_field_id mediumint(8) unsigned NOT NULL default '0', data_template_data_id int(10) unsigned NOT NULL default '0', t_value char(2) default NULL, value text, PRIMARY KEY (data_input_field_id,data_template_data_id), KEY data_template_data_id (data_template_data_id), KEY t_value (t_value) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_input_data` -- INSERT INTO `data_input_data` VALUES (1,4,'',''); INSERT INTO `data_input_data` VALUES (1,5,'',''); INSERT INTO `data_input_data` VALUES (1,6,'',''); INSERT INTO `data_input_data` VALUES (1,19,'',''); INSERT INTO `data_input_data` VALUES (1,20,'',''); INSERT INTO `data_input_data` VALUES (1,22,'',''); INSERT INTO `data_input_data` VALUES (1,23,'',''); INSERT INTO `data_input_data` VALUES (1,24,'',''); INSERT INTO `data_input_data` VALUES (1,25,'',''); INSERT INTO `data_input_data` VALUES (1,26,'',''); INSERT INTO `data_input_data` VALUES (1,27,'',''); INSERT INTO `data_input_data` VALUES (1,30,'',''); INSERT INTO `data_input_data` VALUES (1,31,'',''); INSERT INTO `data_input_data` VALUES (1,32,'',''); INSERT INTO `data_input_data` VALUES (1,33,'',''); INSERT INTO `data_input_data` VALUES (1,34,'',''); INSERT INTO `data_input_data` VALUES (1,58,'',''); INSERT INTO `data_input_data` VALUES (1,59,'',''); INSERT INTO `data_input_data` VALUES (1,68,'',''); INSERT INTO `data_input_data` VALUES (2,4,'',''); INSERT INTO `data_input_data` VALUES (2,5,'',''); INSERT INTO `data_input_data` VALUES (2,6,'',''); INSERT INTO `data_input_data` VALUES (2,19,'',''); INSERT INTO `data_input_data` VALUES (2,20,'',''); INSERT INTO `data_input_data` VALUES (2,22,'',''); INSERT INTO `data_input_data` VALUES (2,23,'',''); INSERT INTO `data_input_data` VALUES (2,24,'',''); INSERT INTO `data_input_data` VALUES (2,25,'',''); INSERT INTO `data_input_data` VALUES (2,26,'',''); INSERT INTO `data_input_data` VALUES (2,27,'',''); INSERT INTO `data_input_data` VALUES (2,30,'',''); INSERT INTO `data_input_data` VALUES (2,31,'',''); INSERT INTO `data_input_data` VALUES (2,32,'',''); INSERT INTO `data_input_data` VALUES (2,33,'',''); INSERT INTO `data_input_data` VALUES (2,34,'',''); INSERT INTO `data_input_data` VALUES (2,58,'',''); INSERT INTO `data_input_data` VALUES (2,59,'',''); INSERT INTO `data_input_data` VALUES (2,68,'',''); INSERT INTO `data_input_data` VALUES (3,4,'',''); INSERT INTO `data_input_data` VALUES (3,5,'',''); INSERT INTO `data_input_data` VALUES (3,6,'',''); INSERT INTO `data_input_data` VALUES (3,19,'',''); INSERT INTO `data_input_data` VALUES (3,20,'',''); INSERT INTO `data_input_data` VALUES (3,22,'',''); INSERT INTO `data_input_data` VALUES (3,23,'',''); INSERT INTO `data_input_data` VALUES (3,24,'',''); INSERT INTO `data_input_data` VALUES (3,25,'',''); INSERT INTO `data_input_data` VALUES (3,26,'',''); INSERT INTO `data_input_data` VALUES (3,27,'',''); INSERT INTO `data_input_data` VALUES (3,30,'',''); -- -- Table structure for table `data_input_fields` -- CREATE TABLE data_input_fields ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', data_input_id mediumint(8) unsigned NOT NULL default '0', name varchar(200) NOT NULL default '', data_name varchar(50) NOT NULL default '', input_output char(3) NOT NULL default '', update_rra char(2) default '0', sequence smallint(5) NOT NULL default '0', type_code varchar(40) default NULL, regexp_match varchar(200) default NULL, allow_nulls char(2) default NULL, PRIMARY KEY (id), KEY data_input_id (data_input_id), KEY input_output (input_output), KEY type_code_data_input_id (type_code, data_input_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_input_fields` -- INSERT INTO `data_input_fields` VALUES (1,'92f5906c8dc0f964b41f4253df582c38',1,'SNMP IP Address','management_ip','in','',0,'hostname','',''); INSERT INTO `data_input_fields` VALUES (2,'32285d5bf16e56c478f5e83f32cda9ef',1,'SNMP Community','snmp_community','in','',0,'snmp_community','',''); INSERT INTO `data_input_fields` VALUES (3,'ad14ac90641aed388139f6ba86a2e48b',1,'SNMP Username','snmp_username','in','',0,'snmp_username','','on'); INSERT INTO `data_input_fields` VALUES (4,'9c55a74bd571b4f00a96fd4b793278c6',1,'SNMP Password','snmp_password','in','',0,'snmp_password','','on'); INSERT INTO `data_input_fields` VALUES (5,'012ccb1d3687d3edb29c002ea66e72da',1,'SNMP Version (1, 2, or 3)','snmp_version','in','',0,'snmp_version','','on'); INSERT INTO `data_input_fields` VALUES (6,'4276a5ec6e3fe33995129041b1909762',1,'OID','oid','in','',0,'snmp_oid','',''); INSERT INTO `data_input_fields` VALUES (7,'617cdc8a230615e59f06f361ef6e7728',2,'SNMP IP Address','management_ip','in','',0,'hostname','',''); INSERT INTO `data_input_fields` VALUES (8,'acb449d1451e8a2a655c2c99d31142c7',2,'SNMP Community','snmp_community','in','',0,'snmp_community','',''); INSERT INTO `data_input_fields` VALUES (9,'f4facc5e2ca7ebee621f09bc6d9fc792',2,'SNMP Username (v3)','snmp_username','in','',0,'snmp_username','','on'); INSERT INTO `data_input_fields` VALUES (10,'1cc1493a6781af2c478fa4de971531cf',2,'SNMP Password (v3)','snmp_password','in','',0,'snmp_password','','on'); INSERT INTO `data_input_fields` VALUES (11,'b5c23f246559df38662c255f4aa21d6b',2,'SNMP Version (1, 2, or 3)','snmp_version','in','',0,'snmp_version','',''); INSERT INTO `data_input_fields` VALUES (12,'6027a919c7c7731fbe095b6f53ab127b',2,'Index Type','index_type','in','',0,'index_type','',''); INSERT INTO `data_input_fields` VALUES (13,'cbbe5c1ddfb264a6e5d509ce1c78c95f',2,'Index Value','index_value','in','',0,'index_value','',''); INSERT INTO `data_input_fields` VALUES (14,'e6deda7be0f391399c5130e7c4a48b28',2,'Output Type ID','output_type','in','',0,'output_type','',''); INSERT INTO `data_input_fields` VALUES (15,'edfd72783ad02df128ff82fc9324b4b9',3,'Disk Partition','partition','in','',1,'','',''); INSERT INTO `data_input_fields` VALUES (16,'8b75fb61d288f0b5fc0bd3056af3689b',3,'Kilobytes Free','kilobytes','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (17,'363588d49b263d30aecb683c52774f39',4,'1 Minute Average','1min','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (18,'ad139a9e1d69881da36fca07889abf58',4,'5 Minute Average','5min','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (19,'5db9fee64824c08258c7ff6f8bc53337',4,'10 Minute Average','10min','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (20,'c0cfd0beae5e79927c5a360076706820',5,'Username (Optional)','username','in','',1,'','','on'); INSERT INTO `data_input_fields` VALUES (21,'52c58ad414d9a2a83b00a7a51be75a53',5,'Logged In Users','users','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (22,'05eb5d710f0814871b8515845521f8d7',6,'Grep String','grepstr','in','',1,'','',''); INSERT INTO `data_input_fields` VALUES (23,'86cb1cbfde66279dbc7f1144f43a3219',6,'Result (in Kilobytes)','kilobytes','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (24,'d5a8dd5fbe6a5af11667c0039af41386',7,'Number of Processes','proc','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (25,'8848cdcae831595951a3f6af04eec93b',8,'Grep String','grepstr','in','',1,'','','on'); INSERT INTO `data_input_fields` VALUES (26,'3d1288d33008430ce354e8b9c162f7ff',8,'Connections','connections','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (27,'c6af570bb2ed9c84abf32033702e2860',9,'(Optional) Log Path','log_path','in','',1,'','','on'); INSERT INTO `data_input_fields` VALUES (28,'f9389860f5c5340c9b27fca0b4ee5e71',9,'Web Hits','webhits','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (29,'5fbadb91ad66f203463c1187fe7bd9d5',10,'IP Address','ip','in','',1,'hostname','',''); INSERT INTO `data_input_fields` VALUES (30,'6ac4330d123c69067d36a933d105e89a',10,'Milliseconds','out_ms','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (31,'d39556ecad6166701bfb0e28c5a11108',11,'Index Type','index_type','in','',0,'index_type','',''); INSERT INTO `data_input_fields` VALUES (32,'3b7caa46eb809fc238de6ef18b6e10d5',11,'Index Value','index_value','in','',0,'index_value','',''); INSERT INTO `data_input_fields` VALUES (33,'74af2e42dc12956c4817c2ef5d9983f9',11,'Output Type ID','output_type','in','',0,'output_type','',''); INSERT INTO `data_input_fields` VALUES (34,'8ae57f09f787656bf4ac541e8bd12537',11,'Output Value','output','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (35,'172b4b0eacee4948c6479f587b62e512',12,'Index Type','index_type','in','',0,'index_type','',''); INSERT INTO `data_input_fields` VALUES (36,'30fb5d5bcf3d66bb5abe88596f357c26',12,'Index Value','index_value','in','',0,'index_value','',''); INSERT INTO `data_input_fields` VALUES (37,'31112c85ae4ff821d3b288336288818c',12,'Output Type ID','output_type','in','',0,'output_type','',''); INSERT INTO `data_input_fields` VALUES (38,'5be8fa85472d89c621790b43510b5043',12,'Output Value','output','out','on',0,'','',''); INSERT INTO `data_input_fields` VALUES (39,'c1f36ee60c3dc98945556d57f26e475b',2,'SNMP Port','snmp_port','in','',0,'snmp_port','',''); INSERT INTO `data_input_fields` VALUES (40,'fc64b99742ec417cc424dbf8c7692d36',1,'SNMP Port','snmp_port','in','',0,'snmp_port','',''); INSERT INTO `data_input_fields` VALUES (41,'20832ce12f099c8e54140793a091af90',1,'SNMP Authentication Protocol (v3)','snmp_auth_protocol','in','',0,'snmp_auth_protocol','',''); INSERT INTO `data_input_fields` VALUES (42,'c60c9aac1e1b3555ea0620b8bbfd82cb',1,'SNMP Privacy Passphrase (v3)','snmp_priv_passphrase','in','',0,'snmp_priv_passphrase','',''); INSERT INTO `data_input_fields` VALUES (43,'feda162701240101bc74148415ef415a',1,'SNMP Privacy Protocol (v3)','snmp_priv_protocol','in','',0,'snmp_priv_protocol','',''); INSERT INTO `data_input_fields` VALUES (44,'2cf7129ad3ff819a7a7ac189bee48ce8',2,'SNMP Authentication Protocol (v3)','snmp_auth_protocol','in','',0,'snmp_auth_protocol','',''); INSERT INTO `data_input_fields` VALUES (45,'6b13ac0a0194e171d241d4b06f913158',2,'SNMP Privacy Passphrase (v3)','snmp_priv_passphrase','in','',0,'snmp_priv_passphrase','',''); INSERT INTO `data_input_fields` VALUES (46,'3a33d4fc65b8329ab2ac46a36da26b72',2,'SNMP Privacy Protocol (v3)','snmp_priv_protocol','in','',0,'snmp_priv_protocol','',''); -- -- Table structure for table `data_local` -- CREATE TABLE data_local ( id int(10) unsigned NOT NULL auto_increment, data_template_id mediumint(8) unsigned NOT NULL default '0', host_id mediumint(8) unsigned NOT NULL default '0', snmp_query_id mediumint(8) NOT NULL default '0', snmp_index varchar(255) NOT NULL default '', orphan tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (id), KEY data_template_id (data_template_id), KEY snmp_query_id (snmp_query_id), KEY snmp_index (snmp_index), KEY host_id_snmp_query_id (host_id, snmp_query_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_local` -- -- -- Table structure for table `data_debug` -- CREATE TABLE `data_debug` ( `id` int(10) unsigned NOT NULL auto_increment, `started` int(10) unsigned NOT NULL default '0', `done` int(10) unsigned NOT NULL default '0', `user` int(10) unsigned NOT NULL default '0', `datasource` int(10) unsigned NOT NULL default '0', `info` text NOT NULL, `issue` text NOT NULL, PRIMARY KEY (`id`), KEY `user` (`user`), KEY `done` (`done`), KEY `datasource` (`datasource`), KEY `started` (`started`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Datasource Debugger Information'; -- -- Dumping data for table `data_debug` -- -- -- Table structure for table `data_source_profiles` -- CREATE TABLE `data_source_profiles` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `hash` varchar(32) NOT NULL DEFAULT '', `name` varchar(255) NOT NULL DEFAULT '', `step` int(10) unsigned NOT NULL DEFAULT '300', `heartbeat` int(10) unsigned NOT NULL DEFAULT '600', `x_files_factor` double DEFAULT '0.5', `default` char(2) DEFAULT '', PRIMARY KEY (`id`), KEY `name` (`name`(171)) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores Data Source Profiles'; -- -- Dumping data for table `data_source_profiles` -- INSERT INTO `data_source_profiles` VALUES (1,'d62c52891f4f9688729a5bc9fad91b18','5 Minute Collection',300,600,0.5,'on'); INSERT INTO `data_source_profiles` VALUES (2,'c0dd0e46b9ca268e7ed4162d329f9215','30 Second Collection',30,1200,0.5,''); INSERT INTO `data_source_profiles` VALUES (3,'66d35da8f75c912ede3dbe901fedcae0','1 Minute Collection',60,600,0.5,''); -- -- Table structure for table `data_source_profiles_cf` -- CREATE TABLE `data_source_profiles_cf` ( `data_source_profile_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `consolidation_function_id` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`data_source_profile_id`,`consolidation_function_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Maps the Data Source Profile Consolidation Functions'; -- -- Dumping data for table `data_source_profiles_cf` -- INSERT INTO `data_source_profiles_cf` VALUES (1,1); INSERT INTO `data_source_profiles_cf` VALUES (1,2); INSERT INTO `data_source_profiles_cf` VALUES (1,3); INSERT INTO `data_source_profiles_cf` VALUES (1,4); INSERT INTO `data_source_profiles_cf` VALUES (2,1); INSERT INTO `data_source_profiles_cf` VALUES (2,2); INSERT INTO `data_source_profiles_cf` VALUES (2,3); INSERT INTO `data_source_profiles_cf` VALUES (2,4); INSERT INTO `data_source_profiles_cf` VALUES (3,1); INSERT INTO `data_source_profiles_cf` VALUES (3,2); INSERT INTO `data_source_profiles_cf` VALUES (3,3); INSERT INTO `data_source_profiles_cf` VALUES (3,4); -- -- Table structure for table `data_source_profiles_rra` -- CREATE TABLE `data_source_profiles_rra` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `data_source_profile_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL DEFAULT '', `steps` int(10) unsigned DEFAULT '1', `rows` int(10) unsigned NOT NULL DEFAULT '700', `timespan` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `data_source_profile_id` (`data_source_profile_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores RRA Definitions for Data Source Profiles'; -- -- Dumping data for table `data_source_profiles_rra` -- INSERT INTO `data_source_profiles_rra` VALUES (1,1,'Daily (5 Minute Average)',1,600,86400); INSERT INTO `data_source_profiles_rra` VALUES (2,1,'Weekly (30 Minute Average)',6,700,604800); INSERT INTO `data_source_profiles_rra` VALUES (3,1,'Monthly (2 Hour Average)',24,775,2618784); INSERT INTO `data_source_profiles_rra` VALUES (4,1,'Yearly (1 Day Average)',288,797,31536000); INSERT INTO `data_source_profiles_rra` VALUES (5,2,'Daily (30 Second Average)',1,2900,86400); INSERT INTO `data_source_profiles_rra` VALUES (6,2,'Weekly (15 Minute Average)',30,1346,604800); INSERT INTO `data_source_profiles_rra` VALUES (7,2,'Monthly (1 Hour Average)',120,1445,2618784); INSERT INTO `data_source_profiles_rra` VALUES (8,2,'Yearly (4 Hour Average)',480,4380,31536000); INSERT INTO `data_source_profiles_rra` VALUES (9,3,'Daily (1 Minute Average)',1,2900,86400); INSERT INTO `data_source_profiles_rra` VALUES (10,3,'Weekly (15 Minute Average)',15,1440,604800); INSERT INTO `data_source_profiles_rra` VALUES (11,3,'Monthly (1 Hour Average)',60,8784,2618784); INSERT INTO `data_source_profiles_rra` VALUES (12,3,'Yearly (12 Hour Average)',720,7305,31536000); -- -- Table structure for table `data_source_purge_action` -- CREATE TABLE `data_source_purge_action` ( `id` integer UNSIGNED auto_increment, `name` varchar(128) NOT NULL default '', `local_data_id` int(10) unsigned NOT NULL default '0', `action` tinyint(3) unsigned NOT NULL default 0, PRIMARY KEY (`id`), UNIQUE KEY name (`name`)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='RRD Cleaner File Actions'; -- -- Table structure for table `data_source_purge_temp` -- CREATE TABLE `data_source_purge_temp` ( `id` integer UNSIGNED auto_increment, `name_cache` varchar(255) NOT NULL default '', `local_data_id` int(10) unsigned NOT NULL default '0', `name` varchar(128) NOT NULL default '', `size` integer UNSIGNED NOT NULL default '0', `last_mod` TIMESTAMP NOT NULL default '0000-00-00 00:00:00', `in_cacti` tinyint(3) unsigned NOT NULL default '0', `data_template_id` mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY name (`name`), KEY local_data_id (`local_data_id`), KEY in_cacti (`in_cacti`), KEY data_template_id (`data_template_id`)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='RRD Cleaner File Repository'; -- -- Table structure for table `data_source_stats_daily` -- CREATE TABLE `data_source_stats_daily` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `average` DOUBLE DEFAULT NULL, `peak` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `data_source_stats_hourly` -- CREATE TABLE `data_source_stats_hourly` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `average` DOUBLE DEFAULT NULL, `peak` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `data_source_stats_hourly_cache` -- CREATE TABLE `data_source_stats_hourly_cache` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `time` timestamp NOT NULL default '0000-00-00 00:00:00', `value` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`time`,`rrd_name`), KEY `time` USING BTREE (`time`) ) ENGINE=MEMORY; -- -- Table structure for table `data_source_stats_hourly_last` -- CREATE TABLE `data_source_stats_hourly_last` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `value` DOUBLE DEFAULT NULL, `calculated` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=MEMORY; -- -- Table structure for table `data_source_stats_monthly` -- CREATE TABLE `data_source_stats_monthly` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `average` DOUBLE DEFAULT NULL, `peak` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `data_source_stats_weekly` -- CREATE TABLE `data_source_stats_weekly` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `average` DOUBLE DEFAULT NULL, `peak` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `data_source_stats_yearly` -- CREATE TABLE `data_source_stats_yearly` ( `local_data_id` int(10) unsigned NOT NULL, `rrd_name` varchar(19) NOT NULL, `average` DOUBLE DEFAULT NULL, `peak` DOUBLE DEFAULT NULL, PRIMARY KEY (`local_data_id`,`rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `data_template` -- CREATE TABLE data_template ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', name varchar(150) NOT NULL default '', PRIMARY KEY (id), KEY `name` (`name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_template` -- -- -- Table structure for table `data_template_data` -- CREATE TABLE data_template_data ( id int(10) unsigned NOT NULL auto_increment, local_data_template_data_id int(10) unsigned NOT NULL default '0', local_data_id int(10) unsigned NOT NULL default '0', data_template_id mediumint(8) unsigned NOT NULL default '0', data_input_id mediumint(8) unsigned NOT NULL default '0', t_name char(2) default NULL, name varchar(250) NOT NULL default '', name_cache varchar(255) NOT NULL default '', data_source_path varchar(255) default '', t_active char(2) default '', active char(2) default NULL, t_rrd_step char(2) default '', rrd_step mediumint(8) unsigned NOT NULL default '0', t_data_source_profile_id char(2) default '', data_source_profile_id mediumint(8) unsigned NOT NULL default '1', PRIMARY KEY (id), KEY local_data_id (local_data_id), KEY data_template_id (data_template_id), KEY data_input_id (data_input_id), KEY name_cache (name_cache) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_template_data` -- -- -- Table structure for table `data_template_rrd` -- CREATE TABLE data_template_rrd ( id int(10) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', local_data_template_rrd_id int(10) unsigned NOT NULL default '0', local_data_id int(10) unsigned NOT NULL default '0', data_template_id mediumint(8) unsigned NOT NULL default '0', t_rrd_maximum char(2) default NULL, rrd_maximum varchar(20) NOT NULL default '0', t_rrd_minimum char(2) default NULL, rrd_minimum varchar(20) NOT NULL default '0', t_rrd_heartbeat char(2) default NULL, rrd_heartbeat mediumint(6) NOT NULL default '0', t_data_source_type_id char(2) default NULL, data_source_type_id smallint(5) NOT NULL default '0', t_data_source_name char(2) default NULL, data_source_name varchar(19) NOT NULL default '', t_data_input_field_id char(2) default NULL, data_input_field_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY `duplicate_dsname_contraint` (`local_data_id`,`data_source_name`,`data_template_id`), KEY data_template_id (data_template_id), KEY local_data_template_rrd_id (local_data_template_rrd_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `data_template_rrd` -- CREATE TABLE external_links ( id int(10) unsigned NOT NULL AUTO_INCREMENT, sortorder int(10) unsigned NOT NULL DEFAULT '0', enabled char(2) DEFAULT 'on', contentfile varchar(255) NOT NULL default '', title varchar(20) NOT NULL default '', style varchar(10) NOT NULL DEFAULT '', extendedstyle varchar(50) NOT NULL DEFAULT '', refresh int unsigned default NULL, PRIMARY KEY (id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Contains external links that are embedded into Cacti'; -- -- Table structure for table `graph_local` -- CREATE TABLE graph_local ( id int(10) unsigned NOT NULL auto_increment, graph_template_id mediumint(8) unsigned NOT NULL default '0', host_id mediumint(8) unsigned NOT NULL default '0', snmp_query_id mediumint(8) NOT NULL default '0', snmp_query_graph_id mediumint(8) NOT NULL default '0', snmp_index varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY host_id (host_id), KEY graph_template_id (graph_template_id), KEY snmp_query_id (snmp_query_id), KEY snmp_query_graph_id (snmp_query_graph_id), KEY snmp_index (snmp_index) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Creates a relationship for each item in a custom graph.'; -- -- Dumping data for table `graph_local` -- -- -- Table structure for table `graph_template_input` -- CREATE TABLE graph_template_input ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', graph_template_id mediumint(8) unsigned NOT NULL default '0', name varchar(255) NOT NULL default '', description text, column_name varchar(50) NOT NULL default '', PRIMARY KEY (id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the names for graph item input groups.'; -- -- Dumping data for table `graph_template_input` -- -- -- Table structure for table `graph_template_input_defs` -- CREATE TABLE graph_template_input_defs ( graph_template_input_id int(10) unsigned NOT NULL default '0', graph_template_item_id int(10) unsigned NOT NULL default '0', PRIMARY KEY (graph_template_input_id,graph_template_item_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the relationship for what graph items are associated'; -- -- Dumping data for table `graph_template_input_defs` -- -- -- Table structure for table `graph_templates` -- CREATE TABLE graph_templates ( `id` mediumint(8) unsigned NOT NULL auto_increment, `hash` char(32) NOT NULL default '', `name` char(255) NOT NULL default '', `multiple` char(2) NOT NULL default '', `test_source` char(2) NOT NULL default '', PRIMARY KEY (`id`), KEY `multiple_name` (`multiple`, `name`), KEY `name` (`name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Contains each graph template name.'; -- -- Dumping data for table `graph_templates` -- -- -- Table structure for table `graph_templates_gprint` -- CREATE TABLE graph_templates_gprint ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', name varchar(100) NOT NULL default '', gprint_text varchar(255) default NULL, PRIMARY KEY (id), KEY `name` (`name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `graph_templates_gprint` -- INSERT INTO graph_templates_gprint VALUES (2,'e9c43831e54eca8069317a2ce8c6f751','Normal','%8.2lf %s'); INSERT INTO graph_templates_gprint VALUES (3,'19414480d6897c8731c7dc6c5310653e','Exact Numbers','%8.0lf'); INSERT INTO graph_templates_gprint VALUES (4,'304a778405392f878a6db435afffc1e9','Load Average','%8.2lf'); -- -- Table structure for table `graph_templates_graph` -- CREATE TABLE graph_templates_graph ( id int(10) unsigned NOT NULL auto_increment, local_graph_template_graph_id int(10) unsigned NOT NULL default '0', local_graph_id int(10) unsigned NOT NULL default '0', graph_template_id mediumint(8) unsigned NOT NULL default '0', t_image_format_id char(2) default '', image_format_id tinyint(3) unsigned NOT NULL default '0', t_title char(2) default '', title varchar(255) NOT NULL default '', title_cache varchar(255) NOT NULL default '', t_height char(2) default '', height mediumint(8) NOT NULL default '0', t_width char(2) default '', width mediumint(8) NOT NULL default '0', t_upper_limit char(2) default '', upper_limit varchar(20) NOT NULL default '0', t_lower_limit char(2) default '', lower_limit varchar(20) NOT NULL default '0', t_vertical_label char(2) default '', vertical_label varchar(200) default NULL, t_slope_mode char(2) default '', slope_mode char(2) default 'on', t_auto_scale char(2) default '', auto_scale char(2) default NULL, t_auto_scale_opts char(2) default '', auto_scale_opts tinyint(3) unsigned NOT NULL default '0', t_auto_scale_log char(2) default '', auto_scale_log char(2) default NULL, t_scale_log_units char(2) default '', scale_log_units char(2) default NULL, t_auto_scale_rigid char(2) default '', auto_scale_rigid char(2) default NULL, t_auto_padding char(2) default '', auto_padding char(2) default NULL, t_base_value char(2) default '', base_value mediumint(8) NOT NULL default '0', `t_grouping` char(2) default '', `grouping` char(2) NOT NULL default '', t_unit_value char(2) default '', unit_value varchar(20) default NULL, t_unit_exponent_value char(2) default '', unit_exponent_value varchar(5) NOT NULL default '', t_alt_y_grid char(2) default '', alt_y_grid char(2) default NULL, t_right_axis char(2) DEFAULT '', right_axis varchar(20) DEFAULT NULL, t_right_axis_label char(2) DEFAULT '', right_axis_label varchar(200) DEFAULT NULL, t_right_axis_format char(2) DEFAULT '', right_axis_format mediumint(8) DEFAULT NULL, t_right_axis_formatter char(2) DEFAULT '', right_axis_formatter varchar(10) DEFAULT NULL, t_left_axis_formatter char(2) DEFAULT '', left_axis_formatter varchar(10) DEFAULT NULL, t_no_gridfit char(2) DEFAULT '', no_gridfit char(2) DEFAULT NULL, t_unit_length char(2) DEFAULT '', unit_length varchar(10) DEFAULT NULL, t_tab_width char(2) DEFAULT '', tab_width varchar(20) DEFAULT '30', t_dynamic_labels char(2) default '', dynamic_labels char(2) default NULL, t_force_rules_legend char(2) DEFAULT '', force_rules_legend char(2) DEFAULT NULL, t_legend_position char(2) DEFAULT '', legend_position varchar(10) DEFAULT NULL, t_legend_direction char(2) DEFAULT '', legend_direction varchar(10) DEFAULT NULL, PRIMARY KEY (id), KEY local_graph_id (local_graph_id), KEY graph_template_id (graph_template_id), KEY title_cache (title_cache) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the actual graph data.'; -- -- Dumping data for table `graph_templates_graph` -- -- -- Table structure for table `graph_templates_item` -- CREATE TABLE graph_templates_item ( id int(10) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', local_graph_template_item_id int(10) unsigned NOT NULL default '0', local_graph_id int(10) unsigned NOT NULL default '0', graph_template_id mediumint(8) unsigned NOT NULL default '0', task_item_id int(10) unsigned NOT NULL default '0', color_id mediumint(8) unsigned NOT NULL default '0', alpha char(2) default 'FF', graph_type_id tinyint(3) unsigned NOT NULL default '0', line_width DECIMAL(4,2) DEFAULT 0, dashes varchar(20) DEFAULT NULL, dash_offset mediumint(4) DEFAULT NULL, cdef_id mediumint(8) unsigned NOT NULL default '0', vdef_id mediumint(8) unsigned NOT NULL default '0', shift char(2) default NULL, consolidation_function_id tinyint(3) unsigned NOT NULL default '0', textalign varchar(10) default NULL, text_format varchar(255) default NULL, value varchar(255) default NULL, hard_return char(2) default NULL, gprint_id mediumint(8) unsigned NOT NULL default '0', sequence mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (id), KEY graph_template_id (graph_template_id), KEY local_graph_id_sequence (local_graph_id, sequence), KEY local_graph_template_item_id (local_graph_template_item_id), KEY task_item_id (task_item_id), KEY cdef_id (cdef_id), KEY vdef_id (vdef_id), KEY color_id (color_id), KEY gprint_id (gprint_id), KEY `lgi_gti` (`local_graph_id`,`graph_template_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the actual graph item data.'; -- -- Dumping data for table `graph_templates_item` -- -- -- Table structure for table `graph_tree` -- CREATE TABLE graph_tree ( `id` smallint(5) unsigned NOT NULL auto_increment, `enabled` char(2) DEFAULT 'on', `locked` tinyint(3) unsigned DEFAULT '0', `locked_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `sort_type` tinyint(3) unsigned NOT NULL default '1', `name` varchar(255) NOT NULL default '', `sequence` int(10) unsigned DEFAULT '1', `user_id` int(10) unsigned DEFAULT '1', `last_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `modified_by` int(10) unsigned DEFAULT '1', PRIMARY KEY (`id`), KEY `sequence` (`sequence`), KEY `name` (`name`(171)) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `graph_tree` -- INSERT INTO graph_tree VALUES (1,'on',0,'0000-00-00',1,'Default Tree',1,1,'0000-00-00','1'); -- -- Table structure for table `graph_tree_items` -- CREATE TABLE graph_tree_items ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, parent bigint(20) unsigned DEFAULT NULL, position int(10) unsigned DEFAULT NULL, graph_tree_id smallint(5) unsigned NOT NULL DEFAULT '0', local_graph_id int(10) unsigned NOT NULL DEFAULT '0', title varchar(255) DEFAULT NULL, host_id mediumint(8) unsigned NOT NULL DEFAULT '0', site_id int unsigned DEFAULT '0', host_grouping_type tinyint(3) unsigned NOT NULL DEFAULT '1', sort_children_type tinyint(3) unsigned NOT NULL DEFAULT '0', graph_regex varchar(60) DEFAULT '', host_regex varchar(60) DEFAULT '', PRIMARY KEY (`id`), KEY `graph_tree_id` (`graph_tree_id`), KEY `host_id` (`host_id`), KEY `site_id` (`site_id`), KEY `local_graph_id` (`local_graph_id`), KEY `parent_position`(`parent`, `position`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `graph_tree_items` -- -- -- Table structure for table `host` -- CREATE TABLE host ( id mediumint(8) unsigned NOT NULL auto_increment, poller_id int(10) unsigned NOT NULL default '1', site_id int(10) unsigned NOT NULL default '1', host_template_id mediumint(8) unsigned NOT NULL default '0', description varchar(150) NOT NULL default '', hostname varchar(100) default NULL, location varchar(40) default NULL, notes text, external_id varchar(40) default NULL, snmp_community varchar(100) default NULL, snmp_version tinyint(3) unsigned NOT NULL default '1', snmp_username varchar(50) default NULL, snmp_password varchar(50) default NULL, snmp_auth_protocol char(6) default '', snmp_priv_passphrase varchar(200) default '', snmp_priv_protocol char(6) default '', snmp_context varchar(64) default '', snmp_engine_id varchar(64) default '', snmp_port mediumint(8) unsigned NOT NULL default '161', snmp_timeout mediumint(8) unsigned NOT NULL default '500', snmp_sysDescr varchar(300) NOT NULL default '', snmp_sysObjectID varchar(128) NOT NULL default '', snmp_sysUpTimeInstance bigint(20) unsigned NOT NULL default '0', snmp_sysContact varchar(300) NOT NULL default '', snmp_sysName varchar(300) NOT NULL default '', snmp_sysLocation varchar(300) NOT NULL default '', availability_method smallint(5) unsigned NOT NULL default '1', ping_method smallint(5) unsigned default '0', ping_port int(10) unsigned default '0', ping_timeout int(10) unsigned default '500', ping_retries int(10) unsigned default '2', max_oids int(10) unsigned default '10', bulk_walk_size int(11) DEFAULT '-1', device_threads tinyint(3) unsigned NOT NULL DEFAULT '1', deleted char(2) NOT NULL default '', disabled char(2) NOT NULL default '', status tinyint(3) unsigned NOT NULL default '0', status_event_count mediumint(8) unsigned NOT NULL default '0', status_fail_date timestamp NOT NULL default '0000-00-00 00:00:00', status_rec_date timestamp NOT NULL default '0000-00-00 00:00:00', status_last_error varchar(255) default '', min_time decimal(10,5) default '9.99999', max_time decimal(10,5) default '0.00000', cur_time decimal(10,5) default '0.00000', avg_time decimal(10,5) default '0.00000', polling_time DOUBLE default '0', total_polls int(10) unsigned default '0', failed_polls int(10) unsigned default '0', availability decimal(8,5) NOT NULL default '100.00000', last_updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY poller_id_disabled (poller_id, disabled), KEY external_id (external_id), KEY disabled (disabled), KEY status (status), KEY site_id_location (site_id, location), KEY hostname (hostname), KEY poller_id_last_updated (poller_id, last_updated) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host` -- -- -- Table structure for table `host_graph` -- CREATE TABLE host_graph ( host_id mediumint(8) unsigned NOT NULL default '0', graph_template_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (host_id,graph_template_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_graph` -- -- -- Table structure for table `host_snmp_cache` -- CREATE TABLE host_snmp_cache ( host_id mediumint(8) unsigned NOT NULL default '0', snmp_query_id mediumint(8) unsigned NOT NULL default '0', field_name varchar(50) NOT NULL default '', field_value varchar(512) default NULL, snmp_index varchar(255) NOT NULL default '', oid TEXT NOT NULL, present tinyint(3) unsigned NOT NULL DEFAULT '1', last_updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (host_id, snmp_query_id, field_name, snmp_index), KEY host_id (host_id, field_name), KEY snmp_index (snmp_index), KEY field_name (field_name), KEY field_value (field_value), KEY snmp_query_id (snmp_query_id), KEY last_updated (last_updated), KEY present (present) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_snmp_cache` -- -- -- Table structure for table `host_snmp_query` -- CREATE TABLE host_snmp_query ( host_id mediumint(8) unsigned NOT NULL default '0', snmp_query_id mediumint(8) unsigned NOT NULL default '0', sort_field varchar(50) NOT NULL default '', title_format varchar(50) NOT NULL default '', reindex_method tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (host_id,snmp_query_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_snmp_query` -- -- -- Table structure for table `host_template` -- CREATE TABLE host_template ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', name varchar(100) NOT NULL default '', class varchar(40) NOT NULL default '', PRIMARY KEY (id), KEY `name` (`name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_template` -- -- -- Table structure for table `host_template_graph` -- CREATE TABLE host_template_graph ( host_template_id mediumint(8) unsigned NOT NULL default '0', graph_template_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (host_template_id,graph_template_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_template_graph` -- -- -- Table structure for table `host_template_snmp_query` -- CREATE TABLE host_template_snmp_query ( host_template_id mediumint(8) unsigned NOT NULL default '0', snmp_query_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (host_template_id, snmp_query_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `host_template_snmp_query` -- -- -- Table structure for table `plugin_config` -- CREATE TABLE `plugin_config` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `directory` varchar(32) NOT NULL default '', `name` varchar(64) NOT NULL default '', `status` tinyint(3) unsigned NOT NULL default '0', `author` varchar(64) NOT NULL default '', `webpage` varchar(255) NOT NULL default '', `version` varchar(10) NOT NULL default '', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `directory` (`directory`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `plugin_hooks` -- CREATE TABLE `plugin_hooks` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `name` varchar(32) NOT NULL default '', `hook` varchar(64) NOT NULL default '', `file` varchar(255) NOT NULL default '', `function` varchar(128) NOT NULL default '', `status` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `hook` (`hook`), KEY `status` (`status`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `plugin_realms` -- CREATE TABLE `plugin_realms` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `plugin` varchar(32) NOT NULL default '', `file` text NOT NULL, `display` varchar(64) NOT NULL default '', PRIMARY KEY (`id`), KEY `plugin` (`plugin`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `plugin_db_changes` -- CREATE TABLE `plugin_db_changes` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `plugin` varchar(16) NOT NULL default '', `table` varchar(64) NOT NULL default '', `column` varchar(64) NOT NULL, `method` varchar(16) NOT NULL default '', PRIMARY KEY (`id`), KEY `plugin` (`plugin`), KEY `method` (`method`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; REPLACE INTO `plugin_realms` VALUES (1, 'internal', 'plugins.php', 'Plugin Management'); INSERT INTO `plugin_hooks` VALUES (1, 'internal', 'config_arrays', '', 'plugin_config_arrays', 1); INSERT INTO `plugin_hooks` VALUES (2, 'internal', 'draw_navigation_text', '', 'plugin_draw_navigation_text', 1); -- -- Table structure for table `poller` -- CREATE TABLE `poller` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `disabled` char(2) DEFAULT '', `name` varchar(30) DEFAULT NULL, `notes` varchar(1024) DEFAULT '', `status` int(10) unsigned NOT NULL DEFAULT '0', `timezone` varchar(40) DEFAULT '', `hostname` varchar(100) NOT NULL DEFAULT '', `dbdefault` varchar(20) NOT NULL DEFAULT '', `dbhost` varchar(64) NOT NULL DEFAULT '', `dbuser` varchar(20) NOT NULL DEFAULT '', `dbpass` varchar(64) NOT NULL DEFAULT '', `dbport` int(10) unsigned DEFAULT '3306', `dbretries` int(10) unsigned DEFAULT '2', `dbssl` char(3) DEFAULT '', `dbsslkey` varchar(255) DEFAULT NULL, `dbsslcert` varchar(255) DEFAULT NULL, `dbsslca` varchar(255) DEFAULT NULL, `total_time` double DEFAULT '0', `max_time` double DEFAULT NULL, `min_time` double DEFAULT NULL, `avg_time` double DEFAULT NULL, `total_polls` int(10) unsigned DEFAULT '0', `processes` int(10) unsigned DEFAULT '1', `threads` int(10) unsigned DEFAULT '1', `sync_interval` int(10) unsigned DEFAULT '7200', `snmp` mediumint(8) unsigned DEFAULT '0', `script` mediumint(8) unsigned DEFAULT '0', `server` mediumint(8) unsigned DEFAULT '0', `last_update` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_status` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `last_sync` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `requires_sync` char(2) DEFAULT '', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `disabled` (`disabled`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Pollers for Cacti'; INSERT INTO poller (id,name,hostname) VALUES (1,'Main Poller', 'localhost'); -- -- Table structure for table `poller_command` -- CREATE TABLE poller_command ( poller_id smallint(5) unsigned NOT NULL default '1', time timestamp NOT NULL default '0000-00-00 00:00:00', action tinyint(3) unsigned NOT NULL default '0', command varchar(191) NOT NULL default '', last_updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (poller_id, action, command), KEY poller_id_last_updated (poller_id, last_updated) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `poller_data_template_field_mappings` -- CREATE TABLE `poller_data_template_field_mappings` ( `data_template_id` int(10) unsigned NOT NULL DEFAULT '0', `data_name` varchar(40) NOT NULL DEFAULT '', `data_source_names` varchar(125) NOT NULL DEFAULT '', `last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`data_template_id`, `data_name`, `data_source_names`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Tracks mapping of Data Templates to their Data Source Names'; -- -- Table structure for table `poller_item` -- CREATE TABLE poller_item ( `local_data_id` int(10) unsigned NOT NULL default '0', `poller_id` int(10) unsigned NOT NULL default '1', `host_id` mediumint(8) unsigned NOT NULL default '0', `action` tinyint(3) unsigned NOT NULL default '1', `present` tinyint(3) unsigned NOT NULL DEFAULT '1', `last_updated` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `hostname` varchar(100) NOT NULL default '', `snmp_community` varchar(100) NOT NULL default '', `snmp_version` tinyint(3) unsigned NOT NULL default '0', `snmp_username` varchar(50) NOT NULL default '', `snmp_password` varchar(50) NOT NULL default '', `snmp_auth_protocol` char(6) NOT NULL default '', `snmp_priv_passphrase` varchar(200) NOT NULL default '', `snmp_priv_protocol` char(6) NOT NULL default '', `snmp_context` varchar(64) default '', `snmp_engine_id` varchar(64) default '', `snmp_port` mediumint(8) unsigned NOT NULL default '161', `snmp_timeout` mediumint(8) unsigned NOT NULL default '0', `rrd_name` varchar(19) NOT NULL default '', `rrd_path` varchar(255) NOT NULL default '', `rrd_num` tinyint(3) unsigned NOT NULL default '0', `rrd_step` mediumint(8) NOT NULL default '300', `rrd_next_step` mediumint(8) NOT NULL default '0', `arg1` TEXT, `arg2` varchar(255) default NULL, `arg3` varchar(255) default NULL, PRIMARY KEY (`local_data_id`,`rrd_name`), KEY `host_id` (`host_id`), KEY `action` (`action`), KEY `present` (`present`), KEY `poller_id_host_id` (`poller_id`,`host_id`), KEY `poller_id_rrd_next_step` (`poller_id`,`rrd_next_step`), KEY `poller_id_action` (`poller_id`,`action`), KEY `poller_id_last_updated` (`poller_id`, `last_updated`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `poller_output` -- CREATE TABLE poller_output ( local_data_id int(10) unsigned NOT NULL default '0', rrd_name varchar(19) NOT NULL default '', time timestamp NOT NULL default '0000-00-00 00:00:00', output varchar(512) NOT NULL default '', PRIMARY KEY (local_data_id, rrd_name, time) /*!50060 USING BTREE */ ) ENGINE=MEMORY; -- -- Table structure for table `poller_output_boost` -- CREATE TABLE `poller_output_boost` ( `local_data_id` int(10) unsigned NOT NULL default '0', `rrd_name` varchar(19) NOT NULL default '', `time` timestamp NOT NULL default '0000-00-00 00:00:00', `output` varchar(512) NOT NULL, PRIMARY KEY USING BTREE (`local_data_id`, `time`, `rrd_name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `poller_output_boost_local_data_ids` -- CREATE TABLE `poller_output_boost_local_data_ids` ( `local_data_id` int(10) unsigned NOT NULL DEFAULT 0, `process_handler` int(10) unsigned DEFAULT 0, PRIMARY KEY (`local_data_id`), KEY `process_handler` (`process_handler`) ) ENGINE=MEMORY; -- -- Table structure for table `poller_output_boost_processes` -- CREATE TABLE `poller_output_boost_processes` ( `sock_int_value` bigint(20) unsigned NOT NULL auto_increment, `status` varchar(255) default NULL, PRIMARY KEY (`sock_int_value`) ) ENGINE=MEMORY; -- -- Table structure for table `poller_output_realtime` -- CREATE TABLE poller_output_realtime ( local_data_id int(10) unsigned NOT NULL default '0', rrd_name varchar(19) NOT NULL default '', `time` timestamp NOT NULL default '0000-00-00 00:00:00', output text NOT NULL, poller_id varchar(256) NOT NULL default '1', PRIMARY KEY (local_data_id, rrd_name, time, poller_id), KEY poller_id (poller_id(191)), KEY `time` (`time`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `poller_reindex` -- CREATE TABLE poller_reindex ( host_id mediumint(8) unsigned NOT NULL default '0', data_query_id mediumint(8) unsigned NOT NULL default '0', action tinyint(3) unsigned NOT NULL default '0', present tinyint(3) unsigned NOT NULL DEFAULT '1', op char(1) NOT NULL default '', assert_value varchar(100) NOT NULL default '', arg1 varchar(255) NOT NULL default '', PRIMARY KEY (host_id, data_query_id, arg1(187)), KEY present (present) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `poller_resource_cache` -- CREATE TABLE poller_resource_cache ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `resource_type` varchar(20) DEFAULT NULL, `md5sum` varchar(32) DEFAULT NULL, `path` varchar(191) DEFAULT NULL, `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `contents` longblob, `attributes` INT unsigned DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `path` (`path`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Caches all scripts, resources files, and plugins'; -- -- Table structure for table `poller_time` -- CREATE TABLE poller_time ( id bigint(20) unsigned NOT NULL auto_increment, pid int(10) unsigned NOT NULL default '0', poller_id int(10) unsigned NOT NULL default '1', start_time timestamp NOT NULL default '0000-00-00 00:00:00', end_time timestamp NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (id), KEY `poller_id_end_time` (`poller_id`, `end_time`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Table structure for table `processes` -- CREATE TABLE `processes` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `pid` int(10) unsigned NOT NULL DEFAULT 0, `tasktype` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `taskname` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `taskid` int(10) unsigned NOT NULL DEFAULT 0, `timeout` int(10) unsigned DEFAULT 300, `started` timestamp NOT NULL DEFAULT current_timestamp(), `last_update` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`pid`,`tasktype`,`taskname`,`taskid`), KEY `tasktype` (`tasktype`), KEY `id` (`id`) ) ENGINE=MEMORY COMMENT='Stores Process Status for Cacti Background Processes'; -- -- Table structure for table `reports` -- CREATE TABLE `reports` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `name` varchar(100) NOT NULL DEFAULT '', `cformat` char(2) NOT NULL DEFAULT '', `format_file` varchar(255) NOT NULL DEFAULT '', `font_size` smallint(2) unsigned NOT NULL DEFAULT '0', `alignment` smallint(2) unsigned NOT NULL DEFAULT '0', `graph_linked` char(2) NOT NULL DEFAULT '', `intrvl` smallint(2) unsigned NOT NULL DEFAULT '0', `count` smallint(2) unsigned NOT NULL DEFAULT '0', `offset` int(10) unsigned NOT NULL DEFAULT '0', `mailtime` bigint(20) unsigned NOT NULL DEFAULT '0', `subject` varchar(64) NOT NULL DEFAULT '', `from_name` varchar(40) NOT NULL, `from_email` text NOT NULL, `email` text NOT NULL, `bcc` text NOT NULL, `attachment_type` smallint(2) unsigned NOT NULL DEFAULT '1', `graph_height` smallint(2) unsigned NOT NULL DEFAULT '0', `graph_width` smallint(2) unsigned NOT NULL DEFAULT '0', `graph_columns` smallint(2) unsigned NOT NULL DEFAULT '0', `thumbnails` char(2) NOT NULL DEFAULT '', `lastsent` bigint(20) unsigned NOT NULL DEFAULT '0', `enabled` char(2) DEFAULT '', PRIMARY KEY (`id`), KEY `mailtime` (`mailtime`)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Cacti Reporting Reports'; -- -- Table structure for table `reports_items` -- CREATE TABLE `reports_items` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `report_id` int(10) unsigned NOT NULL DEFAULT '0', `item_type` tinyint(3) unsigned NOT NULL DEFAULT '1', `tree_id` int(10) unsigned NOT NULL DEFAULT '0', `branch_id` int(10) unsigned NOT NULL DEFAULT '0', `tree_cascade` char(2) NOT NULL DEFAULT '', `graph_name_regexp` varchar(128) NOT NULL DEFAULT '', `site_id` int(11) NOT NULL DEFAULT '-1', `host_template_id` int(11) NOT NULL DEFAULT '-1', `host_id` int(11) NOT NULL DEFAULT '-1', `graph_template_id` int(11) NOT NULL DEFAULT '-1', `local_graph_id` int(10) unsigned NOT NULL DEFAULT '0', `timespan` int(10) unsigned NOT NULL DEFAULT '0', `align` tinyint(3) unsigned NOT NULL DEFAULT '1', `item_text` text NOT NULL, `font_size` smallint(2) unsigned NOT NULL DEFAULT '10', `sequence` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `report_id` (`report_id`)) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Cacti Reporting Items'; -- -- Table structure for table `settings` -- CREATE TABLE settings ( name varchar(75) NOT NULL default '', value varchar(4096) NOT NULL default '', PRIMARY KEY (name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `settings` -- INSERT INTO settings VALUES ('auth_method', 1); INSERT INTO settings VALUES ('selected_theme', 'modern'); -- -- Table structure for table `settings_user` -- CREATE TABLE settings_user ( user_id smallint(8) unsigned NOT NULL default '0', name varchar(75) NOT NULL default '', value varchar(4096) NOT NULL default '', PRIMARY KEY (user_id, name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `settings_user` -- -- -- Table structure for table `settings_user_group` -- CREATE TABLE settings_user_group ( group_id smallint(8) unsigned NOT NULL DEFAULT '0', name varchar(50) NOT NULL DEFAULT '', value varchar(2048) NOT NULL DEFAULT '', PRIMARY KEY (group_id, name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Stores the Default User Group Graph Settings'; -- -- Table structure for table `settings_tree` -- CREATE TABLE settings_tree ( user_id mediumint(8) unsigned NOT NULL default '0', graph_tree_item_id int(10) unsigned NOT NULL default '0', status tinyint(4) NOT NULL default '0', PRIMARY KEY (user_id, graph_tree_item_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `settings_tree` -- -- -- Table structure for table `snmp_query` -- CREATE TABLE snmp_query ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', xml_path varchar(255) NOT NULL default '', name varchar(100) NOT NULL default '', description varchar(255) default NULL, graph_template_id mediumint(8) unsigned NOT NULL default '0', data_input_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (id), KEY name (name) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `snmp_query` -- -- -- Table structure for table `snmp_query_graph` -- CREATE TABLE snmp_query_graph ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', snmp_query_id mediumint(8) unsigned NOT NULL default '0', name varchar(100) NOT NULL default '', graph_template_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (id), KEY `graph_template_id_name` (`graph_template_id`, `name`), KEY `snmp_query_id_name` (`snmp_query_id`, `name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `snmp_query_graph` -- -- -- Table structure for table `snmp_query_graph_rrd` -- CREATE TABLE snmp_query_graph_rrd ( snmp_query_graph_id mediumint(8) unsigned NOT NULL default '0', data_template_id mediumint(8) unsigned NOT NULL default '0', data_template_rrd_id int(10) unsigned NOT NULL default '0', snmp_field_name varchar(50) NOT NULL default '0', PRIMARY KEY (snmp_query_graph_id,data_template_id,data_template_rrd_id), KEY data_template_rrd_id (data_template_rrd_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `snmp_query_graph_rrd` -- -- -- Table structure for table `snmp_query_graph_rrd_sv` -- CREATE TABLE snmp_query_graph_rrd_sv ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', snmp_query_graph_id mediumint(8) unsigned NOT NULL default '0', data_template_id mediumint(8) unsigned NOT NULL default '0', sequence mediumint(8) unsigned NOT NULL default '0', field_name varchar(100) NOT NULL default '', text varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY snmp_query_graph_id (snmp_query_graph_id), KEY data_template_id (data_template_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `snmp_query_graph_rrd_sv` -- -- -- Table structure for table `snmp_query_graph_sv` -- CREATE TABLE snmp_query_graph_sv ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', snmp_query_graph_id mediumint(8) unsigned NOT NULL default '0', sequence mediumint(8) unsigned NOT NULL default '0', field_name varchar(100) NOT NULL default '', text varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY snmp_query_graph_id (snmp_query_graph_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `snmp_query_graph_sv` -- -- -- Table structure for table `user_auth` -- CREATE TABLE user_auth ( `id` mediumint(8) unsigned NOT NULL auto_increment, `username` varchar(50) NOT NULL default '0', `password` varchar(256) NOT NULL default '', `realm` mediumint(8) NOT NULL default '0', `full_name` varchar(100) default '0', `email_address` varchar(128) NULL, `must_change_password` char(2) default NULL, `password_change` char(2) default 'on', `show_tree` char(2) default 'on', `show_list` char(2) default 'on', `show_preview` char(2) NOT NULL default 'on', `graph_settings` char(2) default NULL, `login_opts` tinyint(3) unsigned NOT NULL default '1', `policy_graphs` tinyint(3) unsigned NOT NULL default '1', `policy_trees` tinyint(3) unsigned NOT NULL default '1', `policy_hosts` tinyint(3) unsigned NOT NULL default '1', `policy_graph_templates` tinyint(3) unsigned NOT NULL default '1', `enabled` char(2) NOT NULL DEFAULT 'on', `lastchange` int(11) NOT NULL DEFAULT '-1', `lastlogin` int(11) NOT NULL DEFAULT '-1', `password_history` varchar(4096) NOT NULL DEFAULT '-1', `locked` varchar(3) NOT NULL DEFAULT '', `failed_attempts` int(5) NOT NULL DEFAULT '0', `lastfail` int(10) unsigned NOT NULL DEFAULT '0', `reset_perms` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `username` (`username`), KEY `realm` (`realm`), KEY `enabled` (`enabled`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `user_auth` -- INSERT INTO user_auth VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',0,'Administrator','','on','on','on','on','on','on',2,1,1,1,1,'on',-1,-1,'-1','',0,0,0); INSERT INTO user_auth VALUES (3,'guest','43e9a4ab75570f5b',0,'Guest Account','','on','on','on','on','on',3,1,1,1,1,1,'',-1,-1,'-1','',0,0,0); -- -- Table structure for table `user_auth_cache` -- CREATE TABLE `user_auth_cache` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL DEFAULT '0', `hostname` varchar(100) NOT NULL DEFAULT '', `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `token` varchar(191) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `tokenkey` (`token`), KEY `hostname` (`hostname`), KEY `user_id` (`user_id`), KEY `last_update` (`last_update`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Caches Remember Me Details'; -- -- Dumping data for table `user_auth` -- -- -- Table structure for table `user_auth_group` -- CREATE TABLE `user_auth_group` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `description` varchar(255) NOT NULL DEFAULT '', `graph_settings` varchar(2) DEFAULT NULL, `login_opts` tinyint(3) unsigned NOT NULL DEFAULT '1', `show_tree` varchar(2) DEFAULT 'on', `show_list` varchar(2) DEFAULT 'on', `show_preview` varchar(2) NOT NULL DEFAULT 'on', `policy_graphs` tinyint(3) unsigned NOT NULL DEFAULT '1', `policy_trees` tinyint(3) unsigned NOT NULL DEFAULT '1', `policy_hosts` tinyint(3) unsigned NOT NULL DEFAULT '1', `policy_graph_templates` tinyint(3) unsigned NOT NULL DEFAULT '1', `enabled` char(2) NOT NULL DEFAULT 'on', PRIMARY KEY (`id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Groups'; -- -- Dumping data for table `user_auth_group` -- -- -- Table structure for table `user_auth_group_members` -- CREATE TABLE `user_auth_group_members` ( `group_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, PRIMARY KEY (`group_id`,`user_id`), KEY `realm_id` (`user_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Members'; -- -- Dumping data for table `user_auth_group_members` -- -- -- Table structure for table `user_auth_group_perms` -- CREATE TABLE `user_auth_group_perms` ( `group_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `item_id` mediumint(8) unsigned NOT NULL DEFAULT '0', `type` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`group_id`,`item_id`,`type`), KEY `group_id` (`group_id`,`type`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Permissions'; -- -- Dumping data for table `user_auth_group_perms` -- -- -- Table structure for table `user_auth_group_realm` -- CREATE TABLE `user_auth_group_realm` ( `group_id` int(10) unsigned NOT NULL, `realm_id` int(10) unsigned NOT NULL, PRIMARY KEY (`group_id`,`realm_id`), KEY `realm_id` (`realm_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table that Contains User Group Realm Permissions'; -- -- Dumping data for table `user_auth_group_realm` -- -- -- Table structure for table `user_auth_perms` -- CREATE TABLE user_auth_perms ( user_id mediumint(8) unsigned NOT NULL default '0', item_id mediumint(8) unsigned NOT NULL default '0', type tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (user_id,item_id,type), KEY user_id (user_id,type) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `user_auth_perms` -- -- -- Table structure for table `user_auth_realm` -- CREATE TABLE user_auth_realm ( realm_id mediumint(8) unsigned NOT NULL default '0', user_id mediumint(8) unsigned NOT NULL default '0', PRIMARY KEY (realm_id,user_id), KEY user_id (user_id) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `user_auth_realm` -- INSERT INTO user_auth_realm VALUES (1,1); INSERT INTO user_auth_realm VALUES (2,1); INSERT INTO user_auth_realm VALUES (3,1); INSERT INTO user_auth_realm VALUES (4,1); INSERT INTO user_auth_realm VALUES (5,1); INSERT INTO user_auth_realm VALUES (7,1); INSERT INTO user_auth_realm VALUES (7,3); INSERT INTO user_auth_realm VALUES (8,1); INSERT INTO user_auth_realm VALUES (9,1); INSERT INTO user_auth_realm VALUES (10,1); INSERT INTO user_auth_realm VALUES (11,1); INSERT INTO user_auth_realm VALUES (12,1); INSERT INTO user_auth_realm VALUES (13,1); INSERT INTO user_auth_realm VALUES (14,1); INSERT INTO user_auth_realm VALUES (15,1); INSERT INTO user_auth_realm VALUES (16,1); INSERT INTO user_auth_realm VALUES (17,1); INSERT INTO user_auth_realm VALUES (18,1); INSERT INTO user_auth_realm VALUES (19,1); INSERT INTO user_auth_realm VALUES (20,1); INSERT INTO user_auth_realm VALUES (21,1); INSERT INTO user_auth_realm VALUES (22,1); INSERT INTO user_auth_realm VALUES (23,1); INSERT INTO user_auth_realm VALUES (24,1); INSERT INTO user_auth_realm VALUES (25,1); INSERT INTO user_auth_realm VALUES (26,1); INSERT INTO user_auth_realm VALUES (27,1); INSERT INTO user_auth_realm VALUES (28,1); INSERT INTO user_auth_realm VALUES (101,1); INSERT INTO user_auth_realm VALUES (1043,1); -- -- Table structure for table `user_auth_row_cache` -- CREATE TABLE user_auth_row_cache ( `user_id` mediumint(8) NOT NULL default '0', `class` varchar(20) NOT NULL default '', `hash` varchar(32) NOT NULL default '0', `total_rows` int(10) unsigned NOT NULL default '0', `time` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`user_id`,`class`,`hash`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `user_auth_row_cache` -- -- -- Table structure for table `user_log` -- CREATE TABLE user_log ( `username` varchar(50) NOT NULL default '0', `user_id` mediumint(8) NOT NULL default '0', `time` timestamp NOT NULL default '0000-00-00 00:00:00', `result` tinyint(3) unsigned NOT NULL default '0', `ip` varchar(40) NOT NULL default '', PRIMARY KEY (`username`,`user_id`,`time`), KEY user_id (`user_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `user_log` -- -- -- Table structure for table `user_domains` -- CREATE TABLE `user_domains` ( `domain_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `domain_name` varchar(20) NOT NULL, `type` int(10) unsigned NOT NULL DEFAULT '0', `enabled` char(2) NOT NULL DEFAULT 'on', `defdomain` tinyint(3) unsigned NOT NULL DEFAULT '0', `user_id` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`domain_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table to Hold Login Domains'; -- -- Dumping data for table `user_domains` -- -- -- Table structure for table `user_domains_ldap` -- CREATE TABLE `user_domains_ldap` ( `domain_id` int(10) unsigned NOT NULL, `server` varchar(128) NOT NULL, `port` int(10) unsigned NOT NULL, `port_ssl` int(10) unsigned NOT NULL, `proto_version` tinyint(3) unsigned NOT NULL, `encryption` tinyint(3) unsigned NOT NULL, `referrals` tinyint(3) unsigned NOT NULL, `mode` tinyint(3) unsigned NOT NULL, `dn` varchar(128) NOT NULL, `group_require` char(2) NOT NULL, `group_dn` varchar(128) NOT NULL, `group_attrib` varchar(128) NOT NULL, `group_member_type` tinyint(3) unsigned NOT NULL, `search_base` varchar(128) NOT NULL, `search_filter` varchar(512) NOT NULL, `specific_dn` varchar(128) NOT NULL, `specific_password` varchar(128) NOT NULL, `cn_full_name` varchar(50) NULL DEFAULT '', `cn_email` varchar (50) NULL DEFAULT '', PRIMARY KEY (`domain_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Table to Hold Login Domains for LDAP'; -- -- Dumping data for table `user_domains_ldap` -- -- -- Table structure for table `sessions` -- CREATE TABLE `sessions` ( `id` varchar(32) NOT NULL, `remote_addr` varchar(25) NOT NULL DEFAULT '', `access` int(10) unsigned DEFAULT NULL, `data` mediumblob, `user_id` int(10) unsigned NOT NULL DEFAULT '0', `user_agent` varchar(128) NOT NULL DEFAULT '', `start_time` timestamp NOT NULL DEFAULT current_timestamp, `transactions` int(10) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Used for Database based Session Storage'; -- -- Dumping data for table `sessions` -- -- -- Table structure for table `sites` -- CREATE TABLE `sites` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL DEFAULT '', `address1` varchar(100) DEFAULT '', `address2` varchar(100) DEFAULT '', `city` varchar(50) DEFAULT '', `state` varchar(20) DEFAULT NULL, `postal_code` varchar(20) DEFAULT '', `country` varchar(30) DEFAULT '', `timezone` varchar(40) DEFAULT '', `latitude` decimal(13,10) NOT NULL DEFAULT '0.0000000000', `longitude` decimal(13,10) NOT NULL DEFAULT '0.0000000000', `zoom` tinyint(3) unsigned DEFAULT NULL, `alternate_id` varchar(30) DEFAULT '', `notes` varchar(1024), PRIMARY KEY (`id`), KEY `name` (`name`), KEY `city` (`city`), KEY `state` (`state`), KEY `postal_code` (`postal_code`), KEY `country` (`country`), KEY `alternate_id` (`alternate_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Contains information about customer sites'; -- -- Dumping data for table `sites` -- INSERT INTO `sites` VALUES (1,'Edge','','','','','','','',0.0000000000,0.0000000000,'','',''); INSERT INTO `sites` VALUES (2,'Core','','','','','','','',0.0000000000,0.0000000000,'','',''); -- -- Table structure for table `snmpagent_cache` -- CREATE TABLE `snmpagent_cache` ( `oid` varchar(50) NOT NULL, `name` varchar(50) NOT NULL, `mib` varchar(50) NOT NULL, `type` varchar(50) NOT NULL DEFAULT '', `otype` varchar(50) NOT NULL DEFAULT '', `kind` varchar(50) NOT NULL DEFAULT '', `max-access` varchar(50) NOT NULL DEFAULT 'not-accessible', `value` varchar(255) NOT NULL DEFAULT '', `description` varchar(5000) NOT NULL DEFAULT '', PRIMARY KEY (`oid`), KEY `name` (`name`), KEY `mib_name` (`mib`,`name`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='SNMP MIB CACHE'; -- -- Dumping data for table `snmpagent_cache` -- -- -- Table structure for table `snmpagent_mibs` -- CREATE TABLE `snmpagent_mibs` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL DEFAULT '', `file` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Registered MIB files'; -- -- Dumping data for table `snmpagent_mibs` -- -- -- Table structure for table `snmpagent_cache_notifications` -- CREATE TABLE `snmpagent_cache_notifications` ( `name` varchar(50) NOT NULL, `mib` varchar(50) NOT NULL, `attribute` varchar(50) NOT NULL, `sequence_id` smallint(6) NOT NULL, PRIMARY KEY (`name`,`mib`,`attribute`,`sequence_id`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Notifications and related attributes'; -- -- Dumping data for table `snmpagent_cache_notifications` -- -- -- Table structure for table `snmpagent_cache_textual_conventions` -- CREATE TABLE `snmpagent_cache_textual_conventions` ( `name` varchar(50) NOT NULL, `mib` varchar(50) NOT NULL, `type` varchar(50) NOT NULL DEFAULT '', `description` varchar(5000) NOT NULL DEFAULT '', PRIMARY KEY (`name`,`mib`,`type`), KEY `mib` (`mib`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='Textual conventions'; -- -- Dumping data for table `snmpagent_cache_textual_conventions` -- -- -- Table structure for table `snmpagent_managers` -- CREATE TABLE `snmpagent_managers` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hostname` varchar(100) NOT NULL, `description` varchar(255) NOT NULL, `disabled` char(2) DEFAULT NULL, `max_log_size` tinyint(4) NOT NULL, `snmp_version` tinyint(3) unsigned NOT NULL DEFAULT '1', `snmp_community` varchar(100) NOT NULL DEFAULT '', `snmp_username` varchar(50) NOT NULL, `snmp_password` varchar(50) NOT NULL, `snmp_auth_protocol` char(6) NOT NULL, `snmp_priv_passphrase` varchar(200) NOT NULL, `snmp_priv_protocol` char(6) NOT NULL, `snmp_engine_id` varchar(64) DEFAULT NULL, `snmp_port` mediumint(8) unsigned NOT NULL DEFAULT '161', `snmp_message_type` tinyint(4) NOT NULL, `notes` text, PRIMARY KEY (`id`), KEY `hostname` (`hostname`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='snmp notification receivers'; -- -- Dumping data for table `snmpagent_managers` -- -- -- Table structure for table `snmpagent_managers_notifications` -- CREATE TABLE `snmpagent_managers_notifications` ( `manager_id` int(10) unsigned NOT NULL, `notification` varchar(50) NOT NULL, `mib` varchar(50) NOT NULL, PRIMARY KEY(`manager_id`,`notification`,`mib`), KEY `mib` (`mib`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='snmp notifications to receivers'; -- -- Dumping data for table `snmpagent_managers_notifications` -- -- -- Table structure for table `snmpagent_notifications_log` -- CREATE TABLE `snmpagent_notifications_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `time` int(24) NOT NULL, `severity` tinyint(4) NOT NULL, `manager_id` int(10) unsigned NOT NULL, `notification` varchar(190) NOT NULL, `mib` varchar(50) NOT NULL, `varbinds` varchar(5000) NOT NULL, PRIMARY KEY (`id`), KEY `time` (`time`), KEY `severity` (`severity`), KEY `manager_id_notification` (`manager_id`,`notification`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='logs snmp notifications to receivers'; -- -- Dumping data for table `snmpagent_notifications_log` -- -- -- Table structure for table `vdef` -- CREATE TABLE vdef ( id mediumint(8) unsigned NOT NULL auto_increment, hash varchar(32) NOT NULL default '', name varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY `hash` (`hash`), KEY `name` (`name`(171)) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='vdef'; -- -- Dumping data for table `vdef` -- INSERT INTO vdef VALUES(1, 'e06ed529238448773038601afb3cf278', 'Maximum'); INSERT INTO vdef VALUES(2, 'e4872dda82092393d6459c831a50dc3b', 'Minimum'); INSERT INTO vdef VALUES(3, '5ce1061a46bb62f36840c80412d2e629', 'Average'); INSERT INTO vdef VALUES(4, '06bd3cbe802da6a0745ea5ba93af554a', 'Last (Current)'); INSERT INTO vdef VALUES(5, '631c1b9086f3979d6dcf5c7a6946f104', 'First'); INSERT INTO vdef VALUES(6, '6b5335843630b66f858ce6b7c61fc493', 'Total: Current Data Source'); INSERT INTO vdef VALUES(7, 'c80d12b0f030af3574da68b28826cd39', '95th Percentage: Current Data Source'); -- -- Table structure for table `vdef_items` -- CREATE TABLE vdef_items ( `id` mediumint(8) unsigned NOT NULL auto_increment, `hash` varchar(32) NOT NULL default '', `vdef_id` mediumint(8) unsigned NOT NULL default '0', `sequence` mediumint(8) unsigned NOT NULL default '0', `type` tinyint(3) unsigned NOT NULL default '0', `value` varchar(150) NOT NULL default '', PRIMARY KEY (id), KEY `vdef_id_sequence` (`vdef_id`,`sequence`) ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='vdef items'; -- -- Dumping data for table `vdef_items` -- INSERT INTO vdef_items VALUES(1, '88d33bf9271ac2bdf490cf1784a342c1', 1, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(2, 'a307afab0c9b1779580039e3f7c4f6e5', 1, 2, 1, '1'); INSERT INTO vdef_items VALUES(3, '0945a96068bb57c80bfbd726cf1afa02', 2, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(4, '95a8df2eac60a89e8a8ca3ea3d019c44', 2, 2, 1, '2'); INSERT INTO vdef_items VALUES(5, 'cc2e1c47ec0b4f02eb13708cf6dac585', 3, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(6, 'a2fd796335b87d9ba54af6a855689507', 3, 2, 1, '3'); INSERT INTO vdef_items VALUES(7, 'a1d7974ee6018083a2053e0d0f7cb901', 4, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(8, '26fccba1c215439616bc1b83637ae7f3', 4, 2, 1, '5'); INSERT INTO vdef_items VALUES(9, 'a8993b265f4c5398f4a47c44b5b37a07', 5, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(10, '5a380d469d611719057c3695ce1e4eee', 5, 2, 1, '6'); INSERT INTO vdef_items VALUES(11, '65cfe546b17175fad41fcca98c057feb', 6, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(12, 'f330b5633c3517d7c62762cef091cc9e', 6, 2, 1, '7'); INSERT INTO vdef_items VALUES(13, 'f1bf2ecf54ca0565cf39c9c3f7e5394b', 7, 1, 4, 'CURRENT_DATA_SOURCE'); INSERT INTO vdef_items VALUES(14, '11a26f18feba3919be3af426670cba95', 7, 2, 6, '95'); INSERT INTO vdef_items VALUES(15, 'e7ae90275bc1efada07c19ca3472d9db', 7, 3, 1, '8'); -- -- Table structure for table `rrdcheck` -- CREATE TABLE rrdcheck ( `local_data_id` mediumint(8) unsigned NOT NULL, `test_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `message` varchar(250) default '' ) ENGINE=InnoDB ROW_FORMAT=Dynamic COMMENT='rrdcheck'; -- -- Table structure for table `version` -- CREATE TABLE version ( cacti char(20) default '', PRIMARY KEY (cacti) ) ENGINE=InnoDB ROW_FORMAT=Dynamic; -- -- Dumping data for table `version` -- INSERT INTO version VALUES ('new_install'); cacti-release-1.2.26/cactid.php000077500000000000000000000160631454067461500162700ustar00rootroot00000000000000#!/usr/bin/env php = 2) { print 'The Cacti Daemon is still running' . PHP_EOL; return; } } else { fclose(STDERR); $STDERR = fopen('null', 'wb'); } print 'Starting Cacti Daemon ... '; if (!$foreground) { if (function_exists('pcntl_fork')) { // Close the database connection db_close(); // Fork the current process to daemonize $pid = pcntl_fork(); if ($pid == -1) { // Something went wrong print '[FAILED]' . PHP_EOL; exit(1); } elseif ($pid == 0) { // We are the child } else { cacti_log('NOTE: Cacti Daemon PID[' . getmypid() . '] Started on Device[' . gethostname() . ']'); admin_email(__('Cacti System Notice'), __('Notice: Cacti Daemon PID[' . getmypid() . '] Started on Device[' . gethostname() . ']', true, 'CACTID')); print '[OK]' . PHP_EOL; exit(0); } } else { // On Windows we run in foreground mode print '[OK]' . PHP_EOL . '[NOTE] This system does not support forking.' . PHP_EOL; } } else { print '[OK]' . PHP_EOL . '[NOTE] The Cacti Daemon is running in foreground mode.' . PHP_EOL; } sleep(2); while (true) { wait_for_start($frequency); db_check_reconnect(false, $logrecon); run_poller(); // Force Cacti to check the service start frequency dynamically $frequency = -1; $logrecon = true; } function wait_for_start($frequency = -1) { $prev_time = -1; $i = 0; while (true) { if ($frequency <= 0) { $frequency = read_config_option('cron_interval', true); if (empty($frequency)) { $frequency = 300; } } $now = time(); $offset = $now % $frequency; if ($i % 5 == 0) { debug('PrevOS: ' . $prev_time . ', CurrOS: ' . $offset . ', Freq: ' . $frequency); } if ($prev_time > 0) { if ($offset < $prev_time) { debug('Time to Run Poller'); break; } } $prev_time = $offset; $i++; sleep(1); } return $frequency; } function run_poller() { global $config, $debug; debug('Cacti Data Collector'); $command = ' -q ' . $config['base_path'] . '/poller.php --force' . ($debug ? ' --debug':''); debug('Command Line is: ' . $command); exec_background(read_config_option('path_php_binary'), $command); } function get_options() { $parms = $_SERVER['argv']; array_shift($parms); $options = array(); if (sizeof($parms)) { $shortopts = 'VvHh'; $longopts = array( 'foreground', 'debug', 'version', 'help' ); $options = getopt($shortopts, $longopts); foreach($options as $arg => $value) { switch($arg) { case 'foreground': case 'debug': break; case 'version': case 'V': case 'v': display_version(); exit(0); case 'help': case 'H': case 'h': display_help(); exit(0); default: print "ERROR: Invalid Argument: ($arg)" . PHP_EOL . PHP_EOL; display_help(); exit(1); } } } return $options; } function debug($string) { global $debug; if ($debug) { $output = 'DEBUG: ' . trim($string); print $output . PHP_EOL; } } function display_version() { global $config; print 'The Cacti Daemon (cactid), Version ' . CACTI_VERSION . ', ' . COPYRIGHT_YEARS . PHP_EOL; } /* display_help - displays the usage of the function */ function display_help () { display_version(); print PHP_EOL . 'usage: cactid.php [ --foreground ] [ --debug ]' . PHP_EOL . PHP_EOL; print 'Daemon for Cacti data collection, otherwise known as cactid.' . PHP_EOL; print 'optional:' . PHP_EOL; print ' --foreground Run cactid in foreground mode, otherwise this is a forking daemon.' . PHP_EOL; print ' --debug Used for debugging in --foreground mode.' . PHP_EOL; } cacti-release-1.2.26/cdef.php000066400000000000000000000707351454067461500157450ustar00rootroot00000000000000 __('Delete'), 2 => __('Duplicate') ); /* set default action */ set_default_action(); switch (get_request_var('action')) { case 'save': form_save(); break; case 'actions': form_actions(); break; case 'item_remove_confirm': cdef_item_remove_confirm(); break; case 'item_remove': cdef_item_remove(); header('Location: cdef.php?action=edit&id=' . get_request_var('cdef_id')); break; case 'item_movedown': get_filter_request_var('cdef_id'); item_movedown(); header('Location: cdef.php?action=edit&id=' . get_request_var('cdef_id')); break; case 'item_moveup': get_filter_request_var('cdef_id'); item_moveup(); header('Location: cdef.php?action=edit&id=' . get_request_var('cdef_id')); break; case 'item_edit': top_header(); item_edit(); bottom_footer(); break; case 'edit': top_header(); cdef_edit(); bottom_footer(); break; case 'ajax_dnd': cdef_item_dnd(); break; default: top_header(); cdef(); bottom_footer(); break; } /* -------------------------- Global Form Functions -------------------------- */ function draw_cdef_preview($cdef_id) { ?>
    cdef=
    ', $cdef['name'], $cdef_title); /* create new entry: host_template */ $save['id'] = 0; $save['hash'] = get_hash_cdef(0); foreach ($fields_cdef_edit as $field => $array) { if (!preg_match('/^hidden/', $array['method'])) { $save[$field] = $cdef[$field]; } } $cdef_id = sql_save($save, 'cdef'); /* create new entry(s): cdef_items */ if (cacti_sizeof($cdef_items) > 0) { foreach ($cdef_items as $cdef_item) { unset($save); $save['id'] = 0; $save['hash'] = get_hash_cdef(0, 'cdef_item'); $save['cdef_id'] = $cdef_id; $save['sequence'] = $cdef_item['sequence']; $save['type'] = $cdef_item['type']; $save['value'] = $cdef_item['value']; sql_save($save, 'cdef_items'); } } } /* ------------------------ The 'actions' function ------------------------ */ function form_actions() { global $cdef_actions; /* ================= input validation ================= */ get_filter_request_var('drp_action', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-zA-Z0-9_]+)$/'))); /* ==================================================== */ /* if we are to save this form, instead of display it */ if (isset_request_var('selected_items')) { $selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items')); if ($selected_items != false) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ db_execute('DELETE FROM cdef WHERE ' . array_to_sql_or($selected_items, 'id')); db_execute('DELETE FROM cdef_items WHERE ' . array_to_sql_or($selected_items, 'cdef_id')); } elseif (get_nfilter_request_var('drp_action') == '2') { /* duplicate */ for ($i=0;($i $val) { if (preg_match('/^chk_([0-9]+)$/', $var, $matches)) { /* ================= input validation ================= */ input_validate_input_number($matches[1]); /* ==================================================== */ $cdef_list .= '
  • ' . html_escape(db_fetch_cell_prepared('SELECT name FROM cdef WHERE id = ?', array($matches[1]))) . '
  • '; $cdef_array[$i] = $matches[1]; $i++; } } top_header(); form_start('cdef.php'); html_start_box($cdef_actions[get_nfilter_request_var('drp_action')], '60%', '', '3', 'center', ''); if (isset($cdef_array) && cacti_sizeof($cdef_array)) { if (get_nfilter_request_var('drp_action') == '1') { /* delete */ print "

    " . __n('Click \'Continue\' to delete the following CDEF.', 'Click \'Continue\' to delete all following CDEFs.', cacti_sizeof($cdef_array)) . "

      $cdef_list
    \n"; $save_html = " "; } elseif (get_nfilter_request_var('drp_action') == '2') { /* duplicate */ print "

    " . __n('Click \'Continue\' to duplicate the following CDEF. You can optionally change the title format for the new CDEF.', 'Click \'Continue\' to duplicate the following CDEFs. You can optionally change the title format for the new CDEFs.', cacti_sizeof($cdef_array)) . "

      $cdef_list

    " . __('Title Format:') . '
    '; form_text_box('title_format', ' (1)', '', '255', '30', 'text'); print "

    \n"; $save_html = " "; } } else { raise_message(40); header('Location: cdef.php?header=false'); exit; } print " $save_html "; html_end_box(); form_end(); bottom_footer(); } /* -------------------------- CDEF Item Functions -------------------------- */ function cdef_item_remove_confirm() { global $cdef_functions, $cdef_item_types, $custom_cdef_data_source_types; /* ================= input validation ================= */ get_filter_request_var('id'); get_filter_request_var('cdef_id'); /* ==================================================== */ /* sort the cdef functions */ asort($cdef_functions); form_start('cdef.php'); html_start_box('', '100%', '', '3', 'center', ''); $cdef = db_fetch_row_prepared('SELECT * FROM cdef WHERE id = ?', array(get_request_var('id'))); $cdef_item = db_fetch_row_prepared('SELECT * FROM cdef_items WHERE id = ?', array(get_request_var('cdef_id'))); ?>


    :

    ' onClick='$("#cdialog").dialog("close");$(".deleteMarker").blur();' name='cancel'> ' name='continue' title=''> '> '> array( 'method' => 'drop_array', 'friendly_name' => __('CDEF Item Type'), 'description' => __('Choose what type of CDEF item this is.'), 'value' => $current_type, 'array' => $cdef_item_types ), 'value' => array( 'method' => 'drop_array', 'friendly_name' => __('CDEF Item Value'), 'description' => __('Enter a value for this CDEF item.'), 'value' => (isset($cdef['value']) ? $cdef['value']:'') ), 'id' => array( 'method' => 'hidden', 'value' => isset_request_var('id') ? get_request_var('id') : '0', ), 'type' => array( 'method' => 'hidden', 'value' => $current_type ), 'cdef_id' => array( 'method' => 'hidden', 'value' => get_request_var('cdef_id') ), 'save_component_item' => array( 'method' => 'hidden', 'value' => '1' ) ); switch ($current_type) { case '1': $form_cdef['value']['array'] = $cdef_functions; break; case '2': $form_cdef['value']['array'] = $cdef_operators; break; case '4': $form_cdef['value']['array'] = $custom_data_source_types; break; case '5': $form_cdef['value']['method'] = 'drop_sql'; $form_cdef['value']['sql'] = 'SELECT name, id FROM cdef WHERE `system` = 0 ORDER BY name'; break; case '6': $form_cdef['value']['method'] = 'textbox'; $form_cdef['value']['max_length'] = '255'; $form_cdef['value']['size'] = '30'; break; } draw_edit_form( array( 'config' => array('no_form_tag' => true), 'fields' => inject_form_variables($form_cdef, $cdef) ) ); ?> array('no_form_tag' => true), 'fields' => inject_form_variables($fields_cdef_edit, (isset($cdef) ? $cdef : array())) ) ); html_end_box(true, true); if (!isempty_request_var('id')) { html_start_box('', '100%', '', '3', 'center', ''); draw_cdef_preview(get_request_var('id')); html_end_box(); html_start_box(__('CDEF Items'), '100%', '', '3', 'center', 'cdef.php?action=item_edit&cdef_id=' . $cdef['id']); $display_text = array( array('display' => __('Item'), 'align' => 'left'), array('display' => __('Item Value'), 'align' => 'left') ); html_header($display_text, 2); $cdef_items = db_fetch_assoc_prepared('SELECT * FROM cdef_items WHERE cdef_id = ? ORDER BY sequence', array(get_request_var('id'))); $i = 1; $total_items = cacti_sizeof($cdef_items); if (cacti_sizeof($cdef_items)) { foreach ($cdef_items as $cdef_item) { form_alternate_row('line' . $cdef_item['id'], true, true);?> '> : 0) { echo ''; } else { echo ''; } if ($i > 1 && $i <= $total_items) { echo ''; } else { echo ''; } } ?> ' class='delete deleteMarker fa fa-times' title='' href='#'> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => '-1' ), 'page' => array( 'filter' => FILTER_VALIDATE_INT, 'default' => '1' ), 'filter' => array( 'filter' => FILTER_DEFAULT, 'pageset' => true, 'default' => '' ), 'sort_column' => array( 'filter' => FILTER_CALLBACK, 'default' => 'name', 'options' => array('options' => 'sanitize_search_string') ), 'sort_direction' => array( 'filter' => FILTER_CALLBACK, 'default' => 'ASC', 'options' => array('options' => 'sanitize_search_string') ), 'has_graphs' => array( 'filter' => FILTER_VALIDATE_REGEXP, 'options' => array('options' => array('regexp' => '(true|false)')), 'pageset' => true, 'default' => read_config_option('default_has') == 'on' ? 'true':'false' ) ); validate_store_request_vars($filters, 'sess_cdef'); /* ================= input validation ================= */ if (get_request_var('rows') == '-1') { $rows = read_config_option('num_rows_table'); } else { $rows = get_request_var('rows'); } html_start_box(__('CDEFs'), '100%', '', '3', 'center', 'cdef.php?action=edit'); ?>
    '> > ' title=''> ' title=''>
    0'; } else { $sql_having = ''; } $total_rows = db_fetch_cell("SELECT COUNT(`rows`) FROM ( SELECT cd.id AS `rows`, SUM(CASE WHEN local_graph_id>0 THEN 1 ELSE 0 END) AS graphs FROM cdef AS cd LEFT JOIN ( SELECT DISTINCT cdef_id, local_graph_id, graph_template_id FROM graph_templates_item ) AS gti ON gti.cdef_id=cd.id $sql_where GROUP BY cd.id $sql_having ) AS rs"); $sql_order = get_order_string(); $sql_limit = ' LIMIT ' . ($rows*(get_request_var('page')-1)) . ',' . $rows; $cdef_list = db_fetch_assoc("SELECT rs.*, SUM(CASE WHEN local_graph_id=0 THEN 1 ELSE 0 END) AS templates, SUM(CASE WHEN local_graph_id>0 THEN 1 ELSE 0 END) AS graphs FROM ( SELECT cd.*, gti.local_graph_id FROM cdef AS cd LEFT JOIN ( SELECT DISTINCT cdef_id, local_graph_id, graph_template_id FROM graph_templates_item ) AS gti ON gti.cdef_id=cd.id WHERE `system` = 0 GROUP BY cd.id, gti.graph_template_id, gti.local_graph_id ) AS rs $sql_where GROUP BY rs.id $sql_having $sql_order $sql_limit"); $nav = html_nav_bar('cdef.php?filter=' . get_request_var('filter'), MAX_DISPLAY_PAGES, get_request_var('page'), $rows, $total_rows, 5, __('CDEFs'), 'page', 'main'); form_start('cdef.php', 'chk'); print $nav; html_start_box('', '100%', '', '3', 'center', ''); $display_text = array( 'name' => array('display' => __('CDEF Name'), 'align' => 'left', 'sort' => 'ASC', 'tip' => __('The name of this CDEF.')), 'nosort' => array('display' => __('Deletable'), 'align' => 'right', 'tip' => __('CDEFs that are in use cannot be Deleted. In use is defined as being referenced by a Graph or a Graph Template.')), 'graphs' => array('display' => __('Graphs Using'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __('The number of Graphs using this CDEF.')), 'templates' => array('display' => __('Templates Using'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __('The number of Graphs Templates using this CDEF.'))); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); $i = 0; if (cacti_sizeof($cdef_list)) { foreach ($cdef_list as $cdef) { if ($cdef['graphs'] == 0 && $cdef['templates'] == 0) { $disabled = false; } else { $disabled = true; } form_alternate_row('line' . $cdef['id'], false, $disabled); form_selectable_cell(filter_value($cdef['name'], get_request_var('filter'), 'cdef.php?action=edit&id=' . $cdef['id']), $cdef['id']); form_selectable_cell($disabled ? __('No'):__('Yes'), $cdef['id'], '', 'right'); form_selectable_cell(number_format_i18n($cdef['graphs'], '-1'), $cdef['id'], '', 'right'); form_selectable_cell(number_format_i18n($cdef['templates'], '-1'), $cdef['id'], '', 'right'); form_checkbox_cell($cdef['name'], $cdef['id'], $disabled); form_end_row(); } } else { print "" . __('No CDEFs') . "\n"; } html_end_box(false); if (cacti_sizeof($cdef_list)) { print $nav; } /* draw the dropdown containing a list of available actions for this form */ draw_actions_dropdown($cdef_actions); form_end(); } cacti-release-1.2.26/cli/000077500000000000000000000000001454067461500150665ustar00rootroot00000000000000cacti-release-1.2.26/cli/.htaccess000066400000000000000000000033031454067461500166630ustar00rootroot00000000000000# +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2023 The Cacti Group | # | | # | This program is free software; you can redistribute it and/or | # | modify it under the terms of the GNU General Public License | # | as published by the Free Software Foundation; either version 2 | # | of the License, or (at your option) any later version. | # | | # | This program is distributed in the hope that it will be useful, | # | but WITHOUT ANY WARRANTY; without even the implied warranty of | # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # | GNU General Public License for more details. | # +-------------------------------------------------------------------------+ # | Cacti: The Complete RRDtool-based Graphing Solution | # +-------------------------------------------------------------------------+ # | This code is designed, written, and maintained by the Cacti Group. See | # | about.php and/or the AUTHORS file for specific developer information. | # +-------------------------------------------------------------------------+ # | http://www.cacti.net/ | # +-------------------------------------------------------------------------+ # Apache 2.4 Require all denied # Apache 2.2 Order Allow,Deny Deny from all cacti-release-1.2.26/cli/add_data_query.php000077500000000000000000000175171454067461500205630ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms)) { $displayHosts = false; $displayDataQueries = false; $quietMode = false; unset($host_id); unset($data_query_id); unset($reindex_method); foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '-d': $debug = true; break; case '--host-id': $host_id = trim($value); if (!is_numeric($host_id)) { print "ERROR: You must supply a valid host-id to run this script!\n"; exit(1); } break; case '--data-query-id': $data_query_id = $value; if (!is_numeric($data_query_id)) { print "ERROR: You must supply a numeric data-query-id for all hosts!\n"; exit(1); } break; case '--reindex-method': if (is_numeric($value) && ($value >= DATA_QUERY_AUTOINDEX_NONE) && ($value <= DATA_QUERY_AUTOINDEX_FIELD_VERIFICATION)) { $reindex_method = $value; } else { switch (strtolower($value)) { case 'none': $reindex_method = DATA_QUERY_AUTOINDEX_NONE; break; case 'uptime': $reindex_method = DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME; break; case 'index': $reindex_method = DATA_QUERY_AUTOINDEX_INDEX_NUM_CHANGE; break; case 'fields': $reindex_method = DATA_QUERY_AUTOINDEX_FIELD_VERIFICATION; break; default: print "ERROR: You must supply a valid reindex method for all hosts!\n"; exit(1); } } break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); case '--list-hosts': $displayHosts = true; break; case '--list-data-queries': $displayDataQueries = true; break; case '--quiet': $quietMode = true; break; default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } /* list options, recognizing $quietMode */ if ($displayHosts) { $hosts = getHosts(); displayHosts($hosts, $quietMode); exit; } if ($displayDataQueries) { $data_queries = getSNMPQueries(); displaySNMPQueries($data_queries, $quietMode); exit; } /* * verify required parameters * for update / insert options */ if (!isset($host_id)) { print "ERROR: You must supply a valid host-id for all hosts!\n"; exit(1); } if (!isset($data_query_id)) { print "ERROR: You must supply a valid data-query-id for all hosts!\n"; exit(1); } if (!isset($reindex_method)) { print "ERROR: You must supply a valid reindex-method for all hosts!\n"; exit(1); } /* * verify valid host id and get a name for it */ $host_name = db_fetch_cell('SELECT hostname FROM host WHERE id = ' . $host_id); if (!isset($host_name)) { print "ERROR: Unknown Host Id ($host_id)\n"; exit(1); } /* * verify valid data query and get a name for it */ $data_query_name = db_fetch_cell('SELECT name FROM snmp_query WHERE id = ' . $data_query_id); if (!isset($data_query_name)) { print "ERROR: Unknown Data Query Id ($data_query_id)\n"; exit(1); } /* * Now, add the data query and run it once to get the cache filled */ $exists_already = db_fetch_cell("SELECT host_id FROM host_snmp_query WHERE host_id=$host_id AND snmp_query_id=$data_query_id AND reindex_method=$reindex_method"); if ((isset($exists_already)) && ($exists_already > 0)) { print "ERROR: Data Query is already associated for host: ($host_id: $host_name) data query ($data_query_id: $data_query_name) reindex method ($reindex_method: " . $reindex_types[$reindex_method] . ")\n"; exit(1); } else { db_execute('REPLACE INTO host_snmp_query (host_id,snmp_query_id,reindex_method) VALUES (' . $host_id . ',' . $data_query_id . ',' . $reindex_method . ')'); /* recache snmp data */ run_data_query($host_id, $data_query_id); } if (is_error_message()) { print "ERROR: Failed to add this data query for host ($host_id: $host_name) data query ($data_query_id: $data_query_name) reindex method ($reindex_method: " . $reindex_types[$reindex_method] . ")\n"; exit(1); } else { print "Success - Host ($host_id: $host_name) data query ($data_query_id: $data_query_name) reindex method ($reindex_method: " . $reindex_types[$reindex_method] . ")\n"; exit; } } else { display_help(); exit; } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Data Query Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_data_query.php --host-id=[ID] --data-query-id=[dq_id] --reindex-method=[method] [--quiet]\n\n"; print "Required Options:\n"; print " --host-id the numerical ID of the host\n"; print " --data-query-id the numerical ID of the data_query to be added\n"; print " --reindex-method the reindex method to be used for that data query\n"; print " 0|None = no reindexing\n"; print " 1|Uptime = Uptime goes Backwards\n"; print " 2|Index = Index Count Changed\n"; print " 3|Fields = Verify all Fields\n\n"; print "List Options:\n"; print " --list-hosts\n"; print " --list-data-queries\n"; print " --quiet - batch mode value return\n\n"; print "If the data query was already associated, it will be reindexed.\n\n"; } cacti-release-1.2.26/cli/add_datasource.php000077500000000000000000000101311454067461500205400ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER["argv"]; array_shift($parms); unset($host_id); unset($graph_template_id); unset($data_template_id); foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '--host-id': $host_id = trim($value); if (!is_numeric($host_id)) { print 'ERROR: You must supply a valid host-id to run this script!' . PHP_EOL; exit(1); } break; case '--data-template-id': $data_template_id = $value; if (!is_numeric($data_template_id)) { print 'ERROR: You must supply a numeric data-template-id!' . PHP_EOL; exit(1); } break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); default: print 'ERROR: Invalid Parameter ' . $parameter . PHP_EOL . PHP_EOL; display_help(); exit(1); } } if (!isset($host_id)) { print "ERROR: You must supply a valid host-id!\n"; exit(1); } if (!isset($data_template_id)) { print "ERROR: You must supply a valid data-template-id!\n"; exit(1); } //Following code was copied from data_sources.php->function form_save->save_component_data_source_new $save["id"] = "0"; $save["data_template_id"] = $data_template_id; $save["host_id"] = $host_id; $local_data_id = sql_save($save, "data_local"); change_data_template($local_data_id, $data_template_id); /* update the title cache */ update_data_source_title_cache($local_data_id); /* update host data */ if (!empty($host_id)) { push_out_host($host_id, $local_data_id); } print "DS Added - DS[$local_data_id]\n"; /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Data Source, Version $version, " . COPYRIGHT_YEARS . PHP_EOL; } function display_help() { display_version(); print "usage: add_datasource.php --host-id=[ID] --data-template-id=[ID]\n\n"; print "Cacti utility for adding datasources via a command line interface.\n\n"; print "--host-id=id - The host id\n"; print "--data-template-id=id - The numerical ID of the data template to be added\n"; } cacti-release-1.2.26/cli/add_device.php000077500000000000000000000367241454067461500176650ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms)) { /* setup defaults */ $description = ''; $ip = ''; $poller_id = $config['poller_id']; $site_id = read_config_option('default_site'); $template_id = read_config_option('default_template'); $community = read_config_option('snmp_community'); $snmp_ver = read_config_option('snmp_version'); $disable = 0; $notes = ''; $location = ''; $external_id = ''; $snmp_username = read_config_option('snmp_username'); $snmp_password = read_config_option('snmp_password'); $snmp_auth_protocol = read_config_option('snmp_auth_protocol'); $snmp_priv_passphrase = read_config_option('snmp_priv_passphrase'); $snmp_priv_protocol = read_config_option('snmp_priv_protocol'); $snmp_context = ''; $snmp_engine_id = ''; $snmp_port = read_config_option('snmp_port'); $snmp_timeout = read_config_option('snmp_timeout'); $avail = 1; $ping_method = read_config_option('ping_method'); $ping_port = read_config_option('ping_port'); $ping_timeout = read_config_option('ping_timeout'); $ping_retries = read_config_option('ping_retries'); $max_oids = read_config_option('max_get_size'); $bulk_walk_size = -1; $proxy = false; $device_threads = read_config_option('device_threads');; $displayHostTemplates = false; $displayCommunities = false; $quietMode = false; foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '-d': $debug = true; break; case '--description': $description = trim($value); break; case '--ip': $ip = trim($value); break; case '--template': $template_id = $value; break; case '--community': $community = trim($value); break; case '--version': if (cacti_sizeof($parms) == 1) { display_version(); exit(0); } else { $snmp_ver = trim($value); } break; case '--notes': $notes = trim($value); break; case '--location': $location = trim($value); break; case '--site': $site_id = trim($value); break; case '--poller': $poller_id = trim($value); break; case '--disable': $disable = $value; break; case '--external-id': $external_id = $value; break; case '--username': $snmp_username = trim($value); break; case '--password': $snmp_password = trim($value); break; case '--authproto': $snmp_auth_protocol = trim($value); break; case '--privproto': $snmp_priv_protocol = trim($value); break; case '--privpass': $snmp_priv_passphrase = trim($value); break; case '--context': $snmp_context = trim($value); break; case '--engineid': $snmp_engine_id = trim($value); break; case '--port': $snmp_port = $value; break; case '--proxy': $proxy = true; break; case '--timeout': $snmp_timeout = $value; break; case '--ping_timeout': $ping_timeout = $value; break; case '--threads': $device_threads = $value; break; case '--avail': switch($value) { case 'none': $avail = '0'; /* tried to use AVAIL_NONE, but then preg_match fails on validation, sigh */ break; case 'ping': $avail = AVAIL_PING; break; case 'snmp': $avail = AVAIL_SNMP; break; case 'pingsnmp': $avail = AVAIL_SNMP_AND_PING; break; case 'pingorsnmp': $avail = AVAIL_SNMP_OR_PING; break; default: print "ERROR: Invalid Availability Parameter: ($value)\n\n"; display_help(); exit(1); } break; case '--ping_method': switch(strtolower($value)) { case 'icmp': $ping_method = PING_ICMP; break; case 'tcp': $ping_method = PING_TCP; break; case 'udp': $ping_method = PING_UDP; break; default: print "ERROR: Invalid Ping Method: ($value)\n\n"; display_help(); exit(1); } break; case '--ping_port': if (is_numeric($value) && ($value > 0)) { $ping_port = $value; } else { print "ERROR: Invalid Ping Port: ($value)\n\n"; display_help(); exit(1); } break; case '--ping_retries': if (is_numeric($value) && ($value > 0)) { $ping_retries = $value; } else { print "ERROR: Invalid Ping Retries: ($value)\n\n"; display_help(); exit(1); } break; case '--max_oids': if (is_numeric($value) && ($value > 0)) { $max_oids = $value; } else { print "ERROR: Invalid Max OIDS: ($value)\n\n"; display_help(); exit(1); } break; case '--bulk_walk': if (is_numeric($value) && $value >= -1 && $value != 0) { $bulk_walk_size = $value; } else { print "ERROR: Invalid Bulk Walk Size: ($value)\n\n"; display_help(); exit(1); } break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); case '--list-communities': $displayCommunities = true; break; case '--list-host-templates': $displayHostTemplates = true; break; case '--quiet': $quietMode = true; break; default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } if ($displayCommunities) { displayCommunities($quietMode); exit(0); } if ($displayHostTemplates) { displayHostTemplates(getHostTemplates(), $quietMode); exit(0); } /* process the various lists into validation arrays */ $host_templates = getHostTemplates(); $hosts = getHostsByDescription(); $addresses = getAddresses(); /* process templates */ if (!isset($host_templates[$template_id])) { print "ERROR: Unknown template id ($template_id)\n"; exit(1); } /* process host description */ if (isset($hosts[$description])) { db_execute("UPDATE host SET hostname='$ip' WHERE deleted = '' AND id=" . $hosts[$description]); print "This host already exists in the database ($description) device-id: (" . $hosts[$description] . ")\n"; exit(1); } if ($description == '') { print "ERROR: You must supply a description for all hosts!\n"; exit(1); } if ($ip == '') { print "ERROR: You must supply an IP address for all hosts!\n"; exit(1); } if ($snmp_ver > 3 || $snmp_ver < 0 || !is_numeric($snmp_ver)) { print "ERROR: The snmp version must be between 0 and 3. If you did not specify one, goto Configuration > Settings > Device Defaults and resave your defaults.\n"; exit(1); } /* process ip */ if (isset($addresses[$ip])) { $id = $addresses[$ip]; $phost = db_fetch_row_prepared('SELECT * FROM host WHERE id = ?', array($id)); $fail = false; if ($phost['snmp_version'] < '3' && $snmp_ver < '3') { if ($snmp_ver == 0 && $proxy) { // proxy but for no snmp } elseif ($phost['snmp_community'] != $community || $phost['snmp_port'] != $snmp_port) { if ($proxy) { // assuming an snmp-proxy } else { print "ERROR: This IP ($id) already exists in the database and --proxy was not specified.\n"; exit(1); } } else { $fail = true; } } elseif ($phost['snmp_version'] != $snmp_ver) { // assuming a proxy } elseif ($phost['snmp_version'] == '3' && $snmp_ver == '3') { $changed = 0; $changed += ($phost['snmp_username'] != $username ? 1:0); $changed += ($phost['snmp_context'] != $snmp_context ? 1:0); $changed += ($phost['snmp_engine_id'] != $snmp_engine_id ? 1:0); $changed += ($phost['snmp_auth_protocol'] != $snmp_auth_protocol ? 1:0); $changed += ($phost['snmp_priv_protocol'] != $snmp_priv_protocol ? 1:0); if ($changed > 0) { if ($proxy) { // assuming a proxy } else { print "ERROR: This IP ($id) already exists in the database and --proxy was not specified.\n"; exit(1); } } else { $fail = true; } } else { $fail = true; } if ($fail) { db_execute("UPDATE host SET description = '$description' WHERE deleted = '' AND id = " . $addresses[$ip]); print "ERROR: This IP already exists in the database ($ip) device-id: (" . $addresses[$ip] . ")\n"; exit(1); } } if (!is_numeric($site_id) || $site_id < 0) { print "ERROR: You have specified an invalid site id!\n"; exit(1); } if (!is_numeric($poller_id) || $poller_id < 0) { print "ERROR: You have specified an invalid poller id!\n"; exit(1); } /* process snmp information */ if ($snmp_ver < 0 || $snmp_ver > 3) { print "ERROR: Invalid snmp version ($snmp_ver)\n"; exit(1); } elseif ($snmp_ver > 0) { if ($snmp_port <= 1 || $snmp_port > 65534) { print "ERROR: Invalid port. Valid values are from 1-65534\n"; exit(1); } if ($snmp_timeout <= 0 || $snmp_timeout > 20000) { print "ERROR: Invalid timeout. Valid values are from 1 to 20000\n"; exit(1); } } /* community/user/password verification */ if ($snmp_ver < 3) { /* snmp community can be blank */ } else { if ($snmp_username == "" || $snmp_password == "") { print "ERROR: When using snmpv3 you must supply an username and password\n"; exit(1); } } /* validate the disable state */ if ($disable != 1 && $disable != 0) { print "ERROR: Invalid disable flag ($disable)\n"; exit(1); } if ($disable == 0) { $disable = ""; } else { $disable = "on"; } print "Adding $description ($ip) as \"" . $host_templates[$template_id] . "\" using SNMP v$snmp_ver with community \"$community\"\n"; $host_id = api_device_save('0', $template_id, $description, $ip, $community, $snmp_ver, $snmp_username, $snmp_password, $snmp_port, $snmp_timeout, $disable, $avail, $ping_method, $ping_port, $ping_timeout, $ping_retries, $notes, $snmp_auth_protocol, $snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_engine_id, $max_oids, $device_threads, $poller_id, $site_id, $external_id, $location, $bulk_walk_size); if (is_error_message()) { print "ERROR: Failed to add this device\n"; exit(1); } else { print "Success - new device-id: ($host_id)\n"; exit(0); } } else { display_help(); exit(0); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Device Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_device.php --description=[description] --ip=[IP] --template=[ID] [--notes=\"[]\"] [--disable]\n"; print " [--poller=[id]] [--site=[id] [--external-id=[S]] [--proxy] [--threads=[1]\n"; print " [--avail=[ping]] --ping_method=[icmp] --ping_port=[N/A, 1-65534] --ping_timeout=[N] --ping_retries=[2]\n"; print " [--version=[0|1|2|3]] [--community=] [--port=161] [--timeout=500]\n"; print " [--username= --password=] [--authproto=] [--privpass= --privproto=] [--context=] [--engineid=]\n"; print " [--quiet]\n\n"; print "Required:\n"; print " --description the name that will be displayed by Cacti in the graphs\n"; print " --ip self explanatory (can also be a FQDN)\n\n"; print "Optional:\n"; print " --proxy if specified, allows adding a second host with same ip address\n"; print " --template 0, is a number (read below to get a list of templates)\n"; print " --location '', The physical location of the Device.\n"; print " --notes '', General information about this host. Must be enclosed using double quotes.\n"; print " --external-id '', An external ID to align Cacti devices with devices from other systems.\n"; print " --disable 0, 1 to add this host but to disable checks and 0 to enable it\n"; print " --poller 0, numeric poller id that will perform data collection for the device.\n"; print " --site 0, numeric site id that will be associated with the device.\n"; print " --threads 1, numeric number of threads to poll device with.\n"; print " --avail pingsnmp, [ping][none, snmp, pingsnmp, pingorsnmp]\n"; print " --ping_method tcp, icmp|tcp|udp\n"; print " --ping_port '', 1-65534\n"; print " --ping_retries 2, the number of time to attempt to communicate with a host\n"; print " --ping_timeout N, the ping timeout in milliseconds. Defaults to database setting.\n"; print " --version 1, 0|1|2|3, snmp version. 0 for no snmp\n"; print " --community '', snmp community string for snmpv1 and snmpv2. Leave blank for no community\n"; print " --port 161\n"; print " --timeout 500\n"; print " --username '', snmp username for snmpv3\n"; print " --password '', snmp password for snmpv3\n"; print " --authproto '', snmp authentication protocol for snmpv3\n"; print " --privpass '', snmp privacy passphrase for snmpv3\n"; print " --privproto '', snmp privacy protocol for snmpv3\n"; print " --context '', snmp context for snmpv3\n"; print " --engineid '', snmp engineid for snmpv3\n"; print " --max_oids 10, 1-60, the number of OIDs that can be obtained in a single SNMP Get request\n\n"; print " --bulk_walk -1, 1-60, the bulk walk chunk size that will be used for bulk walks. Use -1 for auto-tune.\n\n"; print "List Options:\n"; print " --list-host-templates\n"; print " --list-communities\n"; print " --quiet - batch mode value return\n\n"; } cacti-release-1.2.26/cli/add_graph_template.php000077500000000000000000000136211454067461500214110ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms)) { $displayHosts = false; $displayGraphTemplates = false; $quietMode = false; unset($host_id); unset($graph_template_id); foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '-d': $debug = true; break; case '--host-id': $host_id = trim($value); if (!is_numeric($host_id)) { print "ERROR: You must supply a valid host-id to run this script!\n"; exit(1); } break; case '--graph-template-id': $graph_template_id = $value; if (!is_numeric($graph_template_id)) { print "ERROR: You must supply a numeric graph-template-id for all hosts!\n"; exit(1); } break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); case '--list-hosts': $displayHosts = true; break; case '--list-graph-templates': $displayGraphTemplates = true; break; case '--quiet': $quietMode = true; break; default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } /* list options, recognizing $quiteMode */ if ($displayHosts) { $hosts = getHosts(); displayHosts($hosts, $quietMode); exit(0); } if ($displayGraphTemplates) { $graphTemplates = getGraphTemplates(); displayGraphTemplates($graphTemplates, $quietMode); exit(0); } /* * verify required parameters * for update / insert options */ if (!isset($host_id)) { print "ERROR: You must supply a valid host-id for all hosts!\n"; exit(1); } if (!isset($graph_template_id)) { print "ERROR: You must supply a valid data-query-id for all hosts!\n"; exit(1); } /* * verify valid host id and get a name for it */ $host_name = db_fetch_cell("SELECT hostname FROM host WHERE id = " . $host_id); if (!isset($host_name)) { print "ERROR: Unknown Host Id ($host_id)\n"; exit(1); } /* * verify valid graph template and get a name for it */ $graph_template_name = db_fetch_cell("SELECT name FROM graph_templates WHERE id = " . $graph_template_id); if (!isset($graph_template_name)) { print "ERROR: Unknown Graph Template Id ($graph_template_id)\n"; exit(1); } /* check, if graph template was already associated */ $exists_already = db_fetch_cell("SELECT host_id FROM host_graph WHERE graph_template_id=$graph_template_id AND host_id=$host_id"); if ((isset($exists_already)) && ($exists_already > 0)) { print "ERROR: Graph Template is already associated for host: ($host_id: $host_name) - graph-template: ($graph_template_id: $graph_template_name)\n"; exit(1); } else { db_execute("replace into host_graph (host_id,graph_template_id) values (" . $host_id . "," . $graph_template_id . ")"); automation_hook_graph_template($host_id, $graph_template_id); api_plugin_hook_function('add_graph_template_to_host', array("host_id" => $host_id, "graph_template_id" => $graph_template_id)); } if (is_error_message()) { print "ERROR: Failed to add this graph template for host: ($host_id: $host_name) - graph-template: ($graph_template_id: $graph_template_name)\n"; exit(1); } else { print "Success: Graph Template associated for host: ($host_id: $host_name) - graph-template: ($graph_template_id: $graph_template_name)\n"; exit(0); } } else { display_help(); exit(0); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Graph Template Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_graph_template.php --host-id=[ID] --graph-template-id=[ID]\n"; print " [--quiet]\n\n"; print "Required:\n"; print " --host-id the numerical ID of the host\n"; print " --graph-template-id the numerical ID of the graph template to be added\n\n"; print "List Options:\n"; print " --list-hosts\n"; print " --list-graph-templates\n"; print " --quiet - batch mode value return\n\n"; } cacti-release-1.2.26/cli/add_graphs.php000077500000000000000000000566441454067461500177150ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms)) { /* setup defaults */ $graph_type = ''; $templateGraph = array(); $dsGraph = array(); $dsGraph['snmpFieldSpec'] = ''; $dsGraph['snmpQueryId'] = ''; $dsGraph['snmpQueryType'] = ''; $dsGraph['snmpField'] = array(); $dsGraph['snmpValue'] = array(); $dsGraph['snmpValueRegex'] = array(); $dsGraph['reindex_method'] = DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME; $input_fields = array(); $values['cg'] = array(); $hosts = getHosts(); $graphTemplates = getGraphTemplates(); $graphTitle = ''; $cgInputFields = ''; $host_id = 0; $template_id = 0; $hostTemplateId = 0; $force = 0; $listHosts = false; $listGraphTemplates = false; $listSNMPFields = false; $listSNMPValues = false; $listQueryTypes = false; $listSNMPQueries = false; $listInputFields = false; $quietMode = false; $shortopts = 'VvHh'; $longopts = array( 'host-id::', 'graph-type::', 'graph-template-id::', 'graph-title::', 'host-template-id::', 'input-fields::', 'snmp-query-id::', 'snmp-query-type-id::', 'snmp-field::', 'snmp-value::', 'snmp-value-regex::', 'reindex-method::', 'list-hosts', 'list-snmp-fields', 'list-snmp-values', 'list-query-types', 'list-snmp-queries', 'force', 'quiet', 'list-input-fields', 'list-graph-templates', 'version', 'help' ); $options = getopt($shortopts, $longopts); foreach($options as $arg => $value) { $allow_multi = false; switch($arg) { case 'graph-type': $graph_type = $value; break; case 'graph-title': $graphTitle = $value; break; case 'graph-template-id': $template_id = $value; break; case 'host-template-id': $hostTemplateId = $value; break; case 'host-id': $host_id = $value; break; case 'input-fields': $cgInputFields = $value; break; case 'snmp-query-id': $dsGraph['snmpQueryId'] = $value; break; case 'snmp-query-type-id': $dsGraph['snmpQueryType'] = $value; break; case 'snmp-field': if (!is_array($value)) { $value = array($value); } $dsGraph['snmpField'] = $value; $allow_multi = true; break; case 'snmp-value-regex': if (!is_array($value)) { $value = array($value); } foreach($value as $item) { if (!validate_is_regex($item)) { print "ERROR: Regex specified '$item', is not a valid Regex!\n"; exit(1); } } $dsGraph['snmpValueRegex'] = $value; $allow_multi = true; break; case 'snmp-value': if (!is_array($value)) { $value = array($value); } $dsGraph['snmpValue'] = $value; $allow_multi = true; break; case 'reindex-method': if (is_numeric($value) && ($value >= DATA_QUERY_AUTOINDEX_NONE) && ($value <= DATA_QUERY_AUTOINDEX_FIELD_VERIFICATION)) { $dsGraph['reindex_method'] = $value; } else { switch (strtolower($value)) { case 'none': $dsGraph['reindex_method'] = DATA_QUERY_AUTOINDEX_NONE; break; case 'uptime': $dsGraph['reindex_method'] = DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME; break; case 'index': $dsGraph['reindex_method'] = DATA_QUERY_AUTOINDEX_INDEX_NUM_CHANGE; break; case 'fields': $dsGraph['reindex_method'] = DATA_QUERY_AUTOINDEX_FIELD_VERIFICATION; break; default: print "ERROR: You must supply a valid reindex method for this graph!\n"; exit(1); } } break; case 'list-hosts': $listHosts = true; break; case 'list-snmp-fields': $listSNMPFields = true; break; case 'list-snmp-values': $listSNMPValues = true; break; case 'list-query-types': $listQueryTypes = true; break; case 'list-snmp-queries': $listSNMPQueries = true; break; case 'force': $force = true; break; case 'quiet': $quietMode = true; break; case 'list-input-fields': $listInputFields = true; break; case 'list-graph-templates': $listGraphTemplates = true; break; case 'version': case 'V': case 'v': display_version(); exit(0); case 'help': case 'H': case 'h': display_help(); exit(0); default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } if (!$allow_multi && isset($value) && is_array($value)) { print "ERROR: Multiple values specified for non-multi argument: ($arg)\n\n"; exit(1); } } if ($listGraphTemplates) { /* is a Host Template Id is given, print the related Graph Templates */ if ($hostTemplateId > 0) { $graphTemplates = getGraphTemplatesByHostTemplate($hostTemplateId); if (!cacti_sizeof($graphTemplates)) { print "ERROR: You must supply a valid --host-template-id before you can list its graph templates\n"; print "Try --list-graph-template-id --host-template-id=[ID]\n"; exit(1); } } displayGraphTemplates($graphTemplates, $quietMode); exit(0); } if ($listInputFields) { if ($template_id > 0) { $input_fields = getInputFields($template_id, $quietMode); displayInputFields($input_fields, $quietMode); } else { print "ERROR: You must supply an graph-template-id before you can list its input fields\n"; print "Try --graph-template-id=[ID] --list-input-fields\n"; exit(1); } exit(0); } if ($listHosts) { displayHosts($hosts, $quietMode); exit(0); } /* get the existing snmp queries */ $snmpQueries = getSNMPQueries(); if ($listSNMPQueries) { displaySNMPQueries($snmpQueries, $quietMode); exit(0); } /* Some sanity checking... */ if ($dsGraph['snmpQueryId'] != '') { if (!isset($snmpQueries[$dsGraph['snmpQueryId']])) { print 'ERROR: Unknown snmp-query-id (' . $dsGraph['snmpQueryId'] . ")\n"; print "Try --list-snmp-queries\n"; exit(1); } /* get the snmp query types for comparison */ $snmp_query_types = getSNMPQueryTypes($dsGraph['snmpQueryId']); if ($listQueryTypes) { displayQueryTypes($snmp_query_types, $quietMode); exit(0); } if ($dsGraph['snmpQueryType'] != '') { if (!isset($snmp_query_types[$dsGraph['snmpQueryType']])) { print 'ERROR: Unknown snmp-query-type-id (' . $dsGraph['snmpQueryType'] . ")\n"; print 'Try --snmp-query-id=' . $dsGraph['snmpQueryId'] . " --list-query-types\n"; exit(1); } } if (!($listHosts || # you really want to create a new graph $listSNMPFields || # add this check to avoid reindexing on any list option $listSNMPValues || $listQueryTypes || $listSNMPQueries || $listInputFields)) { /* if data query is not yet associated, * add it and run it once to get the cache filled */ /* is this data query already associated (independent of the reindex method)? */ $exists_already = db_fetch_cell_prepared('SELECT COUNT(host_id) FROM host_snmp_query WHERE host_id = ? AND snmp_query_id = ?', array($host_id, $dsGraph['snmpQueryId'])); if ((isset($exists_already)) && ($exists_already > 0)) { /* yes: do nothing, everything's fine */ } else { db_execute_prepared('REPLACE INTO host_snmp_query (host_id, snmp_query_id, reindex_method) VALUES (?, ?, ?)', array($host_id, $dsGraph['snmpQueryId'], $dsGraph['reindex_method'])); /* recache snmp data, this is time consuming, * but should happen only once even if multiple graphs * are added for the same data query * because we checked above, if dq was already associated */ run_data_query($host_id, $dsGraph['snmpQueryId']); } } } /* Verify the host's existence */ if (!isset($hosts[$host_id]) || $host_id == 0) { print "ERROR: Unknown Host ID ($host_id)\n"; print "Try --list-hosts\n"; exit(1); } /* process the snmp fields */ if ($graph_type == 'dq' || $listSNMPFields || $listSNMPValues) { $snmpFields = getSNMPFields($host_id, $dsGraph['snmpQueryId']); if ($listSNMPFields) { displaySNMPFields($snmpFields, $host_id, $quietMode); exit(0); } $snmpValues = array(); /* More sanity checking */ /* Testing SnmpValues and snmpFields args */ if ($dsGraph['snmpValue'] and $dsGraph['snmpValueRegex'] ) { print "ERROR: You can't supply --snmp-value and --snmp-value-regex at the same time\n"; exit(1); } $nbSnmpFields = cacti_sizeof($dsGraph['snmpField']); $nbSnmpValues = cacti_sizeof($dsGraph['snmpValue']); $nbSnmpValuesRegex = cacti_sizeof($dsGraph['snmpValueRegex']); if ($nbSnmpValues) { if ($nbSnmpFields != $nbSnmpValues) { print "ERROR: number of --snmp-field and --snmp-value does not match\n"; exit(1); } } elseif ($nbSnmpValuesRegex) { if ($nbSnmpFields != $nbSnmpValuesRegex) { print "ERROR: number of --snmp-field ($nbSnmpFields) and --snmp-value-regex ($nbSnmpValuesRegex) does not match\n"; exit(1); } } elseif (!$listSNMPValues) { print "ERROR: You must supply a --snmp-value or --snmp-value-regex option with --snmp-field\n"; exit(1); } $index_filter = 0; foreach($dsGraph['snmpField'] as $snmpField) { if ($snmpField != '') { if (!isset($snmpFields[$snmpField] )) { print 'ERROR: Unknown snmp-field ' . $dsGraph['snmpField'] . " for host $host_id\n"; print "Try --list-snmp-fields\n"; exit(1); } } $snmpValues = getSNMPValues($host_id, $snmpField, $dsGraph['snmpQueryId']); $snmpValue = ''; $snmpValueRegex = ''; if ($dsGraph['snmpValue']) { $snmpValue = $dsGraph['snmpValue'][$index_filter]; } else { $snmpValueRegex = $dsGraph['snmpValueRegex'][$index_filter]; } if ($snmpValue) { $ok = false; foreach ($snmpValues as $snmpValueKnown => $snmpValueSet) { if ($snmpValue == $snmpValueKnown) { $ok = true; break; } } if (!$ok) { print "ERROR: Unknown snmp-value for field $snmpField - $snmpValue\n"; print "Try --snmp-field=$snmpField --list-snmp-values\n"; exit(1); } } elseif ($snmpValueRegex) { $ok = false; foreach ($snmpValues as $snmpValueKnown => $snmpValueSet) { if (preg_match("/$snmpValueRegex/i", $snmpValueKnown)) { $ok = true; break; } } if (!$ok) { print "ERROR: Unknown snmp-value for field $snmpField - $snmpValue\n"; print "Try --snmp-field=$snmpField --list-snmp-values\n"; exit(1); } } $index_filter++; } if ($listSNMPValues) { if (!$dsGraph['snmpField']) { print "ERROR: You must supply an snmp-field before you can list its values\n"; print "Try --list-snmp-fields\n"; exit(1); } if (cacti_sizeof($dsGraph['snmpField'])) { foreach($dsGraph['snmpField'] as $snmpField) { if ($snmpField = "") { print "ERROR: You must supply a valid snmp-field before you can list its values\n"; print "Try --list-snmp-fields\n"; exit(1); } displaySNMPValues($snmpValues, $host_id, $snmpField, $quietMode); } } exit(0); } } if (!isset($graphTemplates[$template_id])) { print 'ERROR: Unknown graph-template-id (' . $template_id . ")\n"; print "Try --list-graph-templates\n"; exit(1); } if ((!isset($template_id)) || (!isset($host_id))) { print "ERROR: Must have at least a host-id and a graph-template-id\n\n"; display_help(); exit(1); } if ($cgInputFields != '') { $fields = explode(' ', $cgInputFields); if ($template_id > 0) { $input_fields = getInputFields($template_id, $quietMode); } if (cacti_sizeof($fields)) { foreach ($fields as $option) { $data_template_id = 0; $option_value = explode('=', $option); if (substr_count($option_value[0], ':')) { $compound = explode(':', $option_value[0]); $data_template_id = $compound[0]; $field_name = $compound[1]; } else { $field_name = $option_value[0]; } /* check for the input fields existence */ $field_found = false; if (cacti_sizeof($input_fields)) { foreach ($input_fields as $key => $row) { if (substr_count($key, $field_name)) { if ($data_template_id == 0) { $data_template_id = $row['data_template_id']; } $field_found = true; break; } } } if (!$field_found) { print 'ERROR: Unknown input-field (' . $field_name . ")\n"; print "Try --list-input-fields\n"; exit(1); } $value = $option_value[1]; $values['cg'][$template_id]['custom_data'][$data_template_id][$input_fields[$data_template_id . ':' . $field_name]['data_input_field_id']] = $value; } } } $returnArray = array(); if ($graph_type == 'cg') { $existsAlready = db_fetch_cell_prepared('SELECT gl.id FROM graph_local AS gl INNER JOIN graph_templates AS gt ON gt.id = gl.graph_template_id WHERE graph_template_id = ? AND host_id = ? AND multiple = \'\'', array($template_id, $host_id)); if ((isset($existsAlready)) && ($existsAlready > 0) && (!$force)) { $dataSourceId = db_fetch_cell_prepared('SELECT dtr.local_data_id FROM graph_templates_item AS gti INNER JOIN data_template_rrd AS dtr ON gti.task_item_id = dtr.id WHERE gti.local_graph_id = ? LIMIT 1', array($existsAlready)); print "NOTE: Not Adding Graph - this graph already exists - graph-id: ($existsAlready) - data-source-id: ($dataSourceId)\n"; exit(1); } else { $returnArray = create_complete_graph_from_template($template_id, $host_id, null, $values['cg']); $dataSourceId = ''; } if ($graphTitle != '') { if (isset($returnArray['local_graph_id'])) { db_execute_prepared('UPDATE graph_templates_graph SET title = ? WHERE local_graph_id = ?', array($graphTitle, $returnArray['local_graph_id'])); update_graph_title_cache($returnArray['local_graph_id']); } } if (is_array($returnArray) && cacti_sizeof($returnArray)) { if (cacti_sizeof($returnArray['local_data_id'])) { foreach($returnArray['local_data_id'] as $item) { push_out_host($host_id, $item); if ($dataSourceId != '') { $dataSourceId .= ', ' . $item; } else { $dataSourceId = $item; } } } /* add this graph template to the list of associated graph templates for this host */ db_execute_prepared('REPLACE INTO host_graph (host_id, graph_template_id) VALUES (?, ?)', array($host_id , $template_id)); print 'Graph Added - Graph[' . $returnArray['local_graph_id'] . "] - DS[$dataSourceId]\n"; } else { print "Graph Not Added due to whitelist check failure.\n"; } } elseif ($graph_type == 'ds') { if (($dsGraph['snmpQueryId'] == '') || ($dsGraph['snmpQueryType'] == '') || (cacti_sizeof($dsGraph['snmpField']) == 0) ) { print "ERROR: For graph-type of 'ds' you must supply more options\n"; display_help(); exit(1); } $snmp_query_array = array(); $snmp_query_array['snmp_query_id'] = $dsGraph['snmpQueryId']; $snmp_query_array['snmp_index_on'] = get_best_data_query_index_type($host_id, $dsGraph['snmpQueryId']); $snmp_query_array['snmp_query_graph_id'] = $dsGraph['snmpQueryType']; $req = 'SELECT distinct snmp_index FROM host_snmp_cache WHERE host_id=' . $host_id . ' AND snmp_query_id=' . $dsGraph['snmpQueryId']; $index_snmp_filter = 0; if (cacti_sizeof($dsGraph['snmpField'])) { foreach ($dsGraph['snmpField'] as $snmpField) { $req .= ' AND snmp_index IN ( SELECT DISTINCT snmp_index FROM host_snmp_cache WHERE host_id=' . $host_id . ' AND field_name = ' . db_qstr($snmpField); if (isset($dsGraph['snmpValue'][$index_snmp_filter])) { $req .= ' AND field_value = ' . db_qstr($dsGraph['snmpValue'][$index_snmp_filter]). ')'; } elseif (isset($dsGraph['snmpValueRegex'][$index_snmp_filter])) { $req .= ' AND field_value REGEXP "' . addslashes($dsGraph['snmpValueRegex'][$index_snmp_filter]) . '")'; } $index_snmp_filter++; } } $snmp_indexes = db_fetch_assoc($req); if (cacti_sizeof($snmp_indexes)) { foreach ($snmp_indexes as $snmp_index) { $snmp_query_array['snmp_index'] = $snmp_index['snmp_index']; $existsAlready = db_fetch_cell_prepared('SELECT gl.id FROM graph_local AS gl INNER JOIN graph_templates AS gt ON gt.id = gl.graph_template_id WHERE graph_template_id = ? AND host_id = ? AND snmp_query_id = ? AND snmp_index = ? AND multiple = \'\'', array($template_id, $host_id, $dsGraph['snmpQueryId'], $snmp_query_array['snmp_index'])); if (isset($existsAlready) && $existsAlready > 0) { if ($graphTitle != '') { db_execute_prepared('UPDATE graph_templates_graph SET title = ? WHERE local_graph_id = ?', array($graphTitle, $existsAlready)); update_graph_title_cache($existsAlready); } $dataSourceId = db_fetch_cell_prepared('SELECT dtr.local_data_id FROM graph_templates_item AS gti INNER JOIN data_template_rrd AS dtr ON gti.task_item_id = dtr.id WHERE gti.local_graph_id = ? LIMIT 1', array($existsAlready)); print "NOTE: Not Adding Graph - this graph already exists - graph-id: ($existsAlready) - data-source-id: ($dataSourceId)\n"; continue; } $isempty = array(); /* Suggested Values are not been implemented */ $returnArray = create_complete_graph_from_template($template_id, $host_id, $snmp_query_array, $isempty); if ($returnArray !== false) { if ($graphTitle != '') { db_execute_prepared('UPDATE graph_templates_graph SET title = ? WHERE local_graph_id = ?', array($graphTitle, $returnArray['local_graph_id'])); update_graph_title_cache($returnArray['local_graph_id']); } $dataSourceId = db_fetch_cell_prepared('SELECT dtr.local_data_id FROM graph_templates_item AS gti INNER JOIN data_template_rrd AS dtr ON gti.task_item_id = dtr.id WHERE gti.local_graph_id = ? LIMIT 1', array($returnArray['local_graph_id'])); foreach($returnArray['local_data_id'] as $item) { push_out_host($host_id, $item); if ($dataSourceId != '') { $dataSourceId .= ', ' . $item; } else { $dataSourceId = $item; } } print 'Graph Added - Graph[' . $returnArray['local_graph_id'] . "] - DS[$dataSourceId]\n"; } else { print "Graph Not Added due to whitelist check failure.\n"; } } } else { $err_msg = 'ERROR: Could not find one of more snmp-fields ' . implode(',', $dsGraph['snmpField']) . ' with values ('; if (cacti_sizeof($dsGraph['snmpValue'])) { $err_msg .= implode(',',$dsGraph['snmpValue']); } else { $err_msg .= implode(',',$dsGraph['snmpValueRegex']); } $err_msg .= ') for host-id ' . $host_id . ' (' . $hosts[$host_id]['hostname'] . ")\n"; print $err_msg; print 'Try --host-id=' . $host_id . " --list-snmp-fields\n"; exit(1); } } else { print "ERROR: Graph Types must be either 'cg' or 'ds'\n"; exit(1); } exit(0); } else { display_help(); exit(1); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Graphs Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_graphs.php --graph-type=[cg|ds] --graph-template-id=[ID]\n"; print " --host-id=[ID] [--graph-title=title] [graph options] [--force] [--quiet]\n\n"; print "Cacti utility for creating graphs via a command line interface. This utility can\n"; print "create both Data Query (ds) type Graphs as well as Graph Template (cg) type graphs.\n\n"; print "For Non Data Query (cg) Graphs:\n"; print " [--input-fields=\"[data-template-id:]field-name=value ...\"] [--force]\n\n"; print " --input-fields If your data template allows for custom input data, you may specify that\n"; print " here. The data template id is optional and applies where two input fields\n"; print " have the same name.\n"; print " --force If you set this flag, then new cg graphs will be created, even though they\n"; print " may already exist\n\n"; print "For Data Query (ds) Graphs:\n"; print " --snmp-query-id=[ID] --snmp-query-type-id=[ID] --snmp-field=[SNMP Field] \n"; print " --snmp-value=[SNMP Value] | --snmp-value-regex=[REGEX]\n"; print " [--graph-title=S] Defaults to what ever is in the Graph Template/Data Template.\n"; print " [--reindex-method=N] The reindex method to be used for that data query.\n"; print " NOTE: If Data Query is already associated, the reindex method will NOT be changed.\n\n"; print " Valid --reindex-methods include\n"; print " 0|None = No reindexing\n"; print " 1|Uptime = Uptime goes Backwards (Default)\n"; print " 2|Index = Index Count Changed\n"; print " 3|Fields = Verify all Fields\n\n"; print " NOTE: You may supply multiples of the --snmp-field and --snmp-value | --snmp-value-regex arguments.\n\n"; print "List Options:\n"; print " --list-hosts\n"; print " --list-graph-templates [--host-template-id=[ID]]\n"; print " --list-input-fields --graph-template-id=[ID]\n"; print " --list-snmp-queries\n"; print " --list-query-types --snmp-query-id [ID]\n"; print " --list-snmp-fields --host-id=[ID] [--snmp-query-id=[ID]]\n"; print " --list-snmp-values --host-id=[ID] [--snmp-query-id=[ID]] --snmp-field=[Field]\n\n"; } cacti-release-1.2.26/cli/add_perms.php000077500000000000000000000156301454067461500175450ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms) == 0) { display_help(); exit(1); } else { $userId = 0; /* TODO replace magic numbers by global constants, treat user_admin as well */ $itemTypes = array('graph' => 1, 'tree' => 2, 'host' => 3, 'graph_template' => 4); $itemType = 0; $itemId = 0; $hostId = 0; $quietMode = false; $displayGroups = false; $displayUsers = false; $displayTrees = false; $displayHosts = false; $displayGraphs = false; $displayGraphTemplates = false; foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '--user-id': $userId = $value; break; case '--item-type': /* TODO replace magic numbers by global constants, treat user_admin as well */ if ( ($value == 'graph') || ($value == 'tree') || ($value == 'host') || ($value == 'graph_template')) { $itemType = $itemTypes[$value]; } else { print "ERROR: Invalid Item Type: ($value)\n\n"; display_help(); exit(1); } break; case '--item-id': $itemId = $value; break; case '--host-id': $hostId = $value; break; case '--list-groups': $displayGroups = true; break; case '--list-users': $displayUsers = true; break; case '--list-trees': $displayTrees = true; break; case '--list-hosts': $displayHosts = true; break; case '--list-graphs': $displayGraphs = true; break; case '--list-graph-templates': $displayGraphTemplates = true; break; case '--quiet': $quietMode = true; break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } if ($displayGroups) { displayGroups($quietMode); exit(1); } if ($displayUsers) { displayUsers($quietMode); exit(1); } if ($displayTrees) { displayTrees($quietMode); exit(1); } if ($displayHosts) { $hosts = getHosts(); displayHosts($hosts, $quietMode); exit(1); } if ($displayGraphs) { if (!isset($hostId) || ($hostId === 0) || (!db_fetch_cell("SELECT id FROM host WHERE id=$hostId"))) { print "ERROR: You must supply a valid host_id before you can list its graphs\n"; print "Try --list-hosts\n"; display_help(); exit(1); } else { displayHostGraphs($hostId, $quietMode); exit(1); } } if ($displayGraphTemplates) { $graphTemplates = getGraphTemplates(); displayGraphTemplates($graphTemplates, $quietMode); exit(1); } /* verify, that a valid userid is provided */ $userIds = array(); if (isset($userId) && $userId > 0) { /* verify existing user id */ if ( db_fetch_cell("SELECT id FROM user_auth WHERE id=$userId") ) { array_push($userIds, $userId); } else { print "ERROR: Invalid Userid: ($value)\n\n"; display_help(); exit(1); } } /* now, we should have at least one verified userid */ /* verify --item-id */ if ($itemType == 0) { print "ERROR: --item-type missing. Please specify.\n\n"; display_help(); exit(1); } if ($itemId == 0) { print "ERROR: --item-id missing. Please specify.\n\n"; display_help(); exit(1); } /* TODO replace magic numbers by global constants, treat user_admin as well */ switch ($itemType) { case 1: /* graph */ if (!db_fetch_cell("SELECT local_graph_id FROM graph_templates_graph WHERE local_graph_id=$itemId") ) { print "ERROR: Invalid Graph item id: ($itemId)\n\n"; display_help(); exit(1); } break; case 2: /* tree */ if (!db_fetch_cell("SELECT id FROM graph_tree WHERE id=$itemId") ) { print "ERROR: Invalid Tree item id: ($itemId)\n\n"; display_help(); exit(1); } break; case 3: /* host */ if (!db_fetch_cell("SELECT id FROM host WHERE id=$itemId") ) { print "ERROR: Invalid Host item id: ($itemId)\n\n"; display_help(); exit(1); } break; case 4: /* graph_template */ if (!db_fetch_cell("SELECT id FROM graph_templates WHERE id=$itemId") ) { print "ERROR: Invalid Graph Template item id: ($itemId)\n\n"; display_help(); exit(1); } break; } /* verified item-id */ foreach ($userIds as $id) { db_execute("REPLACE INTO user_auth_perms (user_id, item_id, type) VALUES ($id, $itemId, $itemType)"); } } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Permissions Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_perms.php [ --user-id=[ID] ]\n"; print " --item-type=[graph|tree|host|graph_template]\n"; print " --item-id [--quiet]\n\n"; print "Where item-id is the id of the object of type item-type\n\n"; print "List Options:\n"; print " --list-users\n"; print " --list-trees\n"; print " --list-graph-templates\n"; print " --list-graphs --host-id=[ID]\n"; } function displayGroups() { /** * Todo implement */ print 'This option has not yet been implemented'; } cacti-release-1.2.26/cli/add_tree.php000077500000000000000000000232761454067461500173630ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); if (cacti_sizeof($parms)) { /* setup defaults */ $type = ''; # tree or node $name = ''; # Name of a tree or node $sortMethod = 'alpha'; # manual, alpha, natural, numeric $parentNode = 0; # When creating a node, the parent node of this node (or zero for root-node) $treeId = 0; # When creating a node, it has to go in a tree $nodeType = ''; # Should be 'header', 'graph' or 'host' when creating a node $graphId = 0; # The ID of the graph to add (gets added to parentNode) $siteId = 0; # The ID of the site to add $sortMethods = array('manual' => 1, 'alpha' => 2, 'natural' => 4, 'numeric' => 3); $nodeTypes = array('header' => 1, 'graph' => 2, 'host' => 3); $hostId = 0; $hostGroupStyle = 1; # 1 = Graph Template, 2 = Data Query Index $quietMode = false; $displayHosts = false; $displayTrees = false; $displayNodes = false; $displayRRAs = false; $displayGraphs = false; $displaySites = false; $hosts = getHosts(); $sites = getSites(); foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '--type': $type = trim($value); break; case '--name': $name = trim($value); break; case '--sort-method': $sortMethod = trim($value); break; case '--parent-node': $parentNode = $value; break; case '--tree-id': $treeId = $value; break; case '--node-type': $nodeType = trim($value); break; case '--graph-id': $graphId = $value; break; case '--host-id': $hostId = $value; break; case '--quiet': $quietMode = true; break; case '--list-hosts': $displayHosts = true; break; case '--list-trees': $displayTrees = true; break; case '--list-nodes': $displayNodes = true; break; case '--list-graphs': $displayGraphs = true; break; case '--list-sites': $displaySites = true; break; case '--host-group-style': $hostGroupStyle = trim($value); break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } if ($displaySites) { displaySites($sites, $quietMode); exit(0); } if ($displayHosts) { displayHosts($hosts, $quietMode); exit(0); } if ($displayTrees) { displayTrees($quietMode); exit(0); } if ($displayNodes) { if (!isset($treeId)) { print "ERROR: You must supply a tree_id before you can list its nodes\n"; print "Try --list-trees\n"; exit(1); } displayTreeNodes($treeId, $nodeType, $parentNode, $quietMode); exit(0); } if ($displayRRAs) { displayRRAs($quietMode); exit(0); } if ($displayGraphs) { if (!isset($hostId) || $hostId == 0) { print "ERROR: You must supply a host_id before you can list its graphs\n"; print "Try --list-hosts\n"; exit(1); } displayHostGraphs($hostId, $quietMode); exit(0); } if ($type == 'tree') { # Add a new tree if (empty($name)) { print "ERROR: You must supply a name with --name\n"; display_help(); exit(1); } $treeOpts = array(); $treeOpts['id'] = 0; # Zero means create a new one rather than save over an existing one $treeOpts['name'] = $name; if ($sortMethod == 'manual'|| $sortMethod == 'alpha' || $sortMethod == 'numeric' || $sortMethod == 'natural') { $treeOpts['sort_type'] = $sortMethods[$sortMethod]; } else { print "ERROR: Invalid sort-method: ($sortMethod)\n"; display_help(); exit(1); } $existsAlready = db_fetch_cell("SELECT id FROM graph_tree WHERE name = '$name'"); if ($existsAlready) { print "ERROR: Not adding tree - it already exists - tree-id: ($existsAlready)\n"; exit(1); } $treeId = sql_save($treeOpts, 'graph_tree'); api_tree_sort_branch(0, $treeId); print "Tree Created - tree-id: ($treeId)\n"; exit(0); } elseif ($type == 'node') { # Add a new node to a tree if ($nodeType == 'header'|| $nodeType == 'graph' || $nodeType == 'site' || $nodeType == 'host') { $itemType = $nodeTypes[$nodeType]; } else { print "ERROR: Invalid node-type: ($nodeType)\n"; display_help(); exit(1); } if (!is_numeric($parentNode)) { print "ERROR: parent-node $parentNode must be numeric > 0\n"; display_help(); exit(1); } elseif ($parentNode > 0 ) { $parentNodeExists = db_fetch_cell("SELECT id FROM graph_tree_items WHERE graph_tree_id=$treeId AND id=$parentNode"); if (!isset($parentNodeExists)) { print "ERROR: parent-node $parentNode does not exist\n"; exit(1); } } if ($nodeType == 'header') { # Header --name must be given if (empty($name)) { print "ERROR: You must supply a name with --name\n"; display_help(); exit(1); } # Blank out the graphId, hostID and host_grouping_style fields $graphId = 0; $hostId = 0; $siteId = 0; $hostGroupStyle = 1; }else if($nodeType == 'graph') { # Blank out name, hostID, host_grouping_style $name = ''; $hostId = 0; $siteId = 0; $hostGroupStyle = 1; $graphs = db_fetch_assoc('SELECT id FROM graph_local WHERE graph_local.id=' . $graphId); if (!cacti_sizeof($graphs)) { print "ERROR: No such graph-id ($graphId) exists. Try --list-graphs\n"; exit(1); } }else if ($nodeType == 'site') { # Blank out graphId, name fields $graphId = 0; $hostId = 0; $name = ''; if (!isset($sites[$siteId])) { print "ERROR: No such site-id ($siteId) exists. Try --list-sites\n"; exit(1); } }else if ($nodeType == 'host') { # Blank out graphId, name fields $graphId = 0; $siteId = 0; $name = ''; if (!isset($hosts[$hostId])) { print "ERROR: No such host-id ($hostId) exists. Try --list-hosts\n"; exit(1); } if ($hostGroupStyle != 1 && $hostGroupStyle != 2) { print "ERROR: Host Group Style must be 1 or 2 (Graph Template or Data Query Index)\n"; display_help(); exit(1); } } # $nodeId could be a Header Node, a Graph Node, or a Host node. $nodeId = api_tree_item_save(0, $treeId, $itemType, $parentNode, $name, $graphId, $hostId, $siteId, $hostGroupStyle, $sortMethods[$sortMethod], false); print "Added Node node-id: ($nodeId)\n"; exit(0); } else { print "ERROR: Unknown type: ($type)\n"; display_help(); exit(1); } } else { display_help(); exit(0); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Add Tree Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: add_tree.php --type=[tree|node] [type-options] [--quiet]\n\n"; print "Tree options:\n"; print " --name=[Tree Name]\n"; print " --sort-method=[manual|alpha|natural|numeric]\n\n"; print "Node options:\n"; print " --node-type=[header|site|host|graph]\n"; print " --tree-id=[ID]\n"; print " [--parent-node=[ID] [Node Type Options]]\n\n"; print "Header node options:\n"; print " --name=[Name]\n\n"; print "Site node options:\n"; print " --site-id=[ID]\n"; print "Host node options:\n"; print " --host-id=[ID]\n"; print " [--host-group-style=[1|2]]\n"; print " (host group styles:\n"; print " 1 = Graph Template,\n"; print " 2 = Data Query Index)\n\n"; print "Graph node options:\n"; print " --graph-id=[ID]\n\n"; print "List Options:\n"; print " --list-sites\n"; print " --list-hosts\n"; print " --list-trees\n"; print " --list-nodes --tree-id=[ID]\n"; print " --list-graphs --host-id=[ID]\n"; } cacti-release-1.2.26/cli/analyze_database.php000077500000000000000000000101271454067461500210720ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); print "NOTE: Repairing Tables for Main Database" . PHP_EOL; } else { print "NOTE: Repairing Tables for Local Database" . PHP_EOL; } $tables = db_fetch_assoc('SHOW TABLES FROM `' . $database_default . '`'); if (cacti_sizeof($tables)) { foreach($tables AS $table) { if (db_binlog_enabled()) { print "NOTE: Analyzing Table -> '" . $table['Tables_in_' . $database_default] . "' without writing to the binlog"; $status = db_execute('ANALYZE TABLE NO_WRITE_TO_BINLOG ' . $table['Tables_in_' . $database_default] . $form); } else { print "NOTE: Analyzing Table -> '" . $table['Tables_in_' . $database_default] . "'"; $status = db_execute('ANALYZE TABLE ' . $table['Tables_in_' . $database_default] . $form); } print ($status == 0 ? ' Failed' : ' Successful') . "\n"; } cacti_log('ANALYSIS STATS: Analyzing Cacti Tables Complete. Total time ' . (time() - $start) . ' seconds.', false, 'SYSTEM'); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Analyze Database Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } /* display_help - displays the usage of the function */ function display_help () { display_version(); print "\nusage: analyze_database.php [-d|--debug]\n\n"; print "A utility to recalculate the cardinality of indexes within the Cacti database.\n"; print "It's important to periodically run this utility especially on larger systems.\n\n"; print "Optional:\n"; print " --local - Perform the action on the Remote Data Collector if run from there\n"; print "-d | --debug - Display verbose output during execution\n\n"; } cacti-release-1.2.26/cli/apply_automation_rules.php000077500000000000000000000145711454067461500224110ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); global $debug; $debug = false; $hostname = ''; $description = ''; $ids = array(); if (cacti_sizeof($parms)) { foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '-d': case '--debug': $debug = true; break; case '--hostname': $hostname = $value; break; case '--description': $description = $value; break; case '--ids': $ids = explode(' ', $value); break; case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); default: print "ERROR: Invalid Parameter " . $parameter . PHP_EOL . PHP_EOL; display_help(); exit(1); } } } // Check for matching like/regex if (!cacti_sizeof($ids) && $hostname == '' && $description == '') { print 'FATAL: You must specify either ids, a hostname or host description pattern' . PHP_EOL; exit(1); } $sql_where = ''; // Check device id range if (cacti_sizeof($ids)) { foreach($ids as $id) { if (!is_numeric($id) || $id <= 0) { print 'FATAL: Device id ' . $id . ' is not a valid device. Can not continue.' . PHP_EOL; exit(1); } } $sql_where = 'WHERE h.id IN (' . implode(',', $ids) . ')'; } // Check hostname if ($hostname != '') { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . '('; $regex = false; if (validate_is_regex($hostname)) { $regex = true; $sql_where .= 'h.hostname RLIKE ' . db_qstr($hostname); } $hostname = '%' . $hostname . '%'; $sql_where .= ($regex == true ? ' OR ':'') . 'h.hostname LIKE ' . db_qstr($hostname) . ')'; } $dregex = false; if ($description != '') { $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . '('; $regex = false; if (validate_is_regex($description)) { $regex = true; $sql_where .= 'h.description RLIKE ' . db_qstr($description); } $description = '%' . $description . '%'; $sql_where .= ($regex == true ? ' OR ':'') . 'h.description LIKE ' . db_qstr($description) . ')'; } $devices = array_rekey( db_fetch_assoc('SELECT id FROM host AS h ' . $sql_where), 'id', 'id' ); if (cacti_sizeof($devices)) { if ($debug) { print 'DEBUG: Found ' . cacti_sizeof($devices) . ' devices to run automation on' . PHP_EOL; } foreach($devices as $device_id) { if ($debug) { print 'DEBUG: Running automation for Device ID ' . $device_id . PHP_EOL; } cacti_log('NOTE: Running CLI based Batch Automation on Device[' . $device_id . ']', false, 'AUTOM8'); automation_update_device($device_id); } if ($debug) { print 'DEBUG: automation run complete!' . PHP_EOL; } } elseif ($debug) { print 'DEBUG: No devices found for this automation pass.' . PHP_EOL; } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Apply Automation Rules Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL; } /* display_help - displays the usage of the function */ function display_help () { display_version(); print PHP_EOL; print 'usage: apply_automation_rules.php --ids="id1 id2 ..." || --description=S || --hostname=S [--debug]' . PHP_EOL . PHP_EOL; print 'A utility to execute Cacti automation rules for a devices or devices. Any of the following' . PHP_EOL; print 'three options can be used, but at least one must be specified.' . PHP_EOL . PHP_EOL; print 'Required:' . PHP_EOL; print ' --ids="id1 id2 ..." - A space delimited list of device ids.' . PHP_EOL; print ' --hostname="S" - Either a SQL where clause or REGEX of the devices hostname.' . PHP_EOL; print ' --description="S" - Either a SQL where clause or REGEX of the devices description.' . PHP_EOL . PHP_EOL; print 'Optional:' . PHP_EOL; print ' --debug - Provide verbose output during automation' . PHP_EOL . PHP_EOL; } cacti-release-1.2.26/cli/audit_database.php000077500000000000000000001012411454067461500205330ustar00rootroot00000000000000#!/usr/bin/env php 1) { print "FATAL: This utility is designed for the main Data Collector only" . PHP_EOL; exit(1); } /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); $upgrade = false; $create = false; $loadopt = false; $report = false; $repair = false; $altersopt = false; if (cacti_sizeof($parms)) { $shortopts = 'VvHh'; $longopts = array( 'create', 'load', 'report', 'upgrade', 'repair', 'alters', 'version', 'help' ); $options = getopt($shortopts, $longopts); foreach($options as $arg => $value) { switch($arg) { case 'create': $create = true; break; case 'load': $loadopt = true; break; case 'report': $report = true; break; case 'repair': $repair = true; break; case 'alters': $altersopt = true; break; case 'upgrade': $upgrade = true; break; case 'version': case 'V': case 'v': display_version(); exit(0); case 'help': case 'H': case 'h': display_help(); exit(0); default: print "ERROR: Invalid Argument: ($arg)" . PHP_EOL . PHP_EOL; display_help(); exit(1); } } $db_version = db_fetch_cell('SELECT cacti FROM version'); if ($db_version != CACTI_VERSION && !$upgrade) { $upgrade_required = true; } else { $upgrade_required = false; } if ($upgrade_required) { print 'WARNING: Cacti must be upgraded first. Use the --upgrade option to perform that upgrade' . PHP_EOL; exit(1); } elseif ($db_version != CACTI_VERSION && $upgrade) { upgrade_database(); } if ($repair) { repair_database(); } elseif ($create) { create_tables(); } elseif ($report) { report_audit_results(); } elseif ($altersopt) { repair_database(false); } elseif ($loadopt) { load_audit_database(); } else { display_help(); } exit(0); } else { display_help(); exit(1); } function upgrade_database() { global $config; $start = microtime(true); cacti_log('NOTE: Upgrading Cacti, this will take a few minutes.', true, 'UPGRADE'); $return_var = 0; $output = array(); exec('php ' . $config['base_path'] . '/cli/upgrade_database.php --debug', $output, $return_var); $end = microtime(true); if ($return_var == 0) { cacti_log(sprintf('NOTE: Cacti Upgrade succeeded in %.2f seconds', $end - $start), true, 'UPGRADE'); } else { cacti_log('WARNING: Cacti Upgrade Encountered Errors. Messages below. Details are below, but also in Cacti upgrade log.', true, 'UPGRADE'); print '---------------------------------------------------------------------------------------------' . PHP_EOL; print implode(PHP_EOL, $output) . PHP_EOL; print '---------------------------------------------------------------------------------------------' . PHP_EOL; } $pistart = microtime(true); // Upgrade plugins now $plugins = glob($config['base_path'] . '/plugins/*', GLOB_ONLYDIR); // Do syslog and thold first if found $preorder[] = $config['base_path'] . '/plugins/thold'; $preorder[] = $config['base_path'] . '/plugins/syslog'; foreach($plugins as $p) { if (strpos($p, 'thold') !== false) { // Skip, upgrading this first } elseif (strpos($p, 'syslog') !== false) { // Skip, upgrading this second } else { $preorder[] = $p; } } $plugins = $preorder; if (cacti_sizeof($plugins)) { if (!defined('IN_PLUGIN_INSTALL')) { define('IN_PLUGIN_INSTALL', 1); } foreach($plugins as $plugin) { $parts = explode('/', $plugin); $pname = end($parts); $ufunc1 = 'plugin_' . $pname . '_upgrade'; $ufunc2 = $pname . '_upgrade_database'; $ufunc3 = $pname . '_setup_table_new'; if (!plugin_installed($pname)) { cacti_log("NOTE: Plugin $pname is not installed, skipping.", true, 'UPGRADE'); continue; } if (file_exists($plugin . '/INFO')) { // See if the plugin requires upgrading $info = parse_ini_file($plugin . '/INFO', true); $version = $info['info']['version']; $old = db_fetch_cell_prepared('SELECT version FROM plugin_config WHERE directory = ?', array($pname)); if ($version != $old) { if (file_exists($plugin . '/setup.php')) { include_once($plugin . '/setup.php'); if (file_exists($plugin . '/includes/database.php')) { include_once($plugin . '/includes/database.php'); } // Always run the new function if it's there // Some plugins don't upgrade in the proper way if (function_exists($ufunc3)) { cacti_log("NOTE: Running Plugin $pname install function due to some plugins not upgrading properly.", true, 'UPGRADE'); $ufunc3(true); } if (function_exists($ufunc2)) { cacti_log("NOTE: Upgrading Plugin $pname from $old to $version using alternate upgrade path.", true, 'UPGRADE'); $ufunc2(true); } elseif (function_exists($ufunc1)) { cacti_log("NOTE: Upgrading Plugin $pname from $old to $version using standard upgrade path.", true, 'UPGRADE'); $ufunc1; } else { cacti_log("WARNING: Plugin $pname lacks an upgrade function.", true, 'UPGRADE'); } if (file_exists($plugin . '/database_upgrade.php')) { cacti_log("NOTE: Upgrading Plugin $pname from $old to $version using upgrade script.", true, 'UPGRADE'); $return_var = 0; $output = array(); exec('php ' . $config['base_path'] . '/plugins/' . $pname . '/database_upgrade.php --type=large --force-ver=' . $old, $output, $return_var); if ($return_var == 0) { print implode(PHP_EOL, $output) . PHP_EOL; cacti_log("NOTE: Cacti Plugin $pname Upgrade Succeeded.", true, 'UPGRADE'); print '---------------------------------------------------------------------------------------------' . PHP_EOL; print implode(PHP_EOL, $output) . PHP_EOL; print '---------------------------------------------------------------------------------------------' . PHP_EOL; } else { cacti_log("WARNING: Cacti Plugin $pname Upgrade Encountered Errors.", true, 'UPGRADE'); print '---------------------------------------------------------------------------------------------' . PHP_EOL; print implode(PHP_EOL, $output) . PHP_EOL; print '---------------------------------------------------------------------------------------------' . PHP_EOL; } } } else { cacti_log("WARNING: Plugin $pname lacks a setup file.", true, 'UPGRADE'); } } else { cacti_log("NOTE: Plugin $pname Does not Require Upgrade", true, 'UPGRADE'); } } else { cacti_log("WARNING: Plugin $pname lacks an INFO file. Can not upgrade!", true, 'UPGRADE'); } } } // Unregister plugins that no longer exist // We keep legacy tables due to potential // issues. print '---------------------------------------------------------------------------------------------' . PHP_EOL; cacti_log('NOTE: Pruning invalid and deprecated plugins while preserving tables', true, 'UPGRADE'); $plugins = db_fetch_assoc('SELECT directory FROM plugin_config'); if (cacti_sizeof($plugins)) { foreach($plugins as $p) { $pname = $p['directory']; if (!file_exists($config['base_path'] . '/plugins/' . $pname . '/INFO')) { if (file_exists($config['base_path'] . '/plugins/' . $pname . '/setup.php')) { cacti_log("NOTE: Uninstalling Plugin $pname which is not supported. Preserving tables.", true, 'UPGRADE'); api_plugin_uninstall($pname, false); } else { cacti_log("NOTE: Uninstalling Plugin $pname which is not supported and setup.php not found. Preserving tables.", true, 'UPGRADE'); db_execute_prepared('DELETE FROM plugin_config WHERE directory = ?', array($pname)); db_execute_prepared('DELETE FROM plugin_db_changes WHERE plugin = ?', array($pname)); db_execute_prepared('DELETE FROM plugin_hooks WHERE name = ?', array($pname)); db_execute_prepared('DELETE FROM plugin_realms WHERE plugin = ?', array($pname)); } } } } print '---------------------------------------------------------------------------------------------' . PHP_EOL; $end = microtime(true); cacti_log(sprintf('NOTE: Cacti Plugin Upgrades completed in %.2f seconds', $end - $pistart), true, 'UPGRADE'); cacti_log(sprintf('NOTE: Audit Upgrade completed in %.2f seconds.', $end - $start), true, 'UPGRADE'); } function plugin_installed($plugin) { $installed = db_fetch_cell_prepared('SELECT COUNT(*) FROM plugin_config WHERE directory = ? AND status = 1', array($plugin)); return $installed ? true:false; } function repair_database($run = true) { global $altersopt, $database_default; $alters = report_audit_results(false); $good = 0; $bad = 0; if (cacti_sizeof($alters)) { foreach($alters as $table => $changes) { $tblinfo = db_fetch_row_prepared('SELECT ENGINE, SUBSTRING_INDEX(TABLE_COLLATION, "_", 1) AS COLLATION FROM information_schema.tables WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?', array($database_default, $table)); if (isset($tblinfo['COLLATION'])) { $collation = $tblinfo['COLLATION']; } else { $collation = 'utf8mb4'; } if ($tblinfo['ENGINE'] == 'MyISAM') { $suffix = ",\n ENGINE=InnoDB ROW_FORMAT=Dynamic CHARSET=" . $collation; } else { $suffix = ",\n ROW_FORMAT=Dynamic CHARSET=" . $collation; } $sql = 'ALTER TABLE `' . $table . "`\n " . implode(",\n ", $changes) . $suffix . ';'; if ($run) { print '---------------------------------------------------------------------------------------------' . PHP_EOL; print 'Executing Alter for Table : ' . $table; $result = db_execute($sql); if ($result) { $good++; print ' - Success' . PHP_EOL; } else { $bad++; print ' - Failed' . PHP_EOL; print $sql . PHP_EOL; } } else { print '---------------------------------------------------------------------------------------------' . PHP_EOL; print '-- Proposed Alter for Table : ' . $table . PHP_EOL . PHP_EOL; print $sql . PHP_EOL . PHP_EOL; } } } print '---------------------------------------------------------------------------------------------' . PHP_EOL; if ($bad == 0 && $good == 0) { print ($altersopt ? '-- ' : '') . 'Repair Completed! No changes performed.' . PHP_EOL; } elseif ($bad) { print 'Repair Completed! ' . $good . ' Alters succeeded and ' . $bad . ' failed!' . PHP_EOL; } else { print 'Repair Completed! All ' . $good . ' Alters succeeded!' . PHP_EOL; } } function report_audit_results($output = true) { global $database_default, $altersopt; $db_name = 'Tables_in_' . $database_default; create_tables(); $tables = db_fetch_assoc('SHOW TABLES'); $alters = array(); $cols = array( 'table_type' => 'Type', 'table_null' => 'Null', 'table_key' => 'Key', 'table_default' => 'Default', 'table_extra' => 'Extra' ); $idxs = array( 'idx_non_unique' => 'Non_unique', 'idx_key_name' => 'Key_name', 'idx_seq_in_index' => 'Seq_in_index', 'idx_column_name' => 'Column_name', 'idx_packed' => 'Packed', 'idx_comment' => 'Comment' ); if (cacti_sizeof($tables)) { foreach($tables as $table) { $alter_cmds = array(); $table_name = $table[$db_name]; $status = db_fetch_row('SHOW TABLE STATUS LIKE "' . $table_name . '"'); if ($status['Collation'] == 'utf8mb4_unicode_ci' || $status['Collation'] == 'utf8_general_ci') { $collation = 'utf8'; } else { $collation = 'latin'; } if ($output) { print '---------------------------------------------------------------------------------------------' . PHP_EOL; printf('Checking Table: %-45s', '\'' . $table_name . '\''); } else { printf(($altersopt ? '-- ' : '') . 'Scanning Table: %-45s', '\'' . $table_name . '\''); } $table_exists = db_fetch_cell_prepared('SELECT COUNT(*) FROM table_columns WHERE table_name = ?', array($table_name)); if (!$table_exists) { $plugin_table = db_fetch_row_prepared('SELECT * FROM plugin_db_changes WHERE `table` = ? AND method = ?', array($table_name, 'create')); if (!cacti_sizeof($plugin_table)) { if ($output) { print ' - Does not Exist. Possible Plugin' . PHP_EOL; continue; } } if ($output) { print ' - Plugin Detected' . PHP_EOL; continue; } else { print ' - Completed' . PHP_EOL; } } elseif (!$output) { print ' - Completed' . PHP_EOL; } /* Column scanning comes in two parts. In the first part, we * scan the columns in the current database to the saved schema * In the second pass, we look for the columns from the saved * schema to look for missing ones. */ $i = 1; $errors = 0; $warnings = 0; $col_added = array(); $col_alter = array(); $columns = db_fetch_assoc('SHOW COLUMNS IN ' . $table_name); $exists = db_fetch_cell_prepared('SELECT COUNT(*) FROM table_columns WHERE table_name = ?', array($table_name)); if ($exists) { if (cacti_sizeof($columns)) { foreach($columns as $c) { $sequence_off = false; $dbc = db_fetch_row_prepared('SELECT * FROM table_columns WHERE table_name = ? AND table_field = ?', array($table_name, $c['Field'])); if (!cacti_sizeof($dbc)) { $plugin_column = db_fetch_row_prepared('SELECT * FROM plugin_db_changes WHERE `table` = ? AND `column` = ? AND method = ?', array($table_name, $c['Field'], 'addcolumn')); if (!cacti_sizeof($plugin_column)) { if ($output) { print PHP_EOL . 'WARNING Col: \'' . $c['Field'] . '\', does not exist in default Cacti. Plugin possible'; } $warnings++; } } else { foreach($cols as $dbcol => $col) { if ($col == 'Type' && $dbc[$dbcol] == 'text') { if ($collation == 'latin') { $dbc[$dbcol] = 'mediumtext'; } } /* work around MariaDB compatibility issue */ $c[$col] = ! $c[$col] ?: str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $c[$col]); $dbc[$dbcol] = ! $dbc[$dbcol] ?: str_replace('current_timestamp()', 'CURRENT_TIMESTAMP',$dbc[$dbcol]); /* work around MySQL 8.x simplified int columns */ if (strpos($dbc[$dbcol], 'int(') !== false) { // Get the integer first $parts = explode('(', $dbc[$dbcol]); $adbccol = $parts[0]; // Get attributes next $parts = explode(' ', $parts[1], 2); if (isset($parts[1])) { $adbccol .= ' ' . $parts[1]; } $adbccol = trim($adbccol); } else { $adbccol = $dbc[$dbcol]; } /* Work Around for MySQL 8 */ $c[$col] = trim(str_replace('DEFAULT_GENERATED', '', $c[$col])); if (($c[$col] != $dbc[$dbcol] && $c[$col] != $adbccol) && $c[$col] != 'mediumtext') { if ($output) { if ($col != 'Key') { print PHP_EOL . 'ERROR Col: \'' . $c['Field'] . '\', Attribute \'' . $col . '\' invalid. Should be: \'' . $dbc[$dbcol] . '\', Is: \'' . $c[$col] . '\''; } } if (array_search($dbc['table_field'], $col_alter) === false) { $alter_cmds[] = make_column_alter($table_name, $dbc); $col_alter[] = $dbc['table_field']; $errors++; } } } } $i++; } } /* In this pass, we will gather the default schema and look for * missing information. */ $db_columns = db_fetch_assoc_prepared('SELECT * FROM table_columns WHERE table_name = ?', array($table_name)); if (cacti_sizeof($db_columns)) { foreach($db_columns as $dbc) { if (!db_column_exists($table_name, $dbc['table_field'])) { if (array_search($dbc['table_field'], $col_added) === false) { if ($output) { print PHP_EOL . 'WARNING Col: \'' . $dbc['table_field'] . '\' is missing from \'' . $table_name . '\''; } $alter_cmds[] = make_column_add($table_name, $dbc); $col_added[] = $dbc['table_field']; $errors++; } } } } /* Index scanning comes in two parts. In the first part, we * scan the indexes in the current database to the saved schema * In the second pass, we look for the indexes from the saved * schema to look for missing ones. */ $indexes = db_fetch_assoc('SHOW INDEXES IN ' . $table_name); $idx_added = array(); $idx_dropped = array(); if (cacti_sizeof($indexes)) { foreach($indexes as $i) { $key_exists = db_fetch_cell_prepared('SELECT COUNT(*) FROM table_indexes WHERE idx_table_name = ? AND idx_key_name = ?', array($i['Table'], $i['Key_name'])); $dbc = db_fetch_row_prepared('SELECT * FROM table_indexes WHERE idx_table_name = ? AND idx_key_name = ? AND idx_seq_in_index = ? AND idx_column_name = ? ORDER BY idx_seq_in_index', array($i['Table'], $i['Key_name'], $i['Seq_in_index'], $i['Column_name'])); if (!cacti_sizeof($dbc)) { if ($key_exists) { // Ignore till Phase II } elseif (array_search($i['Key_name'], $idx_dropped) === false) { // Primary keys come in Phase II if ($i['Key_name'] != 'PRIMARY') { if ($output) { print PHP_EOL . 'WARNING Index: \'' . $i['Key_name'] . '\', does not exist in default Cacti. Dropping.'; } $alter_cmds[] = 'DROP INDEX ' . $i['Key_name']; $idx_dropped[] = $i['Key_name']; $errors++; } } } else { foreach($idxs as $dbidx => $idx) { if ($i[$idx] != $dbc[$dbidx]) { // Primary keys come in Phase II if ($i['Key_name'] != 'PRIMARY') { if (array_search($i['Key_name'], $idx_added) === false) { if ($output) { print PHP_EOL . 'ERROR Index: \'' . $i['Key_name'] . '\', Attribute \'' . $idx . '\' invalid. Should be: \'' . $dbc[$dbidx] . '\', Is: \'' . $i[$idx] . '\''; } $alter_cmds = array_merge($alter_cmds, make_index_alter($table_name, $i['Key_name'])); $idx_added[] = $i['Key_name']; $errors++; } } } } } } } /* check for missing indexes and add them */ $db_indexes = db_fetch_assoc_prepared('SELECT * FROM table_indexes WHERE idx_table_name = ?', array($table_name)); if (cacti_sizeof($db_indexes)) { foreach($db_indexes as $i) { if (!db_index_exists($table_name, $i['idx_key_name'])) { if (array_search($i['idx_key_name'], $idx_added) === false) { if ($output) { print PHP_EOL . 'ERROR Index: \'' . $i['idx_key_name'] . '\', is missing from \'' . $table_name . '\'';; } $alter_cmds = array_merge($alter_cmds, make_index_alter($table_name, $i['idx_key_name'])); $idx_added[] = $i['idx_key_name']; $errors++; } } else { $prop_seq = db_fetch_cell_prepared('SELECT COUNT(*) FROM table_indexes WHERE idx_table_name = ? AND idx_key_name = ?', array($table_name, $i['idx_key_name'])); $curr_seq = get_sequence_count($table_name, $i['idx_key_name']); $curr_column_seq = get_column_sequence_number($table_name, $i['idx_key_name'], $i['idx_column_name']); //print PHP_EOL . "Prop Seq:" . $prop_seq . ", Curr Seq:" . $curr_seq . PHP_EOL; if ($curr_seq != $prop_seq || $curr_column_seq != $i['idx_seq_in_index']) { if (array_search($i['idx_key_name'], $idx_dropped) === false) { if ($output) { if ($curr_seq != $prop_seq) { print PHP_EOL . 'WARNING Index: \'' . $i['idx_key_name'] . '\', has differing number of columns. Dropping.'; } if ($curr_column_seq != $i['idx_seq_in_index']) { print PHP_EOL . 'WARNING Index: \'' . $i['idx_key_name'] . '\', has resequenced columns. Dropping.'; } } $alter_cmds = array_merge($alter_cmds, make_index_alter($table_name, $i['idx_key_name'])); $idx_added[] = $i['idx_key_name']; $idx_dropped[] = $i['idx_key_name']; $errors++; } } } } } if ($output) { if ($errors || $warnings) { print PHP_EOL . PHP_EOL . 'ERRORS: ' . $errors . ', WARNINGS: ' . $warnings . PHP_EOL; } else { print ' - Clean' . PHP_EOL; } } if (cacti_sizeof($alter_cmds)) { $alters[$table_name] = $alter_cmds; } } } } if ($output) { print '---------------------------------------------------------------------------------------------' . PHP_EOL; if (cacti_sizeof($alters)) { print 'ERRORS are fixable using the --repair option. WARNINGS will not be repaired' . PHP_EOL; print 'due to ambiguous use of the column.' . PHP_EOL; } else { print 'Audit was clean, no errors or warnings' . PHP_EOL; } print '---------------------------------------------------------------------------------------------' . PHP_EOL; } return $alters; } function make_column_props(&$dbc) { $alter_cmd = ''; if (isset($dbc['table_default'])) { $dbc['table_default'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_default']); } if (isset($dbc['table_extra'])) { $dbc['table_extra'] = str_replace('current_timestamp()', 'CURRENT_TIMESTAMP', $dbc['table_extra']); $dbc['table_extra'] = trim(str_replace('DEFAULT_GENERATED', '', $dbc['table_extra'])); } if ($dbc['table_null'] == 'YES') { if ($dbc['table_default'] == 'NULL') { // Ignore } elseif ($dbc['table_default'] === NULL) { // Ignore } elseif ($dbc['table_default'] === '') { // Ignore } else { $alter_cmd .= ' DEFAULT "' . $dbc['table_default'] . '"'; } } elseif ($dbc['table_default'] !== 'NULL' && $dbc['table_default'] !== NULL) { if ($dbc['table_default'] == 'CURRENT_TIMESTAMP') { $alter_cmd .= ' DEFAULT CURRENT_TIMESTAMP'; } elseif ($dbc['table_extra'] != 'auto_increment') { if (strpos($dbc['table_type'], 'int(') !== false && $dbc['table_default'] == '') { $alter_cmd .= ' DEFAULT "0"'; } else { $alter_cmd .= ' DEFAULT \'' . $dbc['table_default'] . '\''; } } } if ($dbc['table_extra'] != '') { $alter_cmd .= ' ' . $dbc['table_extra']; } return $alter_cmd; } function make_column_alter($table, $dbc) { $alter_cmd = 'MODIFY COLUMN `' . $dbc['table_field'] . '` ' . $dbc['table_type'] . ($dbc['table_null'] == 'NO' ? ' NOT NULL':''); $alter_cmd .= make_column_props($dbc); return $alter_cmd; } function make_column_add($table, $dbc) { $after = get_previous_column($table, $dbc['table_field']); if ($after != 'first') { $after = 'AFTER `' . $after . '`'; } $alter_cmd = 'ADD COLUMN `' . $dbc['table_field'] . '` ' . $dbc['table_type'] . ($dbc['table_null'] == 'NO' ? ' NOT NULL':''); $alter_cmd .= make_column_props($dbc); $alter_cmd .= ' ' . $after; return $alter_cmd; } function get_previous_column($table, $column) { $sequence = db_fetch_cell_prepared('SELECT table_sequence FROM table_columns WHERE table_name = ? AND table_field = ?', array($table, $column)); if (!empty($sequence)) { if ($sequence == 1) { return 'first'; } else { $previous = db_fetch_cell_prepared('SELECT table_field FROM table_columns WHERE table_name = ? AND table_sequence = ?', array($table, $sequence - 1)); return $previous; } } } function make_index_alter($table, $key) { $alter_cmds = array(); $alter_cmd = ''; $primary_dropped = false; $parts = db_fetch_assoc_prepared('SELECT * FROM table_indexes WHERE idx_table_name = ? AND idx_key_name = ? ORDER BY idx_seq_in_index', array($table, $key)); $sequence_cnt = get_sequence_count($table, $key); //print PHP_EOL . "NOTE: INDEX KEY is $key, Baseline Sequence: " . cacti_sizeof($parts) . ", Actual Sequence: $sequence_cnt" . PHP_EOL; if ($sequence_cnt != cacti_sizeof($parts) && $sequence_cnt > 0) { if ($key == 'PRIMARY') { $primary_dropped = true; $alter_cmd .= "DROP PRIMARY KEY,\n "; } else { $alter_cmd .= "DROP INDEX `" . $key . "`,\n "; } } elseif (db_index_exists($table, $key)) { if ($key == 'PRIMARY') { $primary_dropped = true; $alter_cmd .= "DROP PRIMARY KEY,\n "; } else { $alter_cmd .= "DROP INDEX `" . $key . "`,\n "; } } if (cacti_sizeof($parts)) { $i = 0; foreach($parts as $p) { if ($i == 0 && $p['idx_key_name'] == 'PRIMARY') { if ($primary_dropped == false) { $alter_cmd .= "DROP PRIMARY KEY,\n "; } $alter_cmd .= 'ADD PRIMARY KEY ('; } elseif ($i == 0) { if ($p['idx_non_unique'] == 1) { $alter_cmd .= 'ADD INDEX `' . $key . '` ('; } else { $alter_cmd .= 'ADD UNIQUE INDEX `' . $key . '` ('; } } $alter_cmd .= ($i > 0 ? ',':'') . '`' . $p['idx_column_name'] . '`'; $i++; } $alter_cmd .= ') USING ' . $p['idx_index_type']; $alter_cmds[] = $alter_cmd; } return $alter_cmds; } function get_sequence_count($table, $index) { $indexes = db_fetch_assoc("SHOW INDEXES IN $table"); $sequence_cnt = 0; if (cacti_sizeof($indexes)) { foreach($indexes as $i) { if ($index == $i['Key_name']) { $sequence_cnt++; } } } return $sequence_cnt; } function get_column_sequence_number($table, $index, $column) { $indexes = db_fetch_assoc("SHOW INDEXES IN $table"); if (cacti_sizeof($indexes)) { foreach($indexes as $i) { $sequence = $i['Seq_in_index']; if ($i['Key_name'] == $index) { if ($i['Column_name'] == $column) { return $sequence; } } } } return -1; } function create_tables($load = true) { global $config, $database_default, $database_username, $database_password, $database_port, $database_hostname; global $altersopt; db_execute("CREATE TABLE IF NOT EXISTS table_columns ( table_name varchar(50) NOT NULL, table_sequence int(10) unsigned NOT NULL, table_field varchar(50) NOT NULL, table_type varchar(50) default NULL, table_null varchar(10) default NULL, table_key varchar(4) default NULL, table_default varchar(50) default NULL, table_extra varchar(128) default NULL, PRIMARY KEY (table_name, table_sequence, table_field)) ENGINE=InnoDB COMMENT='Holds Default Cacti Table Definitions'"); $exists_columns = db_table_exists('table_columns'); if (!$exists_columns) { print "Failed to create 'table_columns'"; exit; } db_execute("CREATE TABLE IF NOT EXISTS table_indexes ( idx_table_name varchar(50) NOT NULL, idx_non_unique int(10) unsigned default NULL, idx_key_name varchar(128) NOT NULL, idx_seq_in_index int(10) unsigned NOT NULL, idx_column_name varchar(50) NOT NULL, idx_collation varchar(10) default NULL, idx_cardinality int(10) unsigned default NULL, idx_sub_part varchar(50) default NULL, idx_packed varchar(128) default NULL, idx_null varchar(10) default NULL, idx_index_type varchar(20) default NULL, idx_comment varchar(128) default NULL, PRIMARY KEY (idx_table_name, idx_key_name, idx_seq_in_index, idx_column_name)) ENGINE=InnoDB COMMENT='Holds Default Cacti Index Definitions'"); $exists_indexes = db_table_exists('table_indexes'); if (!$exists_indexes) { print "Failed to create 'table_indexes'"; exit; } if ($load) { db_execute('TRUNCATE table_columns'); db_execute('TRUNCATE table_indexes'); $output = array(); $error = 0; if (file_exists($config['base_path'] . '/docs/audit_schema.sql')) { exec('mysql' . ' -u' . cacti_escapeshellarg($database_username) . ' -p' . cacti_escapeshellarg($database_password) . ' -h' . cacti_escapeshellarg($database_hostname) . ' -P' . cacti_escapeshellarg($database_port) . ' ' . $database_default . ' < ' . $config['base_path'] . '/docs/audit_schema.sql', $output, $error); if ($error == 0) { print ($altersopt ? '-- ' : '') . 'SUCCESS: Loaded the Audit Schema' . PHP_EOL; } else { print 'FATAL: Failed Load the Audit Schema' . PHP_EOL; print 'ERROR: ' . implode(",\n ", $output) . PHP_EOL; } } else { print 'FATAL: Failed to find Audit Schema' . PHP_EOL; } } } function load_audit_database() { global $config, $database_default, $database_username, $database_password; $db_name = 'Tables_in_' . $database_default; create_tables(false); db_execute('TRUNCATE table_columns'); db_execute('TRUNCATE table_indexes'); $tables = db_fetch_assoc('SHOW TABLES'); if (cacti_sizeof($tables)) { foreach($tables as $table) { $table_name = $table[$db_name]; $columns = db_fetch_assoc('SHOW COLUMNS IN ' . $table_name); $indexes = db_fetch_assoc('SHOW INDEXES IN ' . $table_name); print 'Importing Table: ' . $table_name; $i = 1; if (cacti_sizeof($columns)) { foreach($columns as $c) { db_execute_prepared('INSERT INTO table_columns (table_name, table_sequence, table_field, table_type, table_null, table_key, table_default, table_extra) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', array( $table_name, $i, $c['Field'], $c['Type'], $c['Null'], $c['Key'], $c['Default'], $c['Extra'] ) ); $i++; } } print ' - Done' . PHP_EOL; if (cacti_sizeof($indexes)) { foreach($indexes as $i) { db_execute_prepared('INSERT INTO table_indexes (idx_table_name, idx_non_unique, idx_key_name, idx_seq_in_index, idx_column_name, idx_collation, idx_cardinality, idx_sub_part, idx_packed, idx_null, idx_index_type, idx_comment) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array( $i['Table'], $i['Non_unique'], $i['Key_name'], $i['Seq_in_index'], $i['Column_name'], $i['Collation'], $i['Cardinality'], $i['Sub_part'], $i['Packed'], $i['Null'], $i['Index_type'], $i['Comment'] ) ); } } } } if (is_dir($config['base_path'] . '/docs')) { print PHP_EOL . 'Exporting Table Audit Table Creation Logic to ' . $config['base_path'] . '/docs/audit_schema.sql' . PHP_EOL; $retval = db_dump_data($database_default, 'table_columns table_indexes', array(), $config['base_path'] . '/docs/audit_schema.sql'); if ($retval) { print 'Finished Creating Audit Schema with ERROR' . PHP_EOL . PHP_EOL; } else { print 'Finished Creating Audit Schema' . PHP_EOL . PHP_EOL; } } else { print PHP_EOL . 'FATAL: Docs directory does not exist!' . PHP_EOL . PHP_EOL; } } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Database Audit Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL; } function display_help() { display_version(); print PHP_EOL . 'usage: audit_database.php --report | --repair [ --upgrade ]' . PHP_EOL . PHP_EOL; print 'Cacti utility for auditing and correcting your Cacti database. This utility can' . PHP_EOL; print 'will scan your Cacti database and report any problems in the schema that it finds.' . PHP_EOL . PHP_EOL; print 'Options:' . PHP_EOL; print ' --report - Report on any issues found in the audit of the database' . PHP_EOL; print ' --repair - Repair any issues found during the audit of the database' . PHP_EOL; print ' --upgrade - Upgrade the Cacti database before running' . PHP_EOL . PHP_EOL; print 'Developer Options:' . PHP_EOL; print ' --create - Initialize or Re-initialize the Audit Schema tables.' . PHP_EOL; print ' --load - Take a pristine Cacti install and create Audit Schema and file.' . PHP_EOL; print ' --alters - Print out all the alter commands vs. executing for debugging.' . PHP_EOL . PHP_EOL; } cacti-release-1.2.26/cli/batchgapfix.php000066400000000000000000000341151454067461500200630ustar00rootroot00000000000000#!/usr/bin/env php 1) { print "FATAL: This utility is designed for the main Data Collector only" . PHP_EOL; exit(1); } ini_set('memory_limit', '-1'); ini_set('max_execution_time', '0'); /* process calling arguments */ $parms = $_SERVER['argv']; array_shift($parms); global $debug, $child, $type; $debug = false; $force = false; $host_ids = false; $threads = 5; $child = 0; $type = 'master'; $method = 'fill'; $avgnan = 'last'; $start_time = false; $end_time = false; $php_bin = read_config_option('path_php_binary'); /* install signal handlers for UNIX types only */ if (function_exists('pcntl_signal')) { pcntl_signal(SIGTERM, 'sig_handler'); pcntl_signal(SIGINT, 'sig_handler'); } /* take the start time to log performance data */ $start = microtime(true); foreach($parms as $parameter) { if (strpos($parameter, '=')) { list($arg, $value) = explode('=', $parameter, 2); } else { $arg = $parameter; $value = ''; } switch ($arg) { case '--start': $start_time = strtotime($value); break; case '--end': $end_time = strtotime($value); break; case '--threads': $threads = $value; break; case '--method': $method = $value; break; case '--avgnan': $avgnan = $value; break; case '--host-ids': $host_ids = $value; break; case '--child': $child = $value; break; case '-f': case '--force': $force = true; break; case '-d': case '--debug': $debug = true; break; case '-v': case '-V': case '--version': display_version(); exit; case '-h': case '-H': case '--help': display_help(); exit; default: print 'ERROR: Invalid Parameter ' . $parameter . PHP_EOL . PHP_EOL; display_help(); exit; } } // General time checks if ($end_time === false || $start_time === false) { print 'FATAL: You must provide both --start and an --end dates using \'YYYY-MM-DD HH:MM:SS\' format!' . PHP_EOL; exit(1); } // Secondary time checks if ($end_time < $start_time) { print 'FATAL: End Time is less than start time!' . PHP_EOL; exit(1); } // Tertiary and subsequent time checks if ($end_time < 0) { print 'FATAL: End Time is less than 0!' . PHP_EOL; exit(1); } // Tertiary and subsequent time checks if ($start_time < 0) { print 'FATAL: Start Time is less than 0!' . PHP_EOL; exit(1); } if ($start_time < strtotime('2019-01-01')) { print 'FATAL: Start Time is less than 2019-01-01!.' . PHP_EOL; exit(1); } if ($method != 'fill' && $method != 'float') { print 'FATAL: Invalid --method value. Options are \'fill\' and \'float\'.' . PHP_EOL; exit(1); } if ($avgnan != 'last' && $method != 'avg') { print 'FATAL: Invalid --avgnan value. Options are \'last\' and \'avg\'.' . PHP_EOL; exit(1); } if ($threads <= 0 || $threads > 40) { print 'FATAL: Invalid --threads value. Threads can be from 1 to 40 inclusive.' . PHP_EOL; exit(1); } if ($host_ids !== false) { $host_ids = explode(',', $host_ids); foreach($host_ids as $id) { if (!is_numeric($id)) { print 'FATAL: The list of --host-ids must be a comma delimited list of numeric Cacti host_ids!' . PHP_EOL; exit(1); } } $sql_where = 'WHERE dtd.data_source_path IS NOT NULL AND gl.host_id IN(' . implode(',', $host_ids) . ')'; } else { $sql_where = 'WHERE dtd.data_source_path IS NOT NULL'; } // Command takes a date $start_date = date('Y-m-d H:i:s', $start_time); $end_date = date('Y-m-d H:i:s', $end_time); // Parent Process, prep table insert records if ($child == 0) { $type = 'master'; if ($force) { printf("NOTE: Looking for and killing running processes." . PHP_EOL); $running = db_fetch_assoc('SELECT * FROM processes WHERE tasktype = "batchgapfix"'); if (cacti_sizeof($running)) { printf("NOTE: Found %s running processes found." . PHP_EOL); foreach($running as $r) { $running = posix_kill($r['pid'], 0); if (posix_get_last_error() == 1) { printf("NOTE: Process with PID: %s being killed." . PHP_EOL, $r['pid']); posix_kill($r['pid'], SIGTERM); } else { printf("NOTE: Process with PID: %s, not found likely crashed." . PHP_EOL, $r['pid']); } } db_execute('DELETE FROM processes WHERE tasktype = "batchgapfix"'); } else { printf("NOTE: No running processes found." . PHP_EOL); } } if (!register_process_start('batchgapfix', 'master', 0, 250000)) { print "FATAL: Detected an already running process. Use --force to override" . PHP_EOL; exit(1); } if (db_table_exists('graph_local_spikekill')) { $running = db_fetch_cell('SELECT COUNT(*) FROM graph_local_spikekill WHERE ended = "0000-00-00"'); if ($running > 0 && !$force) { print "FATAL: You have requested a start run, and a run appears to be already running" . PHP_EOL; print "FATAL: Check that no processes are running and use the --force option to override." . PHP_EOL; exit(1); } else { db_execute('TRUNCATE TABLE graph_local_spikekill'); } } else { db_execute('CREATE TABLE graph_local_spikekill ( id INT(10) unsigned NOT NULL auto_increment, local_graph_id INT(10) unsigned NOT NULL default "0", data_source_path varchar(255) NOT NULL default "0", child INT(10) unsigned NOT NULL default "0", exit_code INT(10) unsigned NOT NULL default "0", started TIMESTAMP NOT NULL default "0000-00-00", ended TIMESTAMP NOT NULL default "0000-00-00", PRIMARY KEY (id), KEY child (child), KEY ended (ended)) ENGINE=MEMORY COMMENT="Holds batch spike fill database"'); } // Insert the local graph ids into the spikekill database db_execute("INSERT INTO graph_local_spikekill (local_graph_id, data_source_path) SELECT DISTINCT gl.id, dtd.data_source_path FROM graph_local AS gl INNER JOIN graph_templates_item AS gti ON gl.id = gti.local_graph_id INNER JOIN data_template_rrd AS dtr ON gti.task_item_id = dtr.id INNER JOIN data_template_data AS dtd ON dtd.id = dtr.local_data_id $sql_where"); $rrdfiles = db_affected_rows(); db_execute_prepared('UPDATE graph_local_spikekill SET data_source_path = REPLACE(data_source_path, "", ?)', array($config['rra_path'])); print "NOTE: There are $rrdfiles RRDfiles that will be checked for gaps and fixed" . PHP_EOL; $rrds_per_thread = ceil($rrdfiles/$threads); // Distributing RRDfiles into tasks for ($i = 1; $i <= $threads; $i++) { db_execute_prepared("UPDATE graph_local_spikekill SET child = ? WHERE child = 0 LIMIT $rrds_per_thread", array($i)); } $now = date('H:i:s'); printf("NOTE: %s, Database primed for batch gap fill." . PHP_EOL, $now); // Fork Child Binaries for($i = 1; $i <= $threads; $i++) { $command = sprintf("%s/cli/batchgapfix.php --start='%s' --end='%s' --method=%s --avgnan=%s --child=%s" . ($force ? ' --force':'') . ($debug ? ' --debug':''), $config['base_path'], $start_date, $end_date, $method, $avgnan, $i ); $now = date('H:i:s'); printf("NOTE: %s, Exec in Background: %s %s" . PHP_EOL, $now, $php_bin, $command); exec_background($php_bin, $command); } $start = microtime(true); while (true) { sleep(1); $not_finished = db_fetch_cell_prepared('SELECT COUNT(*) FROM graph_local_spikekill WHERE ended = "0000-00-00"'); $end = microtime(true); $rate = ($rrdfiles - $not_finished) / ($end - $start); if ($rate > 0) { $estimate = round($rrdfiles / $rate, 0); $complate = ($end - $start) - $estimate; } else { $estimate = 'unknown'; } $now = date('H:i:s'); if ($not_finished > 0) { printf("NOTE: %s, Status %s of %s RRDfiles processed. Total Time is %.0f." . PHP_EOL, $now, number_format($rrdfiles - $not_finished), number_format($rrdfiles), $end - $start); printf("NOTE: %s, Processing Rate: %s RRDfiles per/second, Estimated Complete in: %s seconds, Sleeping 1 seconds." . PHP_EOL, $now, round($rate, 2), $estimate); } else { printf("NOTE: All RRDfiles processed. Total Time was %.2f seconds." . PHP_EOL, $end - $start); break; } } $succeeded = db_fetch_cell('SELECT COUNT(*) FROM graph_local_spikekill WHERE exit_code = 0'); $failed = db_fetch_cell('SELECT COUNT(*) FROM graph_local_spikekill WHERE exit_code != 0'); cacti_log(sprintf('BATCHFIX STATS: Time:%s, RRDfiles:%s, Threads:%s, Rate:%s, Succeeded:%s, Failed:%s', round($end - $start, 2), $rrdfiles, $threads, round($rate,2), $succeeded, $failed), false, 'SYSTEM'); unregister_process('batchgapfix', $type, $child); db_execute('TRUNCATE TABLE graph_local_spikekill'); exit(0); } else { $type = 'child'; if (!register_process_start('batchgapfix', 'child', $child, 250000)) { print "FATAL: Detected an already running process. Use --force to override" . PHP_EOL; exit(1); } // Child Process, remediate spikes $rrdfiles = db_fetch_assoc_prepared('SELECT * FROM graph_local_spikekill WHERE child = ?', array($child)); $start = microtime(true); $succeeded = 0; $failed = 0; foreach($rrdfiles as $rrdfile) { $output = array(); $return_var = 0; // Format the command $command = sprintf("%s -q %s/cli/removespikes.php --rrdfile='%s' --outlier-start='%s' --outlier-end='%s' --method=%s --avgnan=%s", $php_bin, $config['base_path'], $rrdfile['data_source_path'], $start_date, $end_date, $method, $avgnan ); db_execute_prepared('UPDATE graph_local_spikekill SET started = NOW() WHERE id = ?', array($rrdfile['id'])); // Run the command debug("NOTE: Running command: $command"); exec($command, $output, $return_var); db_execute_prepared('UPDATE graph_local_spikekill SET ended = NOW(), exit_code = ? WHERE id = ?', array($return_var, $rrdfile['id'])); if ($return_var == 0) { printf("SUCCESS: Gap Fills for RRDfile:%s" . PHP_EOL, $rrdfile['data_source_path']); $succeeded++; } else { printf("FAILED: Gap Fills failed for RRDfile:%s" . PHP_EOL, $graph['data_source_path']); $failed++; } } $end = microtime(true); printf("NOTE: Batch Fill Process Ended in %s seconds. Succeeded:%s, Failed:%s" . PHP_EOL, round($end - $start, 2), $succeeded, $failed); cacti_log(sprintf('BATCHFIX CHILD STATS: Time:%s, Thread:%s, RRDfiles:%s, Succeeded:%s, Failed:%s', round($end - $start, 2), $child, cacti_sizeof($rrdfiles), $succeeded, $failed), false, 'SYSTEM'); unregister_process('batchgapfix', $type, $child); } exit(0); /** sig_handler - provides a generic means to catch exceptions to the Cacti log. * @arg $signo - (int) the signal that was thrown by the interface. * @return - null */ function sig_handler($signo) { global $child, $type; switch ($signo) { case SIGTERM: case SIGINT: unregister_process('batchgapfix', $type, $child); if ($child == 0) { db_execute('TRUNCATE TABLE graph_local_spikekill'); } exit(1); break; default: /* ignore all other signals */ } } function debug($string) { global $debug; if ($debug) { print 'DEBUG: ' . trim($string) . PHP_EOL; } } function display_version() { $version = get_cacti_cli_version(); print "Cacti Batch Graph Gap Fill Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL; } function display_help() { display_version(); print PHP_EOL . 'This utility will fill gaps in graphs based upon a time range.' . PHP_EOL; print 'It will perform this process in parallel to increase performance based upon the number of threads ' . PHP_EOL; print 'selected by the user.' . PHP_EOL . PHP_EOL; print 'usage: batchgapfix.php --start=\'YYYY-MM-DD HH:MM:SS\' --end=\'YYYY-MM-DD HH:MM:SS\' [--threads=N]' . PHP_EOL; print ' [--method=fill|float] [--avgnan=last|avg] [--host-ids=N,N,N,...]' . PHP_EOL; print ' [-f|--force] [-d|--debug]' . PHP_EOL . PHP_EOL; print 'Required:' . PHP_EOL; print ' --start=\'YYYY-MM-DD HH:MM:SS\' - The start date to check and remove gaps.' . PHP_EOL; print ' --end=\'YYYY-MM-DD HH:MM:SS\' - The end date to check and remove gaps.' . PHP_EOL . PHP_EOL; print 'Optional:' . PHP_EOL; print ' --threads=N - Default is 5. The number of parallel threads [1..40]' . PHP_EOL; print ' --method=fill|float - Default is \'fill\'. The method to fill gaps.' . PHP_EOL; print ' --avgnan=last|avg - Default is \'last\'. The number to use to fill gaps.' . PHP_EOL; print ' --host-ids=N,N,N,... - A comma delimited list of Cacti Device ID\'s to process.' . PHP_EOL; print ' --force - Kill the current running batch gap fill and start over.' . PHP_EOL; print ' --debug - Higher tracing level for select utilities.' . PHP_EOL . PHP_EOL; } cacti-release-1.2.26/cli/change_device.php000066400000000000000000000330671454067461500203540ustar00rootroot00000000000000#!/usr/bin/env php 0)) { $overrides['ping_port'] = $value; } else { print "ERROR: Invalid Ping Port: ($value)\n\n"; display_help(); exit(1); } break; case '--ping_retries': if (is_numeric($value) && ($value > 0)) { $overrides['ping_retries'] = $value; } else { print "ERROR: Invalid Ping Retries: ($value)\n\n"; display_help(); exit(1); } break; case '--max_oids': if (is_numeric($value) && ($value > 0)) { $overrides['max_oids'] = $value; } else { print "ERROR: Invalid Max OIDS: ($value)\n\n"; display_help(); exit(1); } break; case '--bulk_walk': if (is_numeric($value) && $value >= -1 && $value != 0) { $overrides['bulk_walk_size'] = $value; } else { print "ERROR: Invalid Bulk Walk Size: ($value)\n\n"; display_help(); exit(1); } case '--version': case '-V': case '-v': display_version(); exit(0); case '--help': case '-H': case '-h': display_help(); exit(0); case '--quiet': $quietMode = true; break; default: print "ERROR: Invalid Argument: ($arg)\n\n"; display_help(); exit(1); } } if (empty($device_id)) { print "ERROR: --id is mandatory parameter.\n"; display_help(); exit(1); } $host = db_fetch_row_prepared('SELECT * FROM host WHERE id = ?', array($device_id)); if (!cacti_sizeof($host)) { print "ERROR: device-id $device_id not found.\n"; exit(1); } /* merge overriden parameters onto host */ $host = array_merge($host, $overrides); /* process the various lists into validation arrays */ $host_templates = getHostTemplates(); $hosts = getHostsByDescription(); $addresses = getAddresses(); /* process templates */ if (!isset($host_templates[$host['host_template_id']])) { print "ERROR: Unknown template id (" . $host['host_template_id'] . ")\n"; exit(1); } if ($host['description'] == '') { print "ERROR: You must supply a description for all hosts!\n"; exit(1); } if ($host['hostname'] == '') { print "ERROR: You must supply an IP address for all hosts!\n"; exit(1); } if ($host['snmp_version'] > 3 || $host['snmp_version'] < 0 || !is_numeric($host['snmp_version'])) { print "ERROR: The snmp version must be between 0 and 3. If you did not specify one, goto Configuration > Settings > Device Defaults and resave your defaults.\n"; exit(1); } if (!is_numeric($host['site_id']) || $host['site_id'] < 0) { print "ERROR: You have specified an invalid site id!\n"; exit(1); } if (!is_numeric($host['poller_id']) || $host['poller_id'] < 0) { print "ERROR: You have specified an invalid poller id!\n"; exit(1); } /* process snmp information */ if ($host['snmp_version'] < 0 || $host['snmp_version'] > 3) { print "ERROR: Invalid snmp version ({$host['snmp_version']})\n"; exit(1); } elseif ($host['snmp_version'] > 0) { if ($host['snmp_port'] <= 1 || $host['snmp_port'] > 65534) { print "ERROR: Invalid port. Valid values are from 1-65534\n"; exit(1); } if ($host['snmp_timeout'] <= 0 || $host['snmp_timeout'] > 20000) { print "ERROR: Invalid timeout. Valid values are from 1 to 20000\n"; exit(1); } } /* community/user/password verification */ if ($host['snmp_version'] < 3) { /* snmp community can be blank */ } else { if ($host['snmp_username'] == "" || $host['snmp_password'] == "") { print "ERROR: When using snmpv3 you must supply an username and password\n"; exit(1); } } if (!$quietMode) { print "Changing device-id: $device_id to {$host['description']} ({$host['hostname']}) as \"{$host_templates[$host['host_template_id']]}\" using SNMP v{$host['snmp_version']} with community \"{$host['snmp_community']}\"\n"; } $host_id = api_device_save($device_id, $host['host_template_id'], $host['description'], $host['ip'], $host['snmp_community'], $host['snmp_version'], $host['snmp_username'], $host['snmp_password'], $host['snmp_port'], $host['snmp_timeout'], $host['disabled'], $host['availability_method'], $host['ping_method'], $host['ping_port'], $host['ping_timeout'], $host['ping_retries'], $host['notes'], $host['snmp_auth_protocol'], $host['snmp_priv_passphrase'], $host['snmp_priv_protocol'], $host['snmp_context'], $host['snmp_engine_id'], $host['max_oids'], $host['device_threads'], $host['poller_id'], $host['site_id'], $host['external_id'], $host['location'], $host['bulk_walk_size']); if (is_error_message() || $host_id != $device_id) { print "ERROR: Failed to change this device ($device_id-$host_id)\n"; exit(1); } else { if (!$quietMode) { print "Success\n"; } exit(0); } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Change Device Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } function display_help() { display_version(); print "\nusage: change_device.php --id= [--description=[description]] [--ip=[IP]] [--template=[ID]] [--notes=\"[]\"] [--disable]\n"; print " [--poller=[id]] [--site=[id] [--external-id=[S]] [--proxy] [--threads=[1]\n"; print " [--avail=[ping]] --ping_method=[icmp] --ping_port=[N/A, 1-65534] --ping_timeout=[N] --ping_retries=[2]\n"; print " [--version=[0|1|2|3]] [--community=] [--port=161] [--timeout=500]\n"; print " [--username= --password=] [--authproto=] [--privpass= --privproto=] [--context=] [--engineid=]\n"; print " [--quiet]\n\n"; print "Required:\n"; print " --id the id for a device, that is field id in table host\n"; print " any optional device attribute parameter given, will replace the existing parameter\n"; print "Optional:\n"; print " --description the name that will be displayed by Cacti in the graphs\n"; print " --ip self explanatory (can also be a FQDN)\n\n"; print " --proxy if specified, allows adding a second host with same ip address\n"; print " --template 0, is a number (read below to get a list of templates)\n"; print " --location '', The physical location of the Device.\n"; print " --notes '', General information about this host. Must be enclosed using double quotes.\n"; print " --external-id '', An external ID to align Cacti devices with devices from other systems.\n"; print " --disable 0, 1 to add this host but to disable checks and 0 to enable it\n"; print " --poller 0, numeric poller id that will perform data collection for the device.\n"; print " --site 0, numeric site id that will be associated with the device.\n"; print " --threads 1, numeric number of threads to poll device with.\n"; print " --avail pingsnmp, [ping][none, snmp, pingsnmp, pingorsnmp]\n"; print " --ping_method tcp, icmp|tcp|udp\n"; print " --ping_port '', 1-65534\n"; print " --ping_retries 2, the number of time to attempt to communicate with a host\n"; print " --ping_timeout N, the ping timeout in milliseconds. Defaults to database setting.\n"; print " --version 1, 0|1|2|3, snmp version. 0 for no snmp\n"; print " --community '', snmp community string for snmpv1 and snmpv2. Leave blank for no community\n"; print " --port 161\n"; print " --timeout 500\n"; print " --username '', snmp username for snmpv3\n"; print " --password '', snmp password for snmpv3\n"; print " --authproto '', snmp authentication protocol for snmpv3\n"; print " --privpass '', snmp privacy passphrase for snmpv3\n"; print " --privproto '', snmp privacy protocol for snmpv3\n"; print " --context '', snmp context for snmpv3\n"; print " --engineid '', snmp engineid for snmpv3\n"; print " --max_oids 10, 1-60, the number of OIDs that can be obtained in a single SNMP Get request\n\n"; print " --bulk_walk -1, 1-60, the bulk walk chunk size that will be used for bulk walks. Use -1 for auto-tune.\n\n"; print " --quiet - batch mode value return\n\n"; } cacti-release-1.2.26/cli/convert_tables.php000077500000000000000000000205721454067461500206220ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); print_or_log($installer, "NOTE: Repairing Tables for Main Database\n"); } else { print_or_log($installer, "NOTE: Repairing Tables for Local Database\n"); } if (cacti_sizeof($skip_tables)) { foreach($skip_tables as $table) { if (!db_table_exists($table)) { print_or_log($installer, "ERROR: Skip Table $table does not Exist. Can not continue.\n\n"); display_help(); exit; } } } $convert = $innodb ? 'InnoDB' : ''; if ($utf8) { $convert .= (strlen($convert) ? ' and ' : '') . ' utf8'; } print_or_log($installer, "Converting Database Tables to $convert with less than '$size' Records\n"); if ($innodb) { $engines = db_fetch_assoc('SHOW ENGINES'); foreach($engines as $engine) { if (strtolower($engine['Engine']) == 'innodb' && strtolower($engine['Support'] == 'off')) { print_or_log($installer, "InnoDB Engine is not enabled\n"); exit; } } $file_per_table = db_fetch_row("show global variables like 'innodb_file_per_table'"); if (strtolower($file_per_table['Value']) != 'on') { print_or_log($installer, 'innodb_file_per_table not enabled'); exit; } } if (strlen($table_name)) { $tables = db_fetch_assoc('SHOW TABLE STATUS LIKE \''.$table_name .'\''); } else { $tables = db_fetch_assoc('SHOW TABLE STATUS'); } if (cacti_sizeof($tables)) { foreach($tables AS $table) { $canConvert = $rebuild; $canInnoDB = false; if (!$canConvert && $innodb) { $canConvert = $table['Engine'] == 'MyISAM'; $canInnoDB = true; } if (in_array($table['Name'], $skip_tables)) { $canInnoDB = false; } if (!$canConvert && $utf8) { $canConvert = $table['Collation'] != 'utf8mb4_unicode_ci'; } if (!$canConvert && $latin) { $canConvert = $table['Collation'] != 'latin1'; } if ($dynamic && $table['Row_format'] == 'Compact') { $canConvert = true; } if ($canConvert) { if ($table['Rows'] < $size || $force) { print_or_log($installer, "Converting Table -> '" . $table['Name'] . "'"); $sql = ''; if ($utf8) { $sql .= ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci'; } elseif ($latin) { $sql .= ' CONVERT TO CHARACTER SET latin1'; } if ($innodb && $canInnoDB) { $sql .= (strlen($sql) ? ',' : '') . ' ENGINE=Innodb'; } $status = db_execute('ALTER TABLE `' . $table['Name'] . '`' . ($dynamic ? ' ROW_FORMAT=Dynamic, ':'') . $sql); if ($status === false) { print_or_log($installer, ' Failed' . PHP_EOL); record_log($installer, "FATAL: Conversion of Table '" . $table['Name'] . "' Failed. Command: 'ALTER TABLE `" . $table['Name'] . "` $sql'"); } else { print_or_log($installer, ' Successful' . PHP_EOL); } } else { print_or_log($installer, "Skipping Table -> '" . $table['Name'] . " too many rows '" . $table['Rows'] . "'" . PHP_EOL); } } else { print_or_log($installer, "Skipping Table -> '" . $table['Name'] . "'" . PHP_EOL); } } } function print_or_log($installer, $text) { if ($installer) { log_install_and_file(POLLER_VERBOSITY_MEDIUM, rtrim($text), 'CONVERT', true); } else { print $text; } } function record_log($installer, $text) { if ($installer) { log_install_and_file(POLLER_VERBOSITY_MEDIUM, rtrim($text), 'CONVERT', true); } else { cacti_log($text, false, 'CONVERT'); } } /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Database Conversion Utility, Version $version, " . COPYRIGHT_YEARS . "\n"; } /* display_help - displays the usage of the function */ function display_help () { display_version(); print "\nusage: convert_tables.php [--debug] [--innodb] [--utf8] [--latin1] [--table=N] [--size=N] [--rebuild] [--dynamic]\n\n"; print "A utility to convert a Cacti Database from MyISAM to the InnoDB table format.\n"; print "MEMORY tables are not converted to InnoDB in this process.\n\n"; print "Required (one or more):\n"; print "-i | --innodb - Convert any MyISAM tables to InnoDB\n"; print "-u | --utf8 - Convert any non-UTF8 tables to utf8mb4_unicode_ci\n"; print "-l | --latin1 - Convert any non-latin1 tables to latin1\n\n"; print "Optional:\n"; print "-t | --table=S - The name of a single table to change\n"; print "-n | --skip-innodb=\"table1 table2 ...\" - Skip converting tables to InnoDB\n"; print "-s | --size=N - The largest table size in records to convert. Default is 1,000,000 rows.\n"; print "-r | --rebuild - Will compress/optimize existing InnoDB tables if found\n"; print " --dynamic - Convert a table to Dynamic row format if available\n"; print " --local - Perform the action on the Remote Data Collector if run from there\n"; print "-f | --force - Proceed with conversion regardless of table size\n\n"; print "-d | --debug - Display verbose output during execution\n\n"; } cacti-release-1.2.26/cli/copy_user.php000077500000000000000000000064711454067461500176220ustar00rootroot00000000000000#!/usr/bin/env php 1) { db_switch_remote_to_main(); } $template_user = $_SERVER['argv'][1]; $new_user = $_SERVER['argv'][2]; print 'Template User: ' . $template_user . PHP_EOL; print 'New User: ' . $new_user . PHP_EOL; /* Check that user exists */ $user_auth = db_fetch_row("SELECT * FROM user_auth WHERE username = '" . $template_user . "' AND realm = 0"); if (! isset($user_auth)) { die("Error: Template user does not exist!" . PHP_EOL . PHP_EOL); } print PHP_EOL . 'Copying User...' . PHP_EOL; if (user_copy($template_user, $new_user) === false) { die('Error: User not copied!' . PHP_EOL . PHP_EOL); } $user_auth = db_fetch_row("SELECT * FROM user_auth WHERE username = '" . $new_user . "' AND realm = 0"); if (! isset($user_auth)) { die('Error: User not copied!' . PHP_EOL . PHP_EOL); } print "User copied..." . PHP_EOL; /* display_version - displays version information */ function display_version() { $version = get_cacti_cli_version(); print "Cacti Copy User Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL; } function display_help() { display_version(); print 'usage: copy_user.php