diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..171d6b78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +catalog-info.yaml linguist-generated=true +**/README.md linguist-generated=true +**/DIFF.md linguist-generated=true +**/gen_ref_pages.py linguist-generated=true +**/mkdocs.yaml linguist-generated=true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..12301490 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..2f0c3975 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,11 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + pull_request: + +jobs: + release-container: + uses: radiorabe/actions/.github/workflows/release-mkdocs.yaml@v0.20.5 diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml new file mode 100644 index 00000000..5cc54800 --- /dev/null +++ b/.github/workflows/semantic-release.yaml @@ -0,0 +1,13 @@ +name: Run semantic-release + +on: + push: + branches: + - main + - release/* + +jobs: + semantic-release: + uses: radiorabe/actions/.github/workflows/semantic-release.yaml@v0.20.5 + secrets: + RABE_ITREAKTION_GITHUB_TOKEN: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..a23639f7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,23 @@ +name: Test + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - run: pip install ansible + + - run: ansible-playbook hack/plays/manage.yml + + - run: git diff --exit-code diff --git a/.gitignore b/.gitignore index a31d6f7e..36a51f06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /rabe.lst **/selinux/tmp **/selinux/*.pp -node_modules/ +site/ +venv/ diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 7b4964b2..00000000 --- a/.jshintrc +++ /dev/null @@ -1 +0,0 @@ -{ "esnext": true } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..fe13742b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,161 @@ +# Contributing to the RaBe Zabbix Templates + +Hi and thanks for wanting to contribute to the RaBe Zabbix templates. + +* Please [create an issue](https://github.com/radiorabe/rabe-zabbix/issues) if you found a bug +* [Start a discussion](https://github.com/radiorabe/rabe-zabbix/discussions) if you need general help +* Or check out the conventions and documentation in this file to add templates + +Keep in mind that this repository is the source of truth for our Zabbix installation, hence we tend to be cautious when merging changes as to now have them impact our Zabbix installation. + +## Conventions + +🚧 Refactor underway! These conventions were written with Zabbix 3.0 in mind. 🚧 + +### Template conventions + +* Use active mode for zabbix agent items by default +* Use an update interval of 300 seconds (5 minutes) by default +* Create at least one unique application per app, ipmi and snmp template +* Use macros whenever possible and feasible, prefix them with a unique per template prefix + +### App specific conventions + +* Apps may contain configuration snippets in a `userparameters/` subdir. +* SELinux policy modules for an app are in the `selinux/` subdir. They are prefixed with "rabezbx" to help differentiate them from system policy. + +### IPMI specific conventions + +* Name server or motherboard templates according to `IPMI + `, for example `Template IPMI Supermicro SSG-6048R-E1CR24N` +* Try to build up a server or motherboard template from existing (or newly + created) standalone sensor templates (which can be reused for the same sensor + and reading type). +* Standalone sensor templates which contain sensor-specific discrete IPMI + sensors (event/reading type code 6Fh) + * Template naming according to `IPMI Sensors`, for example + `IPMI Power Supply Sensors` + * Item key naming according to + `ipmi.discrete-sensor[,]`, for example + `ipmi.discrete-sensor[power-supply,{#IPMI_SENSOR_NAME}]` + * Create triggers according to the sensor's specific event/reading type code + and offsets (see [Table 42-3, Sensor Type + Codes](http://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/second-gen-interface-spec-v2.pdf)) + with the help of the Zabbix [band() + function](https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions) +* Standalone sensor templates which contain generic discrete IPMI sensors + (event/reading type code 02h - 0Ch) + * Template naming according to `IPMI Generic Sensors`, for + example `IPMI Module Board Generic Sensors` + * Item key naming according to + `ipmi.discrete-generic-sensor[,]`, for example + `ipmi.discrete-generic-sensor[module-board,{#IPMI_SENSOR_NAME}]` + * Create triggers according to the sensor's generic event/reading type code + and offsets (see [Table 42-2, Generic Event/Reading Type + Codes](http://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/second-gen-interface-spec-v2.pdf)) + with the help of the Zabbix [band() + function](https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions) +* Use the provided `ipmi-sensor-discovery.sh` external check script for + low-level auto-discovery of multiple sensors. +* FreeIPMI's [interpret sensor + configuration](http://git.savannah.gnu.org/cgit/freeipmi.git/tree/etc/freeipmi_interpret_sensor.conf) + might be helpful for mapping sensor states to Zabbix trigger severities. +* There should be no more need for threshold based sensor templates + (event/reading type code 01h), as they are already handled by the `IPMI + Threshold Sensors` template. + +### SNMP specific conventions + +* Name SNMP templates according to `Template SNMPv `, for example + `Template SNMPv2 Bridge` +* Try to reflect the MIBs name within `` whenever feasible +* Use the textual form of MIB OIDs within your SNMP items. + As an example, use `BRIDGE-MIB::dot1dBaseNumPorts.0` instead of + `.1.3.6.1.2.1.17.1.2.0` +* Include instructions on how to obtain and install the required MIBs for your + template. +* Name items according to `rabe.snmp..` to avoid clashes with + other templates. + Example: `rabe.snmp.bridge.dot1dBaseNumPorts` +* Name low-level discovery rule keys with `rabe.snmp...discovery` + Example: `rabe.snmp-bridge.ports.discovery` +* Create value mappings according to the OID's syntax definition from the MIB. + +## Developing + +The "RaBe Zabbix Templator" is based on Ansible and it's code is stored in the +`hack/` directory. +The playbook supports the version of Zabbix currently used at RaBe as we use +it to download templates for integration in this repository. The all-in-one +`manage.py` playbook takes care of everything, without an API key for the +RaBe servers it soley regenerates README files and documentation. + +### Regenerating READMEs + +```bash +ansible-playbook hack/plays/manage.yml +``` + +### Fetching Templates using ansible + +```bash +ansible-playbook hack/plays/manage.yml -e ansible_zabbix_auth_key= +``` + +If you just want to fetch a single template: + +```bash +ansible-playbook hack/plays/manage.yml -e ansible_zabbix_auth_key= -e 'rabe_zabbix_templates=[{"template_name":"CHANGEME"}]' +``` + +### Adding new templates + +After downloading a template for the first time, you need to configure it's vendor in the new YAML file. + +Add the following in `///.yaml` right after the `description` key. + +```yaml + vendor: + name: RaBe + version: '6.4' +``` + +Switch branch and look at the generated README.md before you commit it: + +```bash +git branch -c feat//add--for- +git add /// +git commit -m 'feat: Add template' +``` + +## Release Management + +The CI/CD setup uses semantic commit messages following the [conventional commits standard](https://www.conventionalcommits.org/en/v1.0.0/). +The workflow is based on the [RaBe shared actions](https://radiorabe.github.io/actions/) +and uses [go-semantic-commit](https://go-semantic-release.xyz/) +to create new releases. + +The commit message should be structured as follows: + +```console +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +The commit contains the following structural elements, to communicate intent to the consumers of your library: + +1. **fix:** a commit of the type `fix` patches gets released with a PATCH version bump +1. **feat:** a commit of the type `feat` gets released as a MINOR version bump +1. **BREAKING CHANGE:** a commit that has a footer `BREAKING CHANGE:` gets released as a MAJOR version bump +1. types other than `fix:` and `feat:` are allowed and don't trigger a release + +If a commit does not contain a conventional commit style message you can fix +it during the squash and merge operation on the PR. + +## Build Process + +The CI/CD setup uses [mkdocs](https://www.mkdocs.org/) to publish documentation to [GitHub Pages](https://pages.github.com/). +The workflow is based on the [RaBe shared actions](https://radiorabe.github.io/actions/). diff --git a/Makefile b/Makefile deleted file mode 100644 index 517299bc..00000000 --- a/Makefile +++ /dev/null @@ -1,201 +0,0 @@ -#!/usr/bin/make -f -# -# Makefile for package rabe-zabbix -# -# Copyright (c) 2017 - 2019 Radio Bern RaBe -# http://www.rabe.ch -# -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public -# License as published by the Free Software Foundation, version -# 3 of the License. -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public -# License along with this program. -# If not, see . -# -# Please submit enhancements, bugfixes or comments via GitHub: -# https://github.com/radiorabe/rabe-zabbix -# - -PN = rabe - -PREFIX ?= /usr/local -ETCDIR ?= ${PREFIX}/etc -DATADIR = ${PREFIX}/share -LIBEXECDIR = ${PREFIX}/libexec -SELINUXDIR = ${DATADIR}/selinux -AGENTDDIR = ${ETCDIR}/zabbix/zabbix_agentd.d -AGENTEXECDIR = ${LIBEXECDIR}/zabbix/${PN} -SUDOERSDIR = ${ETCDIR}/sudoers.d - -# from package selinux-policy-devel -SELINUX_MAKEFILE = /usr/share/selinux/devel/Makefile - -APPS = $(notdir $(wildcard app/*)) -IPMIS = $(notdir $(wildcard ipmi/*)) -OSS = $(notdir $(wildcard os/*)) -SNMPS = $(notdir $(wildcard snmp/*)) - -# Filter out special packages, which doesn't provide a Zabbix template XML for -# example or have a legacy static documentation. -IPMIS := $(filter-out Sensor_Discovery, $(IPMIS)) -SNMPS := $(filter-out README.md \ - SNMPv2_Generic \ - SNMPv2_Interfaces_HC \ - SNMPv2_Netgear_Box_Services \ - SNMPv2_Netgear_Inventory \ - SNMPv2_Netgear_SNTP_client, $(SNMPS)) - -update-app-doc: - $(foreach app,$(APPS), \ - xsltproc \ - --output app/$(app)/README.md \ - --stringparam appName '$(app)' \ - --stringparam xmlName '$(shell basename app/$(app)/*.xml)' \ - --stringparam currentYear '$(shell date +%Y)' \ - --stringparam appHead "`cat app/$(app)/doc/README.head.md`" \ - --stringparam usageType "app" \ - --stringparam usageDoc "`[ -f app/$(app)/doc/README.Usage.md ] && cat app/$(app)/doc/README.Usage.md`" \ - --stringparam selinuxDoc "`[ -f app/$(app)/doc/README.SELinux.md ] && cat app/$(app)/doc/README.SELinux.md`" \ - --stringparam userparamDoc "`[ -f app/$(app)/doc/README.UserParameters.md ] && cat app/$(app)/doc/README.UserParameters.md`" \ - --stringparam scriptDoc "`[ -f app/$(app)/doc/README.scripts.md ] && cat app/$(app)/doc/README.scripts.md`" \ - update-app-doc.xsl app/$(app)/*.xml; \ - ) - -update-impi-doc: - $(foreach ipmi,$(IPMIS), \ - xsltproc \ - --output ipmi/$(ipmi)/README.md \ - --stringparam appName '$(ipmi)' \ - --stringparam xmlName '$(shell basename ipmi/$(ipmi)/*.xml)' \ - --stringparam currentYear '$(shell date +%Y)' \ - --stringparam appHead "`cat ipmi/$(ipmi)/doc/README.head.md`" \ - --stringparam usageType "ipmi" \ - --stringparam usageDoc "`[ -f ipmi/$(ipmi)/doc/README.Usage.md ] && cat ipmi/$(ipmi)/doc/README.Usage.md`" \ - --stringparam selinuxDoc "`[ -f ipmi/$(ipmi)/doc/README.SELinux.md ] && cat ipmi/$(ipmi)/doc/README.SELinux.md`" \ - --stringparam userparamDoc "`[ -f ipmi/$(ipmi)/doc/README.UserParameters.md ] && cat ipmi/$(ipmi)/doc/README.UserParameters.md`" \ - --stringparam scriptDoc "`[ -f ipmi/$(ipmi)/doc/README.scripts.md ] && cat ipmi/$(ipmi)/doc/README.scripts.md`" \ - update-app-doc.xsl ipmi/$(ipmi)/*.xml; \ - ) - -update-os-doc: - $(foreach os,$(OSS), \ - xsltproc \ - --output os/$(os)/README.md \ - --stringparam appName '$(os)' \ - --stringparam xmlName '$(shell basename os/$(os)/*.xml)' \ - --stringparam currentYear '$(shell date +%Y)' \ - --stringparam appHead "`cat os/$(os)/doc/README.head.md`" \ - --stringparam usageType "os" \ - --stringparam usageDoc "`[ -f os/$(os)/doc/README.Usage.md ] && cat os/$(os)/doc/README.Usage.md`" \ - update-app-doc.xsl os/$(os)/*.xml; \ - ) - -update-snmp-doc: - $(foreach snmp,$(SNMPS), \ - xsltproc \ - --output snmp/$(snmp)/README.md \ - --stringparam appName '$(snmp)' \ - --stringparam xmlName '$(shell basename snmp/$(snmp)/*.xml)' \ - --stringparam currentYear '$(shell date +%Y)' \ - --stringparam appHead "`cat snmp/$(snmp)/doc/README.head.md`" \ - --stringparam usageType "snmp" \ - --stringparam usageDoc "`[ -f snmp/$(snmp)/doc/README.Usage.md ] && cat snmp/$(snmp)/doc/README.Usage.md`" \ - --stringparam scriptDoc "`[ -f snmp/$(snmp)/doc/README.scripts.md ] && cat snmp/$(snmp)/doc/README.scripts.md`" \ - update-app-doc.xsl snmp/$(snmp)/*.xml; \ - ) - -.PHONY: update-all -update-all: update-app-doc update-impi-doc update-os-doc update-snmp-doc - -.PHONY: update -update: update-all ## Update buildable docs from xml and docs/ directories. - -build-app-selinux: -# SELinux type enforcement files are named rabezbx.te and will result -# in a SELinux module name of rabezbx - $(foreach teFile,$(wildcard app/*/selinux/rabezbx*.te), \ - make -C $(dir $(teFile)) -f $(SELINUX_MAKEFILE) \ - PREFIX=/usr NAME=$(notdir $(basename $(teFile))) \ - && echo -n "$(notdir $(basename $(teFile))) " >> rabe.lst; \ - ) - -.PHONY: build-app -build-app: build-app-selinux - -.PHONY: build-selinux -build-selinux: build-app-selinux ## Build SELinux modules. - -.PHONY: build-all -build-all: build-app - -.PHONY: build -build: build-all ## Build everything. - -.PHONY: test-app -test-app: - -.PHONY: test -test: all test-app - -# install a SELinux policy per app that matches the rabezbx*.pp files -.PHONY: install-app-selinux -install-app-selinux: - install -d $(SELINUXDIR)/targeted - install -p -m 644 app/*/selinux/rabezbx*.pp $(SELINUXDIR)/targeted - install -p -m 644 rabe.lst $(SELINUXDIR)/targeted - -# install a userparameters config file per app that matches the *.conf files -.PHONY: install-app-config -install-app-config: - install -d $(AGENTDDIR) - install -p -m 644 app/*/userparameters/*.conf $(AGENTDDIR) - -# install any scripts found in a */scripts/* subdir -# they all get put into /var/libexec/zabbix/rabe and you need to take care not -# to clash with existing scripts when adding new ones -.PHONY: install-scripts -install-scripts: - install -d $(AGENTEXECDIR) - $(foreach script,$(wildcard */*/scripts/*), \ - install -p -m 755 $(script) $(AGENTEXECDIR); \ - ) - -# install sudoers config droplets per app that matches the sudoers.d file -# naming policy prefix -.PHONY: install-app-sudoers -install-app-sudoers: - install -d $(SUDOERSDIR) - install -p -m 600 app/*/sudoers.d/rabezbx-* $(SUDOERSDIR) - -.PHONY: install-app -install-app: install-app-selinux install-app-config install-scripts \ - install-app-sudoers - -.PHONY: install -install: install-app ## Install rabe-zabbix to $(PREFIX) - -.PHONY: clean-app -clean-app: - rm -rf rabe.lst - $(foreach app,$(APPS), \ - rm -rf app/$(app)/selinux/*.pp app/$(app)/selinux/tmp; \ - ) - -.PHONY: clean -clean: clean-app ## Clean working copy - -.PHONY: help -.DEFAULT_GOAL := help -help: - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \ - awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' - -.PHONY: all -all: build test diff --git a/Overrides/Apache_by_HTTP/6.4/Apache_by_HTTP.yaml b/Overrides/Apache_by_HTTP/6.4/Apache_by_HTTP.yaml new file mode 100644 index 00000000..2c335a97 --- /dev/null +++ b/Overrides/Apache_by_HTTP/6.4/Apache_by_HTTP.yaml @@ -0,0 +1,822 @@ +zabbix_export: + version: '6.4' + template_groups: + - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 + name: Templates/Applications + templates: + - uuid: 86702e8bc514434e8c914d50c206cb94 + template: 'Apache by HTTP' + name: 'Apache by HTTP' + description: | + Get metrics from mod_status module using HTTP agent. + https://httpd.apache.org/docs/current/mod/mod_status.html + + You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache + + Generated by official Zabbix template tool "Templator" + + ## Changes + + These changes are part of [RaBe's Zabbix template and helpers + collection](https://github.com/radiorabe/rabe-zabbix). + + * Added `{$APACHE.STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + vendor: + name: Zabbix + version: 6.4-0 + groups: + - name: Templates/Applications + items: + - uuid: b9fe6f0bbe174e9f81af84a3bc0b0e7c + name: 'Apache: Total bytes' + type: DEPENDENT + key: apache.bytes + delay: '0' + history: 7d + value_type: FLOAT + units: B + description: 'The total bytes served.' + preprocessing: + - type: JSONPATH + parameters: + - '$["Total kBytes"]' + - type: MULTIPLIER + parameters: + - '1024' + master_item: + key: apache.get_status + tags: + - tag: component + value: network + - uuid: b36010be10874cf188eeacc81f2c366f + name: 'Apache: Bytes per second' + type: DEPENDENT + key: apache.bytes.rate + delay: '0' + history: 7d + value_type: FLOAT + units: Bps + description: | + It is calculated as a rate of change for total bytes statistics. + `BytesPerSec` is not used, as it counts the average since the last Apache server start. + preprocessing: + - type: JSONPATH + parameters: + - '$["Total kBytes"]' + - type: MULTIPLIER + parameters: + - '1024' + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: apache.get_status + tags: + - tag: component + value: network + - uuid: e61be8ad92004100aca55fcedd2a3807 + name: 'Apache: Get status' + type: HTTP_AGENT + key: apache.get_status + history: 1h + trends: '0' + value_type: TEXT + description: | + Getting data from a machine-readable version of the Apache status page. + For more information see Apache Module [mod_status](https://httpd.apache.org/docs/current/mod/mod_status.html). + preprocessing: + - type: JAVASCRIPT + parameters: + - | + var lines = value.split('\n'); + var output = {}, + workers = { + '_': 0, 'S': 0, 'R': 0, 'W': 0, + 'K': 0, 'D': 0, 'C': 0, 'L': 0, + 'G': 0, 'I': 0, '.': 0 + }; + + for (var i = 0; i < lines.length; i++) { + var line = lines[i].match(/([A-z0-9 ]+): (.*)/); + + if (line !== null) { + output[line[1]] = isNaN(line[2]) ? line[2] : Number(line[2]); + } + } + + output.ServerUptimeSeconds = output.ServerUptimeSeconds || output.Uptime; + output.ServerVersion = output.ServerVersion || output.Server; + + if (typeof output.Scoreboard === 'string') { + for (var i = 0; i < output.Scoreboard.length; i++) { + var char = output.Scoreboard[i]; + + workers[char]++; + } + } + + output.Workers = { + waiting: workers['_'], starting: workers['S'], reading: workers['R'], + sending: workers['W'], keepalive: workers['K'], dnslookup: workers['D'], + closing: workers['C'], logging: workers['L'], finishing: workers['G'], + cleanup: workers['I'], slot: workers['.'] + }; + + return JSON.stringify(output); + url: '{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}' + retrieve_mode: BOTH + tags: + - tag: component + value: raw + triggers: + - uuid: db396445cc5042f89f31dc12cb99c32e + expression: 'nodata(/Apache by HTTP/apache.get_status,30m)=1' + name: 'Apache: Failed to fetch status page' + event_name: 'Apache: Failed to fetch status page (or no data for 30m)' + priority: WARNING + description: 'Zabbix has not received any data for items for the last 30 minutes.' + manual_close: 'YES' + dependencies: + - name: 'Apache: Service is down' + expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + tags: + - tag: scope + value: availability + - uuid: 5fb5101de70a43fab50d55f418462255 + name: 'Apache: Total requests' + type: DEPENDENT + key: apache.requests + delay: '0' + history: 7d + description: 'The total number of the Apache server accesses.' + preprocessing: + - type: JSONPATH + parameters: + - '$["Total Accesses"]' + master_item: + key: apache.get_status + tags: + - tag: component + value: network + - uuid: ee15f4958040459da53251cc3561ed39 + name: 'Apache: Requests per second' + type: DEPENDENT + key: apache.requests.rate + delay: '0' + history: 7d + value_type: FLOAT + description: | + It is calculated as a rate of change for the "Total requests" statistics. + `ReqPerSec` is not used, as it counts the average since the last Apache server start. + preprocessing: + - type: JSONPATH + parameters: + - '$["Total Accesses"]' + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: apache.get_status + tags: + - tag: component + value: network + - uuid: 3dd8ba505d584b028c7ac08d8b959eb3 + name: 'Apache: Uptime' + type: DEPENDENT + key: apache.uptime + delay: '0' + history: 7d + units: uptime + description: 'The service uptime expressed in seconds.' + preprocessing: + - type: JSONPATH + parameters: + - $.ServerUptimeSeconds + master_item: + key: apache.get_status + tags: + - tag: component + value: system + triggers: + - uuid: 76cfa6ebf39f4c8fbd8fde9e0f36d3ed + expression: 'last(/Apache by HTTP/apache.uptime)<10m' + name: 'Apache: Host has been restarted' + event_name: 'Apache: {HOST.NAME} has been restarted (uptime < 10m)' + priority: INFO + description: 'Uptime is less than 10 minutes.' + manual_close: 'YES' + tags: + - tag: scope + value: notice + - uuid: fe0de2eb1478482f99b38c13bd20564c + name: 'Apache: Version' + type: DEPENDENT + key: apache.version + delay: '0' + history: 7d + trends: '0' + value_type: CHAR + description: 'The Apache service version.' + preprocessing: + - type: JSONPATH + parameters: + - $.ServerVersion + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 1d + master_item: + key: apache.get_status + tags: + - tag: component + value: system + triggers: + - uuid: 5296d69af0704d0e8a07398f0b4c9685 + expression: 'last(/Apache by HTTP/apache.version,#1)<>last(/Apache by HTTP/apache.version,#2) and length(last(/Apache by HTTP/apache.version))>0' + name: 'Apache: Version has changed' + event_name: 'Apache: Version has changed (new version: {ITEM.VALUE})' + priority: INFO + description: 'Apache version has changed. Acknowledge to close the problem manually.' + manual_close: 'YES' + tags: + - tag: scope + value: notice + - uuid: f74ffb92e30e48958b5b82f7dfbe5147 + name: 'Apache: Workers idle cleanup' + type: DEPENDENT + key: apache.workers.cleanup + delay: '0' + history: 7d + description: 'The number of workers in cleanup state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.cleanup + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: d664bee9a330480bbaee7273b871a8d3 + name: 'Apache: Workers closing connection' + type: DEPENDENT + key: apache.workers.closing + delay: '0' + history: 7d + description: 'The number of workers in closing state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.closing + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: a6fb3444585749be998ec840cd8e4511 + name: 'Apache: Workers DNS lookup' + type: DEPENDENT + key: apache.workers.dnslookup + delay: '0' + history: 7d + description: 'The number of workers in `dnslookup` state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.dnslookup + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: fcf771f2a9b64a81a37db679f0494ed3 + name: 'Apache: Workers finishing' + type: DEPENDENT + key: apache.workers.finishing + delay: '0' + history: 7d + description: 'The number of workers in finishing state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.finishing + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: cb81a6a77395444283bc5e065fcbfc2e + name: 'Apache: Workers keepalive (read)' + type: DEPENDENT + key: apache.workers.keepalive + delay: '0' + history: 7d + description: 'The number of workers in `keepalive` state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.keepalive + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 7fc0002a279b4541af569a03c1aca2ac + name: 'Apache: Workers logging' + type: DEPENDENT + key: apache.workers.logging + delay: '0' + history: 7d + description: 'The number of workers in logging state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.logging + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 78b0bd7d8bec49549fc003d460af9177 + name: 'Apache: Workers reading request' + type: DEPENDENT + key: apache.workers.reading + delay: '0' + history: 7d + description: 'The number of workers in reading state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.reading + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 379ac66397b94463ad17b24fbd20c615 + name: 'Apache: Workers sending reply' + type: DEPENDENT + key: apache.workers.sending + delay: '0' + history: 7d + description: 'The number of workers in sending state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.sending + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 1c90055e02a244fc8d18e73b23daa0f1 + name: 'Apache: Workers slot with no current process' + type: DEPENDENT + key: apache.workers.slot + delay: '0' + history: 7d + description: 'The number of slots with no current process.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.slot + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: ae21ea113e8840349aff81ab582d92b4 + name: 'Apache: Workers starting up' + type: DEPENDENT + key: apache.workers.starting + delay: '0' + history: 7d + description: 'The number of workers in starting state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.starting + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: be1a05a6eab84b64ac4d51c966ea91e8 + name: 'Apache: Workers waiting for connection' + type: DEPENDENT + key: apache.workers.waiting + delay: '0' + history: 7d + description: 'The number of workers in waiting state.' + preprocessing: + - type: JSONPATH + parameters: + - $.Workers.waiting + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 1752b9bcf7b34abbaf105f5261638271 + name: 'Apache: Total workers busy' + type: DEPENDENT + key: apache.workers_total.busy + delay: '0' + history: 7d + description: 'The total number of busy worker threads/processes.' + preprocessing: + - type: JSONPATH + parameters: + - $.BusyWorkers + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: b1b1c86a12964ae2813c63481e464ec7 + name: 'Apache: Total workers idle' + type: DEPENDENT + key: apache.workers_total.idle + delay: '0' + history: 7d + description: 'The total number of idle worker threads/processes.' + preprocessing: + - type: JSONPATH + parameters: + - $.IdleWorkers + master_item: + key: apache.get_status + tags: + - tag: component + value: system + - uuid: 5039d11bc3964d6e9928a0a46dd0b402 + name: 'Apache: Service response time' + type: SIMPLE + key: 'net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]' + history: 7d + value_type: FLOAT + units: s + tags: + - tag: component + value: application + - tag: component + value: health + triggers: + - uuid: ffbb564032c7462eb0bb9b4c2f700559 + expression: 'min(/Apache by HTTP/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}' + name: 'Apache: Service response time is too high' + event_name: 'Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)' + priority: WARNING + manual_close: 'YES' + dependencies: + - name: 'Apache: Service is down' + expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance + - uuid: fb65918695094026838e2b9e4ca00402 + name: 'Apache: Service ping' + type: SIMPLE + key: 'net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]' + history: 7d + valuemap: + name: 'Service state' + preprocessing: + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 10m + tags: + - tag: component + value: application + - tag: component + value: health + triggers: + - uuid: afe2fde35d054333adc8369a0f9af778 + expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + name: 'Apache: Service is down' + priority: AVERAGE + manual_close: 'YES' + tags: + - tag: scope + value: availability + discovery_rules: + - uuid: eee8abd3174d426092e8bca9b3ba982e + name: 'Event MPM discovery' + type: DEPENDENT + key: apache.mpm.event.discovery + delay: '0' + description: | + The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. + For more details see [Apache MPM event](https://httpd.apache.org/docs/current/mod/event.html). + item_prototypes: + - uuid: f52700379f9a4ee8b378a2eb9caea070 + name: 'Apache: Bytes per request' + type: DEPENDENT + key: 'apache.bytes[per_request{#SINGLETON}]' + delay: '0' + history: 7d + value_type: FLOAT + units: B + description: 'The average number of client requests per second.' + preprocessing: + - type: JSONPATH + parameters: + - $.BytesPerReq + master_item: + key: apache.get_status + tags: + - tag: component + value: connection + - uuid: 062d7c941f0c468d8b63fa76ae0610f6 + name: 'Apache: Connections async closing' + type: DEPENDENT + key: 'apache.connections[async_closing{#SINGLETON}]' + delay: '0' + history: 7d + description: 'The number of asynchronous connections in closing state (applicable only to the event MPM).' + preprocessing: + - type: JSONPATH + parameters: + - $.ConnsAsyncClosing + master_item: + key: apache.get_status + tags: + - tag: component + value: connection + - uuid: 6cb8b255ad8343a48e622912bc298366 + name: 'Apache: Connections async keepalive' + type: DEPENDENT + key: 'apache.connections[async_keep_alive{#SINGLETON}]' + delay: '0' + history: 7d + description: 'The number of asynchronous connections in keepalive state (applicable only to the event MPM).' + preprocessing: + - type: JSONPATH + parameters: + - $.ConnsAsyncKeepAlive + master_item: + key: apache.get_status + tags: + - tag: component + value: connection + - uuid: 997b3452aac24ad6afbad775d649c727 + name: 'Apache: Connections async writing' + type: DEPENDENT + key: 'apache.connections[async_writing{#SINGLETON}]' + delay: '0' + history: 7d + description: 'The number of asynchronous connections in writing state (applicable only to the event MPM).' + preprocessing: + - type: JSONPATH + parameters: + - $.ConnsAsyncWriting + master_item: + key: apache.get_status + tags: + - tag: component + value: connection + - uuid: 31cb044eed904ca19150921fe36f3285 + name: 'Apache: Connections total' + type: DEPENDENT + key: 'apache.connections[total{#SINGLETON}]' + delay: '0' + history: 7d + description: 'The number of total connections.' + preprocessing: + - type: JSONPATH + parameters: + - $.ConnsTotal + master_item: + key: apache.get_status + tags: + - tag: component + value: connection + - uuid: 34555340f3ad4b878504df188f54a9c9 + name: 'Apache: Number of async processes' + type: DEPENDENT + key: 'apache.process[num{#SINGLETON}]' + delay: '0' + history: 7d + description: 'The number of asynchronous processes.' + preprocessing: + - type: JSONPATH + parameters: + - $.Processes + master_item: + key: apache.get_status + tags: + - tag: component + value: system + graph_prototypes: + - uuid: 066b53ed2244414ca3090498eb035c27 + name: 'Apache: Current async connections{#SINGLETON}' + graph_items: + - color: 199C0D + item: + host: 'Apache by HTTP' + key: 'apache.connections[async_closing{#SINGLETON}]' + - sortorder: '1' + color: F63100 + item: + host: 'Apache by HTTP' + key: 'apache.connections[async_keep_alive{#SINGLETON}]' + - sortorder: '2' + color: 00611C + item: + host: 'Apache by HTTP' + key: 'apache.connections[async_writing{#SINGLETON}]' + - sortorder: '3' + drawtype: BOLD_LINE + color: F7941D + item: + host: 'Apache by HTTP' + key: 'apache.connections[total{#SINGLETON}]' + - uuid: dbaa0c2468cc40fca977fb382d19cb78 + name: 'Apache: Current async processes{#SINGLETON}' + graph_items: + - drawtype: GRADIENT_LINE + color: 199C0D + item: + host: 'Apache by HTTP' + key: 'apache.process[num{#SINGLETON}]' + master_item: + key: apache.get_status + preprocessing: + - type: JAVASCRIPT + parameters: + - | + return JSON.stringify(JSON.parse(value).ServerMPM === 'event' + ? [{'{#SINGLETON}': ''}] : []); + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 3h + tags: + - tag: class + value: software + - tag: target + value: apache + macros: + - macro: '{$APACHE.RESPONSE_TIME.MAX.WARN}' + value: '10' + description: 'The maximum Apache response time expressed in seconds for a trigger expression.' + - macro: '{$APACHE.STATUS.HOST}' + value: 127.0.0.1 + description: 'Hostname or IP of Apache HTTP server' + - macro: '{$APACHE.STATUS.PATH}' + value: 'server-status?auto' + description: 'The URL path.' + - macro: '{$APACHE.STATUS.PORT}' + value: '80' + description: 'The port of the Apache status page.' + - macro: '{$APACHE.STATUS.SCHEME}' + value: http + description: 'The request scheme, which may be either HTTP or HTTPS.' + dashboards: + - uuid: a328c9e713424465a8e1adec7322b0dc + name: 'Apache performance' + pages: + - name: General + widgets: + - type: graph + width: '24' + height: '7' + fields: + - type: GRAPH + name: graphid + value: + host: 'Apache by HTTP' + name: 'Apache: Worker states' + - type: graph + 'y': '7' + width: '12' + height: '5' + fields: + - type: GRAPH + name: graphid + value: + host: 'Apache by HTTP' + name: 'Apache: Requests per second' + - type: graphprototype + 'y': '12' + width: '12' + height: '5' + fields: + - type: INTEGER + name: columns + value: '1' + - type: GRAPH_PROTOTYPE + name: graphid + value: + host: 'Apache by HTTP' + name: 'Apache: Current async connections{#SINGLETON}' + - type: graph + x: '12' + 'y': '7' + width: '12' + height: '5' + fields: + - type: GRAPH + name: graphid + value: + host: 'Apache by HTTP' + name: 'Apache: Workers total' + - type: graphprototype + x: '12' + 'y': '12' + width: '12' + height: '5' + fields: + - type: INTEGER + name: columns + value: '1' + - type: GRAPH_PROTOTYPE + name: graphid + value: + host: 'Apache by HTTP' + name: 'Apache: Current async processes{#SINGLETON}' + valuemaps: + - uuid: a5d1f911fb264bd4bc087ea582626d7f + name: 'Service state' + mappings: + - value: '0' + newvalue: Down + - value: '1' + newvalue: Up + graphs: + - uuid: a3998992f7504a12826e3c4d592836b5 + name: 'Apache: Requests per second' + graph_items: + - drawtype: GRADIENT_LINE + color: 199C0D + item: + host: 'Apache by HTTP' + key: apache.requests.rate + - uuid: 1629062b5cd74b67af9a60226a79f8f1 + name: 'Apache: Worker states' + graph_items: + - color: 199C0D + item: + host: 'Apache by HTTP' + key: apache.workers.dnslookup + - sortorder: '1' + color: F63100 + item: + host: 'Apache by HTTP' + key: apache.workers.cleanup + - sortorder: '2' + color: 00611C + item: + host: 'Apache by HTTP' + key: apache.workers.logging + - sortorder: '3' + color: F7941D + item: + host: 'Apache by HTTP' + key: apache.workers.reading + - sortorder: '4' + color: FC6EA3 + item: + host: 'Apache by HTTP' + key: apache.workers.sending + - sortorder: '5' + color: 6C59DC + item: + host: 'Apache by HTTP' + key: apache.workers.starting + - sortorder: '6' + color: C7A72D + item: + host: 'Apache by HTTP' + key: apache.workers.closing + - sortorder: '7' + color: BA2A5D + item: + host: 'Apache by HTTP' + key: apache.workers.finishing + - sortorder: '8' + color: F230E0 + item: + host: 'Apache by HTTP' + key: apache.workers.keepalive + - sortorder: '9' + color: 5CCD18 + item: + host: 'Apache by HTTP' + key: apache.workers.slot + - sortorder: '10' + color: BB2A02 + item: + host: 'Apache by HTTP' + key: apache.workers.waiting + - uuid: 78e59f1b5eb747019f92921ac5ef48b0 + name: 'Apache: Workers total' + type: STACKED + graph_items: + - color: 199C0D + item: + host: 'Apache by HTTP' + key: apache.workers_total.busy + - sortorder: '1' + color: F63100 + item: + host: 'Apache by HTTP' + key: apache.workers_total.idle diff --git a/Overrides/Apache_by_HTTP/6.4/DIFF.md b/Overrides/Apache_by_HTTP/6.4/DIFF.md new file mode 100644 index 00000000..38041381 --- /dev/null +++ b/Overrides/Apache_by_HTTP/6.4/DIFF.md @@ -0,0 +1,105 @@ +# Compare Rabe Override with Upstream Template + +Original: [Apache by HTTP](https://raw.githubusercontent.com/zabbix/zabbix/release/6.4/templates/app/apache_http/template_app_apache_http.yaml) + +## Diff + +```diff +--- before ++++ after +@@ -14,6 +14,13 @@ + You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache + + Generated by official Zabbix template tool "Templator" ++ ++ ## Changes ++ ++ These changes are part of [RaBe's Zabbix template and helpers ++ collection](https://github.com/radiorabe/rabe-zabbix). ++ ++ * Added `{$APACHE.STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + vendor: + name: Zabbix + version: 6.4-0 +@@ -52,7 +59,6 @@ + description: | + It is calculated as a rate of change for total bytes statistics. + `BytesPerSec` is not used, as it counts the average since the last Apache server start. +- + preprocessing: + - type: JSONPATH + parameters: +@@ -117,7 +123,7 @@ + }; + + return JSON.stringify(output); +- url: '{$APACHE.STATUS.SCHEME}://{HOST.CONN}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}' ++ url: '{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}' + retrieve_mode: BOTH + tags: + - tag: component +@@ -132,7 +138,7 @@ + manual_close: 'YES' + dependencies: + - name: 'Apache: Service is down' +- expression: 'last(/Apache by HTTP/net.tcp.service[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"])=0' ++ expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + tags: + - tag: scope + value: availability +@@ -445,7 +451,7 @@ + - uuid: 5039d11bc3964d6e9928a0a46dd0b402 + name: 'Apache: Service response time' + type: SIMPLE +- key: 'net.tcp.service.perf[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"]' ++ key: 'net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]' + history: 7d + value_type: FLOAT + units: s +@@ -456,21 +462,21 @@ + value: health + triggers: + - uuid: ffbb564032c7462eb0bb9b4c2f700559 +- expression: 'min(/Apache by HTTP/net.tcp.service.perf[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}' ++ expression: 'min(/Apache by HTTP/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}' + name: 'Apache: Service response time is too high' + event_name: 'Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)' + priority: WARNING + manual_close: 'YES' + dependencies: + - name: 'Apache: Service is down' +- expression: 'last(/Apache by HTTP/net.tcp.service[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"])=0' ++ expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance + - uuid: fb65918695094026838e2b9e4ca00402 + name: 'Apache: Service ping' + type: SIMPLE +- key: 'net.tcp.service[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"]' ++ key: 'net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]' + history: 7d + valuemap: + name: 'Service state' +@@ -485,7 +491,7 @@ + value: health + triggers: + - uuid: afe2fde35d054333adc8369a0f9af778 +- expression: 'last(/Apache by HTTP/net.tcp.service[http,"{HOST.CONN}","{$APACHE.STATUS.PORT}"])=0' ++ expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0' + name: 'Apache: Service is down' + priority: AVERAGE + manual_close: 'YES' +@@ -652,6 +658,9 @@ + - macro: '{$APACHE.RESPONSE_TIME.MAX.WARN}' + value: '10' + description: 'The maximum Apache response time expressed in seconds for a trigger expression.' ++ - macro: '{$APACHE.STATUS.HOST}' ++ value: 127.0.0.1 ++ description: 'Hostname or IP of Apache HTTP server' + - macro: '{$APACHE.STATUS.PATH}' + value: 'server-status?auto' + description: 'The URL path.' + + +``` diff --git a/Overrides/Apache_by_HTTP/6.4/README.md b/Overrides/Apache_by_HTTP/6.4/README.md new file mode 100644 index 00000000..cf9e0b41 --- /dev/null +++ b/Overrides/Apache_by_HTTP/6.4/README.md @@ -0,0 +1,863 @@ +# Zabbix Template: Apache by HTTP + +![class: software](https://img.shields.io/badge/class-software-00c9bf) ![target: apache](https://img.shields.io/badge/target-apache-00c9bf) ![vendor: Zabbix](https://img.shields.io/badge/vendor-Zabbix-00c9bf) ![version: 6.4-0](https://img.shields.io/badge/version-6.4--0-00c9bf) + +Get metrics from mod_status module using HTTP agent. +https://httpd.apache.org/docs/current/mod/mod_status.html + +You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache + +Generated by official Zabbix template tool "Templator" + +## Changes + +These changes are part of [RaBe's Zabbix template and helpers +collection](https://github.com/radiorabe/rabe-zabbix). + +* Added `{$APACHE.STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + +## Items + +### Item: Apache: Total bytes + +![component: network](https://img.shields.io/badge/component-network-00c9bf) + +The total bytes served. + +```console +apache.bytes +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT in B | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[\"Total kBytes\"]"]` | +| MULTIPLIER | `["1024"]` | + +### Item: Apache: Bytes per second + +![component: network](https://img.shields.io/badge/component-network-00c9bf) + +It is calculated as a rate of change for total bytes statistics. +`BytesPerSec` is not used, as it counts the average since the last Apache server start. + +```console +apache.bytes.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT in Bps | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[\"Total kBytes\"]"]` | +| MULTIPLIER | `["1024"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Apache: Get status + +![component: raw](https://img.shields.io/badge/component-raw-00c9bf) + +Getting data from a machine-readable version of the Apache status page. +For more information see Apache Module [mod_status](https://httpd.apache.org/docs/current/mod/mod_status.html). + +```console +apache.get_status +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | HTTP_AGENT | +| Value type | TEXT | +| History | 1h | + +### Item: Apache: Total requests + +![component: network](https://img.shields.io/badge/component-network-00c9bf) + +The total number of the Apache server accesses. + +```console +apache.requests +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[\"Total Accesses\"]"]` | + +### Item: Apache: Requests per second + +![component: network](https://img.shields.io/badge/component-network-00c9bf) + +It is calculated as a rate of change for the "Total requests" statistics. +`ReqPerSec` is not used, as it counts the average since the last Apache server start. + +```console +apache.requests.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$[\"Total Accesses\"]"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Apache: Uptime + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The service uptime expressed in seconds. + +```console +apache.uptime +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ServerUptimeSeconds"]` | + +### Item: Apache: Version + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The Apache service version. + +```console +apache.version +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | CHAR | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ServerVersion"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["1d"]` | + +### Item: Apache: Workers idle cleanup + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in cleanup state. + +```console +apache.workers.cleanup +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.cleanup"]` | + +### Item: Apache: Workers closing connection + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in closing state. + +```console +apache.workers.closing +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.closing"]` | + +### Item: Apache: Workers DNS lookup + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in `dnslookup` state. + +```console +apache.workers.dnslookup +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.dnslookup"]` | + +### Item: Apache: Workers finishing + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in finishing state. + +```console +apache.workers.finishing +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.finishing"]` | + +### Item: Apache: Workers keepalive (read) + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in `keepalive` state. + +```console +apache.workers.keepalive +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.keepalive"]` | + +### Item: Apache: Workers logging + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in logging state. + +```console +apache.workers.logging +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.logging"]` | + +### Item: Apache: Workers reading request + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in reading state. + +```console +apache.workers.reading +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.reading"]` | + +### Item: Apache: Workers sending reply + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in sending state. + +```console +apache.workers.sending +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.sending"]` | + +### Item: Apache: Workers slot with no current process + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of slots with no current process. + +```console +apache.workers.slot +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.slot"]` | + +### Item: Apache: Workers starting up + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in starting state. + +```console +apache.workers.starting +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.starting"]` | + +### Item: Apache: Workers waiting for connection + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of workers in waiting state. + +```console +apache.workers.waiting +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Workers.waiting"]` | + +### Item: Apache: Total workers busy + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The total number of busy worker threads/processes. + +```console +apache.workers_total.busy +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.BusyWorkers"]` | + +### Item: Apache: Total workers idle + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The total number of idle worker threads/processes. + +```console +apache.workers_total.idle +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.IdleWorkers"]` | + +### Item: Apache: Service response time + +![component: application](https://img.shields.io/badge/component-application-00c9bf) ![component: health](https://img.shields.io/badge/component-health-00c9bf) + + + +```console +net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | SIMPLE | +| Value type | FLOAT in s | +| History | 7d | + +### Item: Apache: Service ping + +![component: application](https://img.shields.io/badge/component-application-00c9bf) ![component: health](https://img.shields.io/badge/component-health-00c9bf) + + + +```console +net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | SIMPLE | +| History | 7d | + +## Triggers + +### Trigger: Apache: Failed to fetch status page + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + +Zabbix has not received any data for items for the last 30 minutes. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | WARNING | +| Manual close | YES | + +```console +nodata(/Apache by HTTP/apache.get_status,30m)=1 +``` + +### Trigger: Apache: Host has been restarted + +![scope: notice](https://img.shields.io/badge/scope-notice-00c9bf) + +Uptime is less than 10 minutes. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | INFO | +| Manual close | YES | + +```console +last(/Apache by HTTP/apache.uptime)<10m +``` + +### Trigger: Apache: Version has changed + +![scope: notice](https://img.shields.io/badge/scope-notice-00c9bf) + +Apache version has changed. Acknowledge to close the problem manually. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | INFO | +| Manual close | YES | + +```console +last(/Apache by HTTP/apache.version,#1)<>last(/Apache by HTTP/apache.version,#2) and length(last(/Apache by HTTP/apache.version))>0 +``` + +### Trigger: Apache: Service response time is too high + +![scope: performance](https://img.shields.io/badge/scope-performance-00c9bf) + + +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | WARNING | +| Manual close | YES | + +```console +min(/Apache by HTTP/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN} +``` + +### Trigger: Apache: Service is down + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + + +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | AVERAGE | +| Manual close | YES | + +```console +last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0 +``` + +## Discovery Rules + +### Discovery Rule: Event MPM discovery + +The discovery of additional metrics if the event Multi-Processing Module (MPM) is used. +For more details see [Apache MPM event](https://httpd.apache.org/docs/current/mod/event.html). + + +```console +apache.mpm.event.discovery +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JAVASCRIPT | `["return JSON.stringify(JSON.parse(value).ServerMPM === 'event'\n\t? [{'{#SINGLETON}': ''}] : []);\n"]` | +| DISCARD_UNCHANGED_HEARTBEAT | `["3h"]` | + +#### Discovery Rule: Event MPM discovery: Item Prototypes + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Bytes per request + +![component: connection](https://img.shields.io/badge/component-connection-00c9bf) + +The average number of client requests per second. + +```console +apache.bytes[per_request{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT in B | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.BytesPerReq"]` | + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Connections async closing + +![component: connection](https://img.shields.io/badge/component-connection-00c9bf) + +The number of asynchronous connections in closing state (applicable only to the event MPM). + +```console +apache.connections[async_closing{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ConnsAsyncClosing"]` | + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Connections async keepalive + +![component: connection](https://img.shields.io/badge/component-connection-00c9bf) + +The number of asynchronous connections in keepalive state (applicable only to the event MPM). + +```console +apache.connections[async_keep_alive{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ConnsAsyncKeepAlive"]` | + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Connections async writing + +![component: connection](https://img.shields.io/badge/component-connection-00c9bf) + +The number of asynchronous connections in writing state (applicable only to the event MPM). + +```console +apache.connections[async_writing{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ConnsAsyncWriting"]` | + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Connections total + +![component: connection](https://img.shields.io/badge/component-connection-00c9bf) + +The number of total connections. + +```console +apache.connections[total{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.ConnsTotal"]` | + +##### Discovery Rule: Event MPM discovery: Item Prototype: Apache: Number of async processes + +![component: system](https://img.shields.io/badge/component-system-00c9bf) + +The number of asynchronous processes. + +```console +apache.process[num{#SINGLETON}] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `apache.get_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JSONPATH | `["$.Processes"]` | + +#### Discovery Rule: Event MPM discovery: Graph Prototypes + +The following graph prototypes are defined by this Template + +* Apache: Current async connections{#SINGLETON} +* Apache: Current async processes{#SINGLETON} + + +## Macros + +The following Zabbix macros are configured via this template. + +### Macro: `{$APACHE.RESPONSE_TIME.MAX.WARN}` + +The maximum Apache response time expressed in seconds for a trigger expression. + +Default: + +```console +10 +``` + +### Macro: `{$APACHE.STATUS.HOST}` + +Hostname or IP of Apache HTTP server + +Default: + +```console +127.0.0.1 +``` + +### Macro: `{$APACHE.STATUS.PATH}` + +The URL path. + +Default: + +```console +server-status?auto +``` + +### Macro: `{$APACHE.STATUS.PORT}` + +The port of the Apache status page. + +Default: + +```console +80 +``` + +### Macro: `{$APACHE.STATUS.SCHEME}` + +The request scheme, which may be either HTTP or HTTPS. + +Default: + +```console +http +``` + +## Dashboards + +The following Zabbix dashboards are included in this template. + +* Apache performance diff --git a/Overrides/Apache_by_HTTP/6.4/docs/gen_ref_pages.py b/Overrides/Apache_by_HTTP/6.4/docs/gen_ref_pages.py new file mode 100644 index 00000000..bd02be1b --- /dev/null +++ b/Overrides/Apache_by_HTTP/6.4/docs/gen_ref_pages.py @@ -0,0 +1,6 @@ +from pathlib import Path + +import mkdocs_gen_files + +with mkdocs_gen_files.open("index.md", "w", encoding="utf-8") as index: + index.writelines(Path("README.md").open("r").read()) diff --git a/Overrides/Apache_by_HTTP/6.4/mkdocs.yaml b/Overrides/Apache_by_HTTP/6.4/mkdocs.yaml new file mode 100644 index 00000000..33f87391 --- /dev/null +++ b/Overrides/Apache_by_HTTP/6.4/mkdocs.yaml @@ -0,0 +1,17 @@ +site_name: "Zabbix Template: Apache by HTTP" +repo_url: https://github.com/radiorabe/rabe-zabbix +repo_name: radiorabe/rabe-zabbix +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences +plugins: + - search + - gen-files: + scripts: + - docs/gen_ref_pages.py + - literate-nav +nav: + - README: index.md diff --git a/Overrides/LICENSE b/Overrides/LICENSE new file mode 100644 index 00000000..c1002d5d --- /dev/null +++ b/Overrides/LICENSE @@ -0,0 +1,341 @@ + + 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 Library 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. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Overrides/Nginx_by_HTTP/6.4/DIFF.md b/Overrides/Nginx_by_HTTP/6.4/DIFF.md new file mode 100644 index 00000000..5775f094 --- /dev/null +++ b/Overrides/Nginx_by_HTTP/6.4/DIFF.md @@ -0,0 +1,106 @@ +# Compare Rabe Override with Upstream Template + +Original: [Nginx by HTTP](https://raw.githubusercontent.com/zabbix/zabbix/release/6.4/templates/app/nginx_http/template_app_nginx_http.yaml) + +## Diff + +```diff +--- before ++++ after +@@ -14,6 +14,13 @@ + You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx + + Generated by official Zabbix template tool "Templator" ++ ++ ## Changes ++ ++ These changes are part of [RaBe's Zabbix template and helpers ++ collection](https://github.com/radiorabe/rabe-zabbix). ++ ++ * Added `{$NGINX.STUB_STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + vendor: + name: Zabbix + version: 6.4-0 +@@ -23,7 +30,7 @@ + - uuid: 18c6209295b347e2a96ef11b147139d8 + name: 'Nginx: Service response time' + type: SIMPLE +- key: 'net.tcp.service.perf[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"]' ++ key: 'net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]' + history: 7d + value_type: FLOAT + units: s +@@ -34,21 +41,21 @@ + value: health + triggers: + - uuid: fc1f7927b8864996986c1da44df57279 +- expression: 'min(/Nginx by HTTP/net.tcp.service.perf[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN}' ++ expression: 'min(/Nginx by HTTP/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN}' + name: 'Nginx: Service response time is too high' + event_name: 'Nginx: Service response time is too high (over {$NGINX.RESPONSE_TIME.MAX.WARN}s for 5m)' + priority: WARNING + manual_close: 'YES' + dependencies: + - name: 'Nginx: Service is down' +- expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"])=0' ++ expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance + - uuid: e4a09193bc8f42f2888ece83f89f84af + name: 'Nginx: Service status' + type: SIMPLE +- key: 'net.tcp.service[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"]' ++ key: 'net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]' + history: 7d + valuemap: + name: 'Service state' +@@ -63,7 +70,7 @@ + value: health + triggers: + - uuid: 7b3de87ba0ea425280d42235bb626b8b +- expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"])=0' ++ expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + name: 'Nginx: Service is down' + priority: AVERAGE + manual_close: 'YES' +@@ -142,7 +149,7 @@ + description: 'The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes.' + dependencies: + - name: 'Nginx: Service is down' +- expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"])=0' ++ expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance +@@ -236,7 +243,7 @@ + `Waiting` - the current number of idle client connections waiting for a request. + + See also [Module ngx_http_stub_status_module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html). +- url: '{$NGINX.STUB_STATUS.SCHEME}://{HOST.CONN}:{$NGINX.STUB_STATUS.PORT}/{$NGINX.STUB_STATUS.PATH}' ++ url: '{$NGINX.STUB_STATUS.SCHEME}://{$NGINX.STUB_STATUS.HOST}:{$NGINX.STUB_STATUS.PORT}/{$NGINX.STUB_STATUS.PATH}' + retrieve_mode: BOTH + tags: + - tag: component +@@ -255,7 +262,7 @@ + manual_close: 'YES' + dependencies: + - name: 'Nginx: Service is down' +- expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{HOST.CONN}","{$NGINX.STUB_STATUS.PORT}"])=0' ++ expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: availability +@@ -341,6 +348,9 @@ + - macro: '{$NGINX.RESPONSE_TIME.MAX.WARN}' + value: '10' + description: 'The maximum response time of Nginx expressed in seconds for a trigger expression.' ++ - macro: '{$NGINX.STUB_STATUS.HOST}' ++ value: 127.0.0.1 ++ description: 'Hostname or IP of Nginx HTTP server' + - macro: '{$NGINX.STUB_STATUS.PATH}' + value: basic_status + description: 'The path of the `Nginx stub_status` page.' + + +``` diff --git a/Overrides/Nginx_by_HTTP/6.4/Nginx_by_HTTP.yaml b/Overrides/Nginx_by_HTTP/6.4/Nginx_by_HTTP.yaml new file mode 100644 index 00000000..59a68526 --- /dev/null +++ b/Overrides/Nginx_by_HTTP/6.4/Nginx_by_HTTP.yaml @@ -0,0 +1,453 @@ +zabbix_export: + version: '6.4' + template_groups: + - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 + name: Templates/Applications + templates: + - uuid: 13d5bb0a4ae84228bff408aab5be338e + template: 'Nginx by HTTP' + name: 'Nginx by HTTP' + description: | + Get metrics from stub status module using HTTP agent + https://nginx.ru/en/docs/http/ngx_http_stub_status_module.html. + + You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx + + Generated by official Zabbix template tool "Templator" + + ## Changes + + These changes are part of [RaBe's Zabbix template and helpers + collection](https://github.com/radiorabe/rabe-zabbix). + + * Added `{$NGINX.STUB_STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + vendor: + name: Zabbix + version: 6.4-0 + groups: + - name: Templates/Applications + items: + - uuid: 18c6209295b347e2a96ef11b147139d8 + name: 'Nginx: Service response time' + type: SIMPLE + key: 'net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]' + history: 7d + value_type: FLOAT + units: s + tags: + - tag: component + value: application + - tag: component + value: health + triggers: + - uuid: fc1f7927b8864996986c1da44df57279 + expression: 'min(/Nginx by HTTP/net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"],5m)>{$NGINX.RESPONSE_TIME.MAX.WARN}' + name: 'Nginx: Service response time is too high' + event_name: 'Nginx: Service response time is too high (over {$NGINX.RESPONSE_TIME.MAX.WARN}s for 5m)' + priority: WARNING + manual_close: 'YES' + dependencies: + - name: 'Nginx: Service is down' + expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance + - uuid: e4a09193bc8f42f2888ece83f89f84af + name: 'Nginx: Service status' + type: SIMPLE + key: 'net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"]' + history: 7d + valuemap: + name: 'Service state' + preprocessing: + - type: DISCARD_UNCHANGED_HEARTBEAT + parameters: + - 10m + tags: + - tag: component + value: application + - tag: component + value: health + triggers: + - uuid: 7b3de87ba0ea425280d42235bb626b8b + expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + name: 'Nginx: Service is down' + priority: AVERAGE + manual_close: 'YES' + tags: + - tag: scope + value: availability + - uuid: e054b58ebbbe4b45961ba697b468ab9e + name: 'Nginx: Connections accepted per second' + type: DEPENDENT + key: nginx.connections.accepted.rate + delay: '0' + history: 7d + value_type: FLOAT + description: 'The total number of accepted client connections.' + preprocessing: + - type: REGEX + parameters: + - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' + - \1 + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: 2e4b049ab60947d9a05165f67388e531 + name: 'Nginx: Connections active' + type: DEPENDENT + key: nginx.connections.active + delay: '0' + history: 7d + description: 'The current number of active client connections including waiting connections.' + preprocessing: + - type: REGEX + parameters: + - 'Active connections: ([0-9]+)' + - \1 + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: eecc0e887a744627be7f3b01cec6d46e + name: 'Nginx: Connections dropped per second' + type: DEPENDENT + key: nginx.connections.dropped.rate + delay: '0' + history: 7d + value_type: FLOAT + description: 'The total number of dropped client connections.' + preprocessing: + - type: JAVASCRIPT + parameters: + - | + var a = value.match(/server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)/) + if (a) { + return a[1]-a[2] + } + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + triggers: + - uuid: 79767fbc18594069a1fc0cbec832f8ff + expression: 'min(/Nginx by HTTP/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN}' + name: 'Nginx: High connections drop rate' + event_name: 'Nginx: High connections drop rate (more than {$NGINX.DROP_RATE.MAX.WARN} for 5m)' + opdata: 'Current rate: {ITEM.LASTVALUE1}' + priority: WARNING + description: 'The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes.' + dependencies: + - name: 'Nginx: Service is down' + expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: performance + - uuid: a53cf4f2d2ad4a84a70ff57df6299adc + name: 'Nginx: Connections handled per second' + type: DEPENDENT + key: nginx.connections.handled.rate + delay: '0' + history: 7d + value_type: FLOAT + description: 'The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the `worker_connections limit`).' + preprocessing: + - type: REGEX + parameters: + - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' + - \2 + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: 73493cbf8508419a8fed3abff8cc5851 + name: 'Nginx: Connections reading' + type: DEPENDENT + key: nginx.connections.reading + delay: '0' + history: 7d + description: 'The current number of connections where Nginx is reading the request header.' + preprocessing: + - type: REGEX + parameters: + - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)' + - \1 + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: cf393814511a48b498da8aab94d7ca00 + name: 'Nginx: Connections waiting' + type: DEPENDENT + key: nginx.connections.waiting + delay: '0' + history: 7d + description: 'The current number of idle client connections waiting for a request.' + preprocessing: + - type: REGEX + parameters: + - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)' + - \3 + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: b0d63efb16984042945fe42e192f7d4e + name: 'Nginx: Connections writing' + type: DEPENDENT + key: nginx.connections.writing + delay: '0' + history: 7d + description: 'The current number of connections where Nginx is writing a response back to the client.' + preprocessing: + - type: REGEX + parameters: + - 'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)' + - \2 + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: connections + - uuid: 86f93d1941d147fe94d754eddd3e8ff2 + name: 'Nginx: Get stub status page' + type: HTTP_AGENT + key: nginx.get_stub_status + history: 1h + trends: '0' + value_type: TEXT + description: | + The following status information is provided: + `Active connections` - the current number of active client connections including waiting connections. + `Accepted` - the total number of accepted client connections. + `Handled` - the total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the `worker_connections` limit). + `Requests` - the total number of client requests. + `Reading` - the current number of connections where Nginx is reading the request header. + `Writing` - the current number of connections where Nginx is writing a response back to the client. + `Waiting` - the current number of idle client connections waiting for a request. + + See also [Module ngx_http_stub_status_module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html). + url: '{$NGINX.STUB_STATUS.SCHEME}://{$NGINX.STUB_STATUS.HOST}:{$NGINX.STUB_STATUS.PORT}/{$NGINX.STUB_STATUS.PATH}' + retrieve_mode: BOTH + tags: + - tag: component + value: application + - tag: component + value: health + triggers: + - uuid: 78e0a6322a1941469a0e108a9367c420 + expression: | + find(/Nginx by HTTP/nginx.get_stub_status,,"iregexp","HTTP\/[\d.]+\s+200")=0 or + nodata(/Nginx by HTTP/nginx.get_stub_status,30m)=1 + name: 'Nginx: Failed to fetch stub status page' + event_name: 'Nginx: Failed to fetch stub status page (or no data for 30m)' + priority: WARNING + description: 'Zabbix has not received any data for items for the last 30 minutes.' + manual_close: 'YES' + dependencies: + - name: 'Nginx: Service is down' + expression: 'last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0' + tags: + - tag: scope + value: availability + - uuid: 071b3d77324740a59045be19da231d76 + name: 'Nginx: Requests total' + type: DEPENDENT + key: nginx.requests.total + delay: '0' + history: 7d + description: 'The total number of client requests.' + preprocessing: + - type: REGEX + parameters: + - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' + - \3 + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: requests + - uuid: 81b17056ec664f9f926a74ee390ab9c1 + name: 'Nginx: Requests per second' + type: DEPENDENT + key: nginx.requests.total.rate + delay: '0' + history: 7d + value_type: FLOAT + description: 'The total number of client requests.' + preprocessing: + - type: REGEX + parameters: + - 'server accepts handled requests\s+([0-9]+) ([0-9]+) ([0-9]+)' + - \3 + - type: CHANGE_PER_SECOND + parameters: + - '' + master_item: + key: nginx.get_stub_status + tags: + - tag: component + value: requests + - uuid: 716b627d6d894ac2af3ae8c4aeaa8c0c + name: 'Nginx: Version' + type: DEPENDENT + key: nginx.version + delay: '0' + history: 7d + trends: '0' + value_type: CHAR + preprocessing: + - type: REGEX + parameters: + - '(?i)Server: nginx\/(.+(?last(/Nginx by HTTP/nginx.version,#2) and length(last(/Nginx by HTTP/nginx.version))>0' + name: 'Nginx: Version has changed' + event_name: 'Nginx: Version has changed (new version: {ITEM.VALUE})' + priority: INFO + description: 'The Nginx version has changed. Acknowledge to close the problem manually.' + manual_close: 'YES' + tags: + - tag: scope + value: notice + tags: + - tag: class + value: software + - tag: target + value: nginx + macros: + - macro: '{$NGINX.DROP_RATE.MAX.WARN}' + value: '1' + description: 'The critical rate of the dropped connections for a trigger expression.' + - macro: '{$NGINX.RESPONSE_TIME.MAX.WARN}' + value: '10' + description: 'The maximum response time of Nginx expressed in seconds for a trigger expression.' + - macro: '{$NGINX.STUB_STATUS.HOST}' + value: 127.0.0.1 + description: 'Hostname or IP of Nginx HTTP server' + - macro: '{$NGINX.STUB_STATUS.PATH}' + value: basic_status + description: 'The path of the `Nginx stub_status` page.' + - macro: '{$NGINX.STUB_STATUS.PORT}' + value: '80' + description: 'The port of the `Nginx stub_status` host or container.' + - macro: '{$NGINX.STUB_STATUS.SCHEME}' + value: http + description: 'The protocol http or https of Nginx stub_status host or container.' + dashboards: + - uuid: 7d0bf76f09204bb7ba9ee995bf161d46 + name: 'Nginx performance' + pages: + - widgets: + - type: graph + width: '12' + height: '5' + fields: + - type: GRAPH + name: graphid + value: + host: 'Nginx by HTTP' + name: 'Nginx: Connections by state' + - type: graph + 'y': '5' + width: '12' + height: '5' + fields: + - type: GRAPH + name: graphid + value: + host: 'Nginx by HTTP' + name: 'Nginx: Connections per second' + - type: graph + x: '12' + width: '12' + height: '5' + fields: + - type: GRAPH + name: graphid + value: + host: 'Nginx by HTTP' + name: 'Nginx: Requests per second' + valuemaps: + - uuid: 5c0883d194e8494498474106c22be2ca + name: 'Service state' + mappings: + - value: '0' + newvalue: Down + - value: '1' + newvalue: Up + graphs: + - uuid: aedcbacee74f4b0c861546c56e0fa9ab + name: 'Nginx: Connections by state' + graph_items: + - drawtype: BOLD_LINE + color: 199C0D + item: + host: 'Nginx by HTTP' + key: nginx.connections.active + - sortorder: '1' + color: F63100 + item: + host: 'Nginx by HTTP' + key: nginx.connections.waiting + - sortorder: '2' + color: 00611C + item: + host: 'Nginx by HTTP' + key: nginx.connections.writing + - sortorder: '3' + color: F7941D + item: + host: 'Nginx by HTTP' + key: nginx.connections.reading + - uuid: 6feb26e5eb3246c0adb8d151b1443859 + name: 'Nginx: Connections per second' + graph_items: + - color: 199C0D + item: + host: 'Nginx by HTTP' + key: nginx.connections.accepted.rate + - sortorder: '1' + color: F63100 + item: + host: 'Nginx by HTTP' + key: nginx.connections.handled.rate + - sortorder: '2' + color: 00611C + item: + host: 'Nginx by HTTP' + key: nginx.connections.dropped.rate + - uuid: 43a87936b35d4d28a658f810c2162a72 + name: 'Nginx: Requests per second' + graph_items: + - drawtype: GRADIENT_LINE + color: 199C0D + item: + host: 'Nginx by HTTP' + key: nginx.requests.total.rate diff --git a/Overrides/Nginx_by_HTTP/6.4/README.md b/Overrides/Nginx_by_HTTP/6.4/README.md new file mode 100644 index 00000000..8f767149 --- /dev/null +++ b/Overrides/Nginx_by_HTTP/6.4/README.md @@ -0,0 +1,484 @@ +# Zabbix Template: Nginx by HTTP + +![class: software](https://img.shields.io/badge/class-software-00c9bf) ![target: nginx](https://img.shields.io/badge/target-nginx-00c9bf) ![vendor: Zabbix](https://img.shields.io/badge/vendor-Zabbix-00c9bf) ![version: 6.4-0](https://img.shields.io/badge/version-6.4--0-00c9bf) + +Get metrics from stub status module using HTTP agent +https://nginx.ru/en/docs/http/ngx_http_stub_status_module.html. + +You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384765-discussion-thread-for-official-zabbix-template-nginx + +Generated by official Zabbix template tool "Templator" + +## Changes + +These changes are part of [RaBe's Zabbix template and helpers +collection](https://github.com/radiorabe/rabe-zabbix). + +* Added `{$NGINX.STUB_STATUS.HOST}` instead of `{HOST.NAME}` for agentless use + +## Items + +### Item: Nginx: Service response time + +![component: application](https://img.shields.io/badge/component-application-00c9bf) ![component: health](https://img.shields.io/badge/component-health-00c9bf) + + + +```console +net.tcp.service.perf[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | SIMPLE | +| Value type | FLOAT in s | +| History | 7d | + +### Item: Nginx: Service status + +![component: application](https://img.shields.io/badge/component-application-00c9bf) ![component: health](https://img.shields.io/badge/component-health-00c9bf) + + + +```console +net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"] +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | SIMPLE | +| History | 7d | + +### Item: Nginx: Connections accepted per second + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The total number of accepted client connections. + +```console +nginx.connections.accepted.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["server accepts handled requests\\s+([0-9]+) ([0-9]+) ([0-9]+)", "\\1"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Nginx: Connections active + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The current number of active client connections including waiting connections. + +```console +nginx.connections.active +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["Active connections: ([0-9]+)", "\\1"]` | + +### Item: Nginx: Connections dropped per second + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The total number of dropped client connections. + +```console +nginx.connections.dropped.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| JAVASCRIPT | `["var a = value.match(/server accepts handled requests\\s+([0-9]+) ([0-9]+) ([0-9]+)/)\nif (a) {\n\treturn a[1]-a[2]\n}\n"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Nginx: Connections handled per second + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the `worker_connections limit`). + +```console +nginx.connections.handled.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["server accepts handled requests\\s+([0-9]+) ([0-9]+) ([0-9]+)", "\\2"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Nginx: Connections reading + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The current number of connections where Nginx is reading the request header. + +```console +nginx.connections.reading +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)", "\\1"]` | + +### Item: Nginx: Connections waiting + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The current number of idle client connections waiting for a request. + +```console +nginx.connections.waiting +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)", "\\3"]` | + +### Item: Nginx: Connections writing + +![component: connections](https://img.shields.io/badge/component-connections-00c9bf) + +The current number of connections where Nginx is writing a response back to the client. + +```console +nginx.connections.writing +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)", "\\2"]` | + +### Item: Nginx: Get stub status page + +![component: application](https://img.shields.io/badge/component-application-00c9bf) ![component: health](https://img.shields.io/badge/component-health-00c9bf) + +The following status information is provided: +`Active connections` - the current number of active client connections including waiting connections. +`Accepted` - the total number of accepted client connections. +`Handled` - the total number of handled connections. Generally, the parameter value is the same as for the accepted connections, unless some resource limits have been reached (for example, the `worker_connections` limit). +`Requests` - the total number of client requests. +`Reading` - the current number of connections where Nginx is reading the request header. +`Writing` - the current number of connections where Nginx is writing a response back to the client. +`Waiting` - the current number of idle client connections waiting for a request. + +See also [Module ngx_http_stub_status_module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html). + +```console +nginx.get_stub_status +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | HTTP_AGENT | +| Value type | TEXT | +| History | 1h | + +### Item: Nginx: Requests total + +![component: requests](https://img.shields.io/badge/component-requests-00c9bf) + +The total number of client requests. + +```console +nginx.requests.total +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["server accepts handled requests\\s+([0-9]+) ([0-9]+) ([0-9]+)", "\\3"]` | + +### Item: Nginx: Requests per second + +![component: requests](https://img.shields.io/badge/component-requests-00c9bf) + +The total number of client requests. + +```console +nginx.requests.total.rate +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | FLOAT | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["server accepts handled requests\\s+([0-9]+) ([0-9]+) ([0-9]+)", "\\3"]` | +| CHANGE_PER_SECOND | `[""]` | + +### Item: Nginx: Version + +![component: application](https://img.shields.io/badge/component-application-00c9bf) + + + +```console +nginx.version +``` + +Settings: + +| Item Setting | Value | +| ------------ | ----- | +| Type | DEPENDENT | +| Value type | CHAR | +| History | 7d | +| Source item | `nginx.get_stub_status` | + +Preprocessing steps: + +| Type | Parameters | +| ---- | ---------- | +| REGEX | `["(?i)Server: nginx\\/(.+(?{$NGINX.RESPONSE_TIME.MAX.WARN} +``` + +### Trigger: Nginx: Service is down + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + + +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | AVERAGE | +| Manual close | YES | + +```console +last(/Nginx by HTTP/net.tcp.service[http,"{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.PORT}"])=0 +``` + +### Trigger: Nginx: High connections drop rate + +![scope: performance](https://img.shields.io/badge/scope-performance-00c9bf) + +The rate of dropping connections has been greater than {$NGINX.DROP_RATE.MAX.WARN} for the last 5 minutes. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | WARNING | + +```console +min(/Nginx by HTTP/nginx.connections.dropped.rate,5m) > {$NGINX.DROP_RATE.MAX.WARN} +``` + +### Trigger: Nginx: Failed to fetch stub status page + +![scope: availability](https://img.shields.io/badge/scope-availability-00c9bf) + +Zabbix has not received any data for items for the last 30 minutes. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | WARNING | +| Manual close | YES | + +```console +find(/Nginx by HTTP/nginx.get_stub_status,,"iregexp","HTTP\/[\d.]+\s+200")=0 or +nodata(/Nginx by HTTP/nginx.get_stub_status,30m)=1 + +``` + +### Trigger: Nginx: Version has changed + +![scope: notice](https://img.shields.io/badge/scope-notice-00c9bf) + +The Nginx version has changed. Acknowledge to close the problem manually. +Settings: + +| Trigger Setting | Values | +| --------------- | ------ | +| Priority | INFO | +| Manual close | YES | + +```console +last(/Nginx by HTTP/nginx.version,#1)<>last(/Nginx by HTTP/nginx.version,#2) and length(last(/Nginx by HTTP/nginx.version))>0 +``` + +## Macros + +The following Zabbix macros are configured via this template. + +### Macro: `{$NGINX.DROP_RATE.MAX.WARN}` + +The critical rate of the dropped connections for a trigger expression. + +Default: + +```console +1 +``` + +### Macro: `{$NGINX.RESPONSE_TIME.MAX.WARN}` + +The maximum response time of Nginx expressed in seconds for a trigger expression. + +Default: + +```console +10 +``` + +### Macro: `{$NGINX.STUB_STATUS.HOST}` + +Hostname or IP of Nginx HTTP server + +Default: + +```console +127.0.0.1 +``` + +### Macro: `{$NGINX.STUB_STATUS.PATH}` + +The path of the `Nginx stub_status` page. + +Default: + +```console +basic_status +``` + +### Macro: `{$NGINX.STUB_STATUS.PORT}` + +The port of the `Nginx stub_status` host or container. + +Default: + +```console +80 +``` + +### Macro: `{$NGINX.STUB_STATUS.SCHEME}` + +The protocol http or https of Nginx stub_status host or container. + +Default: + +```console +http +``` + +## Dashboards + +The following Zabbix dashboards are included in this template. + +* Nginx performance diff --git a/Overrides/Nginx_by_HTTP/6.4/docs/gen_ref_pages.py b/Overrides/Nginx_by_HTTP/6.4/docs/gen_ref_pages.py new file mode 100644 index 00000000..bd02be1b --- /dev/null +++ b/Overrides/Nginx_by_HTTP/6.4/docs/gen_ref_pages.py @@ -0,0 +1,6 @@ +from pathlib import Path + +import mkdocs_gen_files + +with mkdocs_gen_files.open("index.md", "w", encoding="utf-8") as index: + index.writelines(Path("README.md").open("r").read()) diff --git a/Overrides/Nginx_by_HTTP/6.4/mkdocs.yaml b/Overrides/Nginx_by_HTTP/6.4/mkdocs.yaml new file mode 100644 index 00000000..b64b72e4 --- /dev/null +++ b/Overrides/Nginx_by_HTTP/6.4/mkdocs.yaml @@ -0,0 +1,17 @@ +site_name: "Zabbix Template: Nginx by HTTP" +repo_url: https://github.com/radiorabe/rabe-zabbix +repo_name: radiorabe/rabe-zabbix +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences +plugins: + - search + - gen-files: + scripts: + - docs/gen_ref_pages.py + - literate-nav +nav: + - README: index.md diff --git a/README.md b/README.md index dd33730d..24e479ba 100644 --- a/README.md +++ b/README.md @@ -1,541 +1,189 @@ # rabe-zabbix -Collection of various [Zabbix](http://www.zabbix.com/) templates and helper scripts created or used by [Radio Bern RaBe](http://rabe.ch/). - -## Zabbix Templates -The Zabbix templates are located within the [templates](templates) subfolder and are further subdived into the following categories: -* [Operating system (os)](os): All operating system specific templates - * Naming convention: Template_OS_\_active - * Example: Template_OS_Linux_active -* [Application (app)](app): All application specifc templates - * Naming convention: Template_App_\[\_active - * Example: Template_App_Linux_Postfix_active -* [IPMI (ipmi)](ipmi): All IPMI based templates - * Naming convention: Template_IPMI_\ - * Example: Template_IPMI_Threshold_Sensors -* [SNMP (snmp)](snmp): All SNMP based templates - * Naming convention: Template_SNMP\_\ - * Example: Template_SNMPv2_Interfaces_HC -* [Stack (stack)](stack): Stack templates define a single system (or role) and might inherit further stack templates, or exactly one operating system template as well as multiple application or SNMP templates. - * Naming convention: Template_Stack_\_active - * Example: Template_Stack_MediaWiki_active - -### Stack templates explained -Every host within Zabbix gets a specifc stack template assigned according to its role. The stack exactly defines the setup of this host and will be re-used if there is more than one host with the same role. - -As an example, a host which servers a MediaWiki instance, will get the stack template Template_Stack_MediaWiki_active assigned. The stack template might include the operating system template Template_OS_Linux_active, the application templates Template_App_Linux_Apache_HTTPD_active, Template_App_Linux_PHP-FPM_active and Template_App_Linux_MariaDB_active. - -This ensures great modularity, reusability and avoids unecessary inheritance problems. - -### Further template conventions -* Use active mode for zabbix agent items by default -* Use an update interval of 300 seconds (5 minutes) by default -* Create at least one unique application per app, ipmi and snmp template -* Use macros whenever possible and feasible, prefix them with a unique per template prefix - -### App specific conventions - -* Apps may contain configuration snippets in a `userparameters/` subdir. -* SELinux policy modules for an app are in the `selinux/` subdir. They are prefixed with "rabezbx" to help differentiate them from system policy. - -### IPMI specific conventions -* Name server or motherboard templates according to `IPMI - `, for example `Template IPMI Supermicro SSG-6048R-E1CR24N` -* Try to build up a server or motherboard template from existing (or newly - created) standalone sensor templates (which can be reused for the same sensor - and reading type). -* Standalone sensor templates which contain sensor-specific discrete IPMI - sensors (event/reading type code 6Fh) - * Template naming according to `IPMI Sensors`, for example - `IPMI Power Supply Sensors` - * Item key naming according to - `ipmi.discrete-sensor[,]`, for example - `ipmi.discrete-sensor[power-supply,{#IPMI_SENSOR_NAME}]` - * Create triggers according to the sensor's specific event/reading type code - and offsets (see [Table 42-3, Sensor Type - Codes](http://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/second-gen-interface-spec-v2.pdf)) - with the help of the Zabbix [band() - function](https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions) -* Standalone sensor templates which contain generic discrete IPMI sensors - (event/reading type code 02h - 0Ch) - * Template naming according to `IPMI Generic Sensors`, for - example `IPMI Module Board Generic Sensors` - * Item key naming according to - `ipmi.discrete-generic-sensor[,]`, for example - `ipmi.discrete-generic-sensor[module-board,{#IPMI_SENSOR_NAME}]` - * Create triggers according to the sensor's generic event/reading type code - and offsets (see [Table 42-2, Generic Event/Reading Type - Codes](http://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/second-gen-interface-spec-v2.pdf)) - with the help of the Zabbix [band() - function](https://www.zabbix.com/documentation/3.0/manual/appendix/triggers/functions) -* Use the provided `ipmi-sensor-discovery.sh` external check script for - low-level auto-discovery of multiple sensors. -* FreeIPMI's [interpret sensor - configuration](http://git.savannah.gnu.org/cgit/freeipmi.git/tree/etc/freeipmi_interpret_sensor.conf) - might be helpful for mapping sensor states to Zabbix trigger severities. -* There should be no more need for threshold based sensor templates - (event/reading type code 01h), as they are already handled by the `IPMI - Threshold Sensors` template. - -### SNMP specific conventions -* Name SNMP templates according to `Template SNMPv `, for example - `Template SNMPv2 Bridge` -* Try to reflect the MIBs name within `` whenever feasible -* Use the textual form of MIB OIDs within your SNMP items. - As an example, use `BRIDGE-MIB::dot1dBaseNumPorts.0` instead of - `.1.3.6.1.2.1.17.1.2.0` -* Include instructions on how to obtain and install the required MIBs for your - template. -* Name items according to `rabe.snmp..` to avoid clashes with - other templates. - Example: `rabe.snmp.bridge.dot1dBaseNumPorts` -* Name low-level discovery rule keys with `rabe.snmp...discovery` - Example: `rabe.snmp-bridge.ports.discovery` -* Create value mappings according to the OID's syntax definition from the MIB. - -## Developing - -### Adding an app template - -```bash -appName="" # app name -appURL="" # URL to the upstream project/software - -lowercaseName="${appName,,}" -uppercaseName="${appName^^}" - -shortName="${lowercaseName//-/}" - -templateName="Template App ${appName} active" -xmlName="${templateName// /_}.xml" - -appDir="app/${appName// /_}" - -gitBranchName="feature/app-${lowercaseName// /-}" - - -git checkout -b "${gitBranchName}" -mkdir -p "${appDir}/doc" - -# Generate a minimal documentation -cat > "${appDir}/doc/README.head.md" << EOF -Monitoring of [${appName}]($appURL). -EOF - -# Extend the documentation as necessary -vi "${appDir}/doc/README.head.md" - -# Commit the documentation -git add "${appDir}/doc/README.head.md" -git commit -m "${appName}: Added documentation" - - -# Export the Zabbix template and move it to the final destination -# see fetching below if you want help exporting -mv zbx_export_templates.xml "${appDir}/${xmlName}" - -# Commit the Zabbix template -git add "${appDir}/${xmlName}" -git commit -m "${appName}: Added ${templateName}" -``` - -#### Fetching an app from the Zabbix server -Fetching a template into a file from the server is straightforward. - -```bash -./helper/rabe-zabbix --template=${templateName} ${xmlName} -``` - -You need to have a working node environment and install any dependencies beforehand. - -```bash -npm install -``` -The helper will prompt for settings should they not be configured. Please see its `--help` for more information. +Collection of various [Zabbix](http://www.zabbix.com/) templates and +helper scripts created or used by [Radio Bern RaBe](http://rabe.ch/). + +See below for an overview of our templates. We group our templates +similar to how Zabbix-out-of-the-box templates are grouped. + +## Stacks + +Every host within Zabbix gets a specific stack template assigned according +to its role. The stack exactly defines the setup of this host and will be +re-used if there is more than one host with the same role. + +As an example, a host which servers a MediaWiki instance, will get the +stack template `MediaWiki Stack` assigned. The stack template +might include the operating system template `EL9 Stack`, the +application templates `Apache by HTTP`, `PHP-FPM by HTTP` +and `MariaDB by agent 2`. + +This ensures great modularity, reusability and avoids unecessary +inheritance problems. + +### Stacks: Applications + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| Apache with TLS by HTTP Stack | | [✅](./Stacks/Applications/Apache_with_TLS_by_HTTP_Stack/6.4) | | +| Nginx with TLS by HTTP Stack | | [✅](./Stacks/Applications/Nginx_with_TLS_by_HTTP_Stack/6.4) | | +| Songticker Stack | | [✅](./Stacks/Applications/Songticker_Stack/6.4) | | +| systemd Stack | | [✅](./Stacks/Applications/systemd_Stack/6.4) | | + +### Stacks: Network devices + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| Netgear GS108Tv2 SNMPv2 | [✅](./Stacks/Network_devices/Netgear_GS108Tv2_SNMPv2/3.0) | | | +| Netgear M5300 Series SNMPv2 | [✅](./Stacks/Network_devices/Netgear_M5300_Series_SNMPv2/3.0) | | | + +### Stacks: Operating systems + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| EL7 Stack | | [✅](./Stacks/Operating_systems/EL7_Stack/6.4) | | +| EL8 Stack | | [✅](./Stacks/Operating_systems/EL8_Stack/6.4) | | +| EL9 Stack | | [✅](./Stacks/Operating_systems/EL9_Stack/6.4) | | + +### Stacks: Servers + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| EL7 KVM VM Stack | | [✅](./Stacks/Servers/EL7_KVM_VM_Stack/6.4) | | +| EL8 KVM VM Stack | | [✅](./Stacks/Servers/EL8_KVM_VM_Stack/6.4) | | +| EL9 KVM VM Stack | | [✅](./Stacks/Servers/EL9_KVM_VM_Stack/6.4) | | + +## Templates + +### Templates: Applications + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| Alarm Pinger | [✅](./Templates/Applications/Alarm_Pinger/3.0) | | | +| Apache HTTP Server | [✅](./Templates/Applications/Apache_HTTP_Server/3.0) | | | +| auditd | [✅](./Templates/Applications/auditd/3.0) | [✅](./Templates/Applications/auditd/6.4) | | +| Axia ALSA Soundcard Driver for Livewire | [✅](./Templates/Applications/Axia_ALSA_Soundcard_Driver_for_Livewire/3.0) | | | +| BSNMP | [✅](./Templates/Applications/BSNMP/3.0) | | | +| candlepin-rhsmcertd | | [✅](./Templates/Applications/candlepin-rhsmcertd/6.4) | | +| CARP | [✅](./Templates/Applications/CARP/3.0) | | | +| certmonger | | [✅](./Templates/Applications/certmonger/6.4) | | +| chrony | [✅](./Templates/Applications/chrony/3.0) | [✅](./Templates/Applications/chrony/6.4) | | +| Cronie | [✅](./Templates/Applications/Cronie/3.0) | [✅](./Templates/Applications/Cronie/6.4) | | +| Darkice | [✅](./Templates/Applications/Darkice/3.0) | | | +| dpinger | [✅](./Templates/Applications/dpinger/3.0) | | | +| firewalld | | [✅](./Templates/Applications/firewalld/6.4) | | +| GlusterFS Client | [✅](./Templates/Applications/GlusterFS_Client/3.0) | | | +| GlusterFS Server | [✅](./Templates/Applications/GlusterFS_Server/3.0) | | | +| gssproxy | [✅](./Templates/Applications/gssproxy/3.0) | [✅](./Templates/Applications/gssproxy/6.4) | | +| Icecast | [✅](./Templates/Applications/Icecast/3.0) | | | +| ISC DHCP daemon | [✅](./Templates/Applications/ISC_DHCP_daemon/3.0) | | | +| ISC DHCP Relay Agent | [✅](./Templates/Applications/ISC_DHCP_Relay_Agent/3.0) | | | +| JACK Audio Connection Kit sound server | [✅](./Templates/Applications/JACK_Audio_Connection_Kit_sound_server/3.0) | | | +| Journalbeat | [✅](./Templates/Applications/Journalbeat/3.0) | | | +| libvirtd | [✅](./Templates/Applications/libvirtd/3.0) | | | +| lighttpd | [✅](./Templates/Applications/lighttpd/3.0) | | | +| LVM | [✅](./Templates/Applications/LVM/3.0) | | | +| MD-RAID | [✅](./Templates/Applications/MD-RAID/3.0) | | | +| ntpd | [✅](./Templates/Applications/ntpd/3.0) | | | +| qemu-ga | | [✅](./Templates/Applications/qemu-ga/6.4) | | +| Rotter | [✅](./Templates/Applications/Rotter/3.0) | | | +| rpc.gssd | | [✅](./Templates/Applications/rpc.gssd/6.4) | | +| rsyslog | | [✅](./Templates/Applications/rsyslog/6.4) | | +| Songticker | | [✅](./Templates/Applications/Songticker/6.4) | | +| sssd | | [✅](./Templates/Applications/sssd/6.4) | | +| systemd-journald | | [✅](./Templates/Applications/systemd-journald/6.4) | | +| systemd-logind | | [✅](./Templates/Applications/systemd-logind/6.4) | | +| systemd-udevd | | [✅](./Templates/Applications/systemd-udevd/6.4) | | +| timedatectl | [✅](./Templates/Applications/timedatectl/3.0) | [✅](./Templates/Applications/timedatectl/6.4) | | +| tuned | | [✅](./Templates/Applications/tuned/6.4) | | +| zabbix-agent | [✅](./Templates/Applications/zabbix-agent/3.0) | | | +| Zabbix unsupported items | | [✅](./Templates/Applications/Zabbix_unsupported_items/6.4) | | + +### Templates: Network devices + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| SNMPv2 AVT AE1 DABPlus Go | [✅](./Templates/Network_devices/SNMPv2_AVT_AE1_DABPlus_Go/3.0) | | | +| SNMPv2 Generic | [✅](./Templates/Network_devices/SNMPv2_Generic/3.0) | | | +| SNMPv2 Interfaces HC | [✅](./Templates/Network_devices/SNMPv2_Interfaces_HC/3.0) | | | +| SNMPv2 Livewire | [✅](./Templates/Network_devices/SNMPv2_Livewire/3.0) | | | +| SNMPv2 Netgear Box Services | [✅](./Templates/Network_devices/SNMPv2_Netgear_Box_Services/3.0) | | | +| SNMPv2 Netgear Inventory | [✅](./Templates/Network_devices/SNMPv2_Netgear_Inventory/3.0) | | | +| SNMPv2 Netgear SNTP client | [✅](./Templates/Network_devices/SNMPv2_Netgear_SNTP_client/3.0) | | | +| SNMPv2 Netgear Switching | [✅](./Templates/Network_devices/SNMPv2_Netgear_Switching/3.0) | | | +| SNMPv2 UBNT-UniFi-MIB | [✅](./Templates/Network_devices/SNMPv2_UBNT-UniFi-MIB/3.0) | | | +| SNMPv2 UCD-SNMP-MIB load average | [✅](./Templates/Network_devices/SNMPv2_UCD-SNMP-MIB_load_average/3.0) | | | +| SNMPv2 UCD-SNMP-MIB memory | [✅](./Templates/Network_devices/SNMPv2_UCD-SNMP-MIB_memory/3.0) | | | + +### Templates: Operating systems + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| FreeBSD | [✅](./Templates/Operating_systems/FreeBSD/3.0) | | | +| Linux | [✅](./Templates/Operating_systems/Linux/3.0) | | | + +### Templates: Server hardware + +| Name | 3.0 | 6.4 | 7.0 | +| ---- | --- | --- | --- | +| Drive Slot Sensors | [✅](./Templates/Server_hardware/Drive_Slot_Sensors/3.0) | | | +| Module Board Generic Sensors | [✅](./Templates/Server_hardware/Module_Board_Generic_Sensors/3.0) | | | +| Power Supply Generic Sensors | [✅](./Templates/Server_hardware/Power_Supply_Generic_Sensors/3.0) | | | +| Power Supply Sensors | [✅](./Templates/Server_hardware/Power_Supply_Sensors/3.0) | | | +| Sensor Discovery | [✅](./Templates/Server_hardware/Sensor_Discovery/3.0) | | | +| Supermicro SSG-6048R-E1CR24N | [✅](./Templates/Server_hardware/Supermicro_SSG-6048R-E1CR24N/3.0) | | | +| Supermicro X7DWU | [✅](./Templates/Server_hardware/Supermicro_X7DWU/3.0) | | | +| Threshold Sensors | [✅](./Templates/Server_hardware/Threshold_Sensors/3.0) | | | + +## Overrides + +In some cases we override the Zabbix out-of-the-box templates to +ensure they fit our use case. We publish the changed templates along +with a generated diff against its upstream version. + +| Name | 6.4 | 7.0 | +| ---- | --- | --- | +| Apache by HTTP | [✅](./Overrides/Apache_by_HTTP/6.4) | | +| Nginx by HTTP | [✅](./Overrides/Nginx_by_HTTP/6.4) | | + +## Zabbix Version Support + +We primarily support versions of Zabbix we use in production. + +| Version | Supported | Description | +| ------- | --------- | ----------- | +| 3.0 | ✅ | legacy RaBe environment | +| 6.4 | ✅ | for LTS preparation work until 7.0 is available | +| 7.0 | ✅ | once released | + +## OS Version Support + +Our Zabbix 3.0 template mainly template EL7 installations based on CentOS 7. +The 6.4+ templates aim to support both EL7 as well as EL9, with EL7 on +a best effort case (e.g. we don't workaround the lack of `timedatectl show` +on old distros, their timedatectl stays unmonitored). + +## Contributing + +See [CONTRIBUTING.md](./CONTRIBUTING.md) if you want to contribute fixes or templates. + +## Previous Versions + +If you are looking for the documentation and tooling of the Zabbix 3.0 only +version of this repo, you may find them in [5d2dfb7](https://github.com/radiorabe/rabe-zabbix/tree/5d2dfb7d91cf84cb4b314f2a3c2b6dd69224cf20). -#### optional usage section override -```bash -cat > "${appDir}/doc/README.Usage.md" << EOF -## Usage -1. Import the - [\`${xmlName}\`](${xmlName}) - into your Zabbix server (click on the \`Raw\` button to download). -2. Add the template to your host (or stack template) -3. Check if new data arrives -EOF - -vi "${appDir}/doc/README.Usage.md" - -git add "${appDir}/doc/README.Usage.md" -git commit -m "${appName}: Added usage section" -``` - - -#### optional selinux policy -```bash -$avcViolation="" # multiple lines from /var/log/audit/audit.log - -moduleName="rabezbx${shortName// /}" - -mkdir "${appDir}/selinux" - -echo ${avcViolation} | audit2allow -m ${moduleName} > \ - "${appDir}/selinux/${moduleName}.te" - -cat > "${appDir}/doc/README.SELinux.md" <. -EOD - - -# Commit the SELinux policy and documentation -git add "${appDir}/selinux/${moduleName}.te" -git add "${appDir}/doc/README.SELinux.md" -git commit -e -m "${appName}: Added SELinux module and documentation" -``` - -#### optional userparameters -```bash -mkdir "${appDir}/userparameters" - -userParameterName="rabe.${lowercaseName// /-}" - -cat > "${appDir}/userparameters/${userParameterName}.conf" <,