{"id":20811296,"url":"https://github.com/express42/zabbix_lwrp","last_synced_at":"2025-05-07T09:26:08.357Z","repository":{"id":29662411,"uuid":"33204484","full_name":"express42/zabbix_lwrp","owner":"express42","description":"Express 42 zabbix cookbook","archived":false,"fork":false,"pushed_at":"2020-02-19T14:33:25.000Z","size":1214,"stargazers_count":13,"open_issues_count":13,"forks_count":20,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-31T08:38:52.747Z","etag":null,"topics":["chef","cookbooks","iac","zabbix"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/express42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T19:11:42.000Z","updated_at":"2024-05-11T21:17:23.000Z","dependencies_parsed_at":"2022-09-03T18:40:09.595Z","dependency_job_id":null,"html_url":"https://github.com/express42/zabbix_lwrp","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fzabbix_lwrp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fzabbix_lwrp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fzabbix_lwrp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express42%2Fzabbix_lwrp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/express42","download_url":"https://codeload.github.com/express42/zabbix_lwrp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252849602,"owners_count":21813827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","cookbooks","iac","zabbix"],"created_at":"2024-11-17T20:39:56.530Z","updated_at":"2025-05-07T09:26:08.333Z","avatar_url":"https://github.com/express42.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Chef cookbook](https://img.shields.io/cookbook/v/zabbix_lwrp.svg)](https://github.com/express42/zabbix_lwrp)\n\n[![Code Climate](https://codeclimate.com/github/express42/zabbix_lwrp/badges/gpa.svg)](https://codeclimate.com/github/express42/zabbix_lwrp)\n[![Build Status](https://travis-ci.org/express42/zabbix_lwrp.svg?branch=master)](https://travis-ci.org/express42/zabbix_lwrp)\n\n# Description\n\n[![Join the chat at https://gitter.im/express42/zabbix_lwrp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/express42/zabbix_lwrp?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nInstalls and configures Zabbix agent and server with PostgreSQL/MySQL and Nginx. Provides LWRP for creating and modifying Zabbix objects.\n\n# Requirements\n\n## Platform:\n\n* ubuntu\n* centos\n* windows\n\n## Cookbooks:\n\n* apt\n* build-essential\n* chef_nginx\n* chocolatey\n* database\n* lvm\n* php-fpm\n* postgresql\n* mysql2_chef_gem\n* mysql\n* yum-mysql-community\n* mysql2_chef_gem\n* windows_firewall\n\n# Attributes\n\n## Agent\n* `node['zabbix']['agent']['windows']['installer']` - 'chocolatey' or 'bin'(zabbix binaries). Defaults to `chocolatey`.\n* `node['zabbix']['agent']['windows']['version']` -  Defaults to `3.2.0`.\n* `node['zabbix']['agent']['windows']['chocolatey']['repo']` -  Defaults to `https://chocolatey.org/api/v2`.\n* `node['zabbix']['agent']['windows']['path']` -  Defaults to `C:\\ProgramData\\zabbix`.\n* `node['zabbix']['agent']['scripts']` -  Defaults to `case node['platform']`.\n* `node['zabbix']['agent']['include']` -  Defaults to `case node['platform']`.\n* `node['zabbix']['agent']['config']['listen_ip']` -  Defaults to `0.0.0.0`.\n* `node['zabbix']['agent']['config']['listen_port']` -  Defaults to `10050`.\n* `node['zabbix']['agent']['config']['serverhost']` -  Defaults to `localhost`.\n* `node['zabbix']['agent']['config']['hostname']` -  Defaults to `node['fqdn']`.\n* `node['zabbix']['agent']['config']['pidfile']` -  Defaults to `/var/run/zabbix/zabbix_agentd.pid`.\n* `node['zabbix']['agent']['config']['logs']` -  Defaults to `{ ... }`.\n* `node['zabbix']['agent']['config']['global']` -  Defaults to `{ ... }`.\n* `node['zabbix']['agent']['config']['user_params']` -  Defaults to `{ ... }`.\n\n## Postgresql\n* `node['zabbix']['version']` -  Defaults to `3.2`.\n* `node['zabbix']['api-version']` -  Defaults to `3.1.0`.\n* `node['zabbix']['host']['group']` -  Defaults to `Hosts`.\n* `node['zabbix']['host']['name']` -  Defaults to `node['fqdn']`.\n* `node['zabbix']['host']['dns']` -  Defaults to `node['fqdn']`.\n* `node['zabbix']['host']['ipaddress']` -  Defaults to `node['ipaddress']`.\n* `node['zabbix']['host']['ipmi']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['ipmi']['port']` -  Defaults to `623`.\n* `node['zabbix']['host']['ipmi']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['jmx']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['jmx']['port']` -  Defaults to `12345`.\n* `node['zabbix']['host']['jmx']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['snmp']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['snmp']['port']` -  Defaults to `161`.\n* `node['zabbix']['host']['snmp']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['agent']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['java_gateway']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['java_gateway']['config']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['database']['mysql']['filesystem']` -  Defaults to `ext4`.\n* `node['zabbix']['server']['database']['mysql']['lvm_group']` -  Defaults to `shared`.\n* `node['zabbix']['server']['database']['mysql']['lvm_volume']` -  Defaults to `/dev/sda3`.\n* `node['zabbix']['server']['database']['mysql']['partition_size']` -  Defaults to `10G`.\n* `node['zabbix']['server']['database']['mysql']['mount_point']` -  Defaults to `/var/lib/mysql_zabbix`.\n* `node['zabbix']['server']['database']['mysql']['databag']` -  Defaults to `zabbix`.\n* `node['zabbix']['server']['database']['mysql']['version']` -  Defaults to `5.5`.\n* `node['zabbix']['server']['database']['mysql']['service_name']` -  Defaults to `zabbix`.\n* `node['zabbix']['server']['database']['mysql']['database_name']` -  Defaults to `zabbix`.\n* `node['zabbix']['server']['database']['mysql']['configuration']['listen_addresses']` -  Defaults to `127.0.0.1`.\n* `node['zabbix']['server']['database']['mysql']['configuration']['port']` -  Defaults to `3306`.\n* `node['zabbix']['server']['database']['mysql']['configuration']['character_set']` -  Defaults to `utf8`.\n* `node['zabbix']['server']['database']['mysql']['configuration']['collate']` -  Defaults to `utf8_bin`.\n* `node['zabbix']['server']['database']['postgresql']['filesystem']` -  Defaults to `ext4`.\n* `node['zabbix']['server']['database']['postgresql']['lvm_group']` -  Defaults to `shared`.\n* `node['zabbix']['server']['database']['postgresql']['lvm_volume']` -  Defaults to `/dev/sda3`.\n* `node['zabbix']['server']['database']['postgresql']['partition_size']` -  Defaults to `10G`.\n* `node['zabbix']['server']['database']['postgresql']['cluster']` -  Defaults to `main`.\n* `node['zabbix']['server']['database']['postgresql']['databag']` -  Defaults to `zabbix`.\n* `node['zabbix']['server']['database']['postgresql']['locale']` -  Defaults to `en_US.utf8`.\n* `node['zabbix']['server']['database']['postgresql']['mount_point']` -  Defaults to `/var/lib/postgresql`.\n* `node['zabbix']['server']['database']['postgresql']['network']` -  Defaults to `127.0.0.0/8`.\n* `node['zabbix']['server']['database']['postgresql']['version']` -  Defaults to `9.4`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['listen_addresses']` -  Defaults to `127.0.0.1`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['port']` -  Defaults to `5432`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['max_connections']` -  Defaults to `300`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['shared_buffers']` -  Defaults to `128MB`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['maintenance_work_mem']` -  Defaults to `128MB`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['work_mem']` -  Defaults to `8MB`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['effective_cache_size']` -  Defaults to `2GB`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['log_min_duration_statement']` -  Defaults to `1000`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['archive_mode']` -  Defaults to `on`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['archive_command']` -  Defaults to `exit 0`.\n* `node['zabbix']['server']['database']['postgresql']['configuration']['wal_level']` -  Defaults to `archive`.\n\n## MySQL\n* `node['zabbix']['server']['database']['mysql']['filesystem']` - Defaults to `ext4`\n* `node['zabbix']['server']['database']['mysql']['lvm_group']` - Defaults to `shared`\n* `node['zabbix']['server']['database']['mysql']['lvm_volume']` - Defaults to `/dev/sda3`\n* `node['zabbix']['server']['database']['mysql']['partition_size']` - Defaults to `10G`\n* `node['zabbix']['server']['database']['mysql']['mount_point']` - Defaults to `/var/lib/mysql_zabbix`. Do not set to `/var/lib/mysql` because it will conflict.\n* `node['zabbix']['server']['database']['mysql']['databag']` - Defaults to `zabbix`\n* `node['zabbix']['server']['database']['mysql']['version']` - Defaults to `5.5`\n* `node['zabbix']['server']['database']['mysql']['service_name']` - Defaults to `zabbix`\n* `node['zabbix']['server']['database']['mysql']['database_name']` - Defaults to `zabbix`\n* `node['zabbix']['server']['database']['mysql']['configuration']['listen_addresses']` - Defaults to `127.0.0.1`\n* `node['zabbix']['server']['database']['mysql']['configuration']['port']` - Defaults to `3306`\n* `node['zabbix']['server']['database']['mysql']['configuration']['character_set']` - Defaults to `utf8`\n* `node['zabbix']['server']['database']['mysql']['configuration']['collate']` - Defaults to `utf8_bin`\n\n## Default\n* `node['zabbix']['version']` -  Defaults to `3.2`.\n* `node['zabbix']['api-version']` -  Defaults to `3.1.0`.\n* `node['zabbix']['server']['database']['vendor']` -  Defaults to `postgresql`. Make sure that is setup for MySQL.\n\n## Host\n* `node['zabbix']['host']['group']` -  Defaults to `Hosts`.\n* `node['zabbix']['host']['name']` -  Defaults to `node['fqdn']`.\n* `node['zabbix']['host']['dns']` -  Defaults to `node['fqdn']`.\n* `node['zabbix']['host']['ipaddress']` -  Defaults to `node['ipaddress']`.\n* `node['zabbix']['host']['ipmi']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['ipmi']['port']` -  Defaults to `623`.\n* `node['zabbix']['host']['ipmi']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['jmx']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['jmx']['port']` -  Defaults to `12345`.\n* `node['zabbix']['host']['jmx']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['snmp']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['host']['snmp']['port']` -  Defaults to `161`.\n* `node['zabbix']['host']['snmp']['use_ip']` -  Defaults to `true`.\n* `node['zabbix']['host']['agent']['use_ip']` -  Defaults to `true`.\n\n## Java Gateway\n* `node['zabbix']['java_gateway']['enabled']` -  Defaults to `false`.\n* `node['zabbix']['java_gateway']['timeout']` -  Defaults to `3`.\n* `node['zabbix']['java_gateway']['listen_ip']` -  Defaults to `127.0.0.1`.\n* `node['zabbix']['java_gateway']['listen_port']` -  Defaults to `10052`.\n* `node['zabbix']['java_gateway']['pollers']` -  Defaults to `5`.\n\n## Server\n* `node['zabbix']['server']['database']['vendor']` -  Defaults to `postgresql`.\n* `node['zabbix']['server']['service']` -  Defaults to `zabbix-server`.\n* `node['zabbix']['server']['credentials']['databag']` -  Defaults to `zabbix`.\n* `node['zabbix']['server']['templates']` -  Defaults to `/opt/zabbix/templates`.\n* `node['zabbix']['server']['sync_hosts']` -  Defaults to `false`.\n* `node['zabbix']['server']['config']['listenip']` -  Defaults to `0.0.0.0`.\n* `node['zabbix']['server']['config']['debuglevel']` -  Defaults to `3`.\n* `node['zabbix']['server']['config']['workers']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['hk']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['cache']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['timeouts']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['global']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['java_gateway']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['config']['alerts']` -  Defaults to `{ ... }`.\n* `node['zabbix']['server']['web']['server_name']` -  Defaults to `localhost`.\n* `node['zabbix']['server']['web']['listen']` -  Defaults to `127.0.0.1`.\n* `node['zabbix']['server']['web']['port']` -  Defaults to `9200`.\n* `node['zabbix']['server']['web']['max_requests']` -  Defaults to `500`.\n* `node['zabbix']['server']['web']['max_children']` -  Defaults to `5`.\n* `node['zabbix']['server']['web']['min_spare_servers']` -  Defaults to `1`.\n* `node['zabbix']['server']['web']['start_servers']` -  Defaults to `2`.\n* `node['zabbix']['server']['web']['max_spare_servers']` -  Defaults to `3`.\n* `node['zabbix']['server']['web']['process_manager']` -  Defaults to `dynamic`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[date.timezone]']` -  Defaults to `UTC`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_flag[display_errors]']` -  Defaults to `false`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[error_reporting]']` -  Defaults to `E_ALL \u0026amp; ~E_DEPRECATED`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[error_log]']` -  Defaults to `/var/log/zabbix-php-error.log`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[max_execution_time]']` -  Defaults to `600`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[max_input_time]']` -  Defaults to `300`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[memory_limit]']` -  Defaults to `128M`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_value[post_max_size]']` -  Defaults to `32M`.\n* `node['zabbix']['server']['web']['configuration']['php_admin_flag[register_globals]']` -  Defaults to `true`.\n* `node['nginx']['default_site_enabled']` -  Defaults to `false`.\n\n# Recipes\n\n* zabbix_lwrp::agent_linux - Installs and configures Zabbix agent for Linux.\n* zabbix_lwrp::agent_win_bin - Installs and configures Zabbix agent for Windows.\n* zabbix_lwrp::agent_win_choco - Installs and configures Zabbix agent for Windows.\n* zabbix_lwrp::agent - Installs and configures Zabbix agent.\n* zabbix_lwrp::connect - Connects to Zabbix API to sync configuration.\n* zabbix_lwrp::default - Installs and configures Zabbix official repository and agent.\n* zabbix_lwrp::postgresql - Installs and configures PostgreSQL database for Zabbix.\n* zabbix_lwrp::mysql - Installs and configures MySQL database for Zabbix.\n* zabbix_lwrp::database - Installs and configures Zabbix database.\n* zabbix_lwrp::default - Installs and configures Zabbix official repository and agent.\n* zabbix_lwrp::host - Creates host via Zabbix API.\n* zabbix_lwrp::java_gateway - Installs and configures Zabbix Java Gateway.\n* zabbix_lwrp::partition - Configures LVM for Zabbix database.\n* zabbix_lwrp::repository - Installs Zabbix official repository.\n* zabbix_lwrp::server - Installs and configures Zabbix server.\n* zabbix_lwrp::web - Installs and configures Zabbix frontend.\n\n# Resources\n\n* [zabbix_action](#zabbix_action)\n* [zabbix_application](#zabbix_application)\n* [zabbix_connect](#zabbix_connect)\n* [zabbix_database](#zabbix_database)\n* [zabbix_graph](#zabbix_graph)\n* [zabbix_host](#zabbix_host)\n* [zabbix_media_type](#zabbix_media_type)\n* [zabbix_screen](#zabbix_screen)\n* [zabbix_template](#zabbix_template)\n* [zabbix_user_group](#zabbix_user_group)\n* [zabbix_user_macro](#zabbix_user_macro)\n\n## zabbix_action\n\n### Actions\n\n- sync:  Default action.\n\n### Attribute Parameters\n\n- name:\n- event_source:\n- escalation_time:  Defaults to \u003ccode\u003e60\u003c/code\u003e.\n- enabled:  Defaults to \u003ccode\u003etrue\u003c/code\u003e.\n- message_subject:\n- message_body:\n- send_recovery_message:  Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n- recovery_message_subject:\n- recovery_message_body:\n\n## zabbix_application\n\n### Actions\n\n- sync:  Default action.\n\n### Attribute Parameters\n\n- name:\n\n## zabbix_connect\n\n### Actions\n\n- make:  Default action.\n\n### Attribute Parameters\n\n- name:\n- databag:\n- apiurl:\n- user:\n- password:\n- sync:  Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n\n## zabbix_database\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- db_vendor:  Defaults to \u003ccode\u003e\"postgresql\"\u003c/code\u003e.\n- db_name:\n- db_user:\n- db_pass:\n- db_host:\n- db_port:\n\n## zabbix_graph\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- name:\n- height:\n- width:\n- graph_items:\n- graph_type:\n\n## zabbix_host\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- type:  Defaults to \u003ccode\u003e1\u003c/code\u003e.\n- host_name:\n- host_group:\n- port:  Defaults to \u003ccode\u003e10050\u003c/code\u003e.\n- ip_address:\n- dns:\n- use_ip:  Defaults to \u003ccode\u003etrue\u003c/code\u003e.\n- ipmi_enabled:  Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n- snmp_enabled:  Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n- jmx_enabled:  Defaults to \u003ccode\u003efalse\u003c/code\u003e.\n- ipmi_port:  Defaults to \u003ccode\u003e623\u003c/code\u003e.\n- snmp_port:  Defaults to \u003ccode\u003e161\u003c/code\u003e.\n- jmx_port:  Defaults to \u003ccode\u003e12345\u003c/code\u003e.\n- ipmi_use_ip:  Defaults to \u003ccode\u003etrue\u003c/code\u003e.\n- snmp_use_ip:  Defaults to \u003ccode\u003etrue\u003c/code\u003e.\n- jmx_use_ip:  Defaults to \u003ccode\u003etrue\u003c/code\u003e.\n\n## zabbix_media_type\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- name:\n- type:\n- server:\n- helo:\n- email:\n- path:\n- gsm_modem:\n- username:\n- password:\n\n## zabbix_screen\n\n### Actions\n\n- sync:  Default action.\n\n### Attribute Parameters\n\n- name:\n- hsize:\n- vsize:\n\n## zabbix_template\n\n### Actions\n\n- add:  Default action.\n- import:\n\n### Attribute Parameters\n\n- host_name:\n- path:\n\n## zabbix_user_group\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- name:\n\n## zabbix_user_macro\n\n### Actions\n\n- create:  Default action.\n\n### Attribute Parameters\n\n- name:\n- value:\n- host_name:\n\n# Data bag\n\nData bag `zabbix` must contains the following items:\n* admin (with Zabbix admin password)\n* postgresql\n* users\n\n`postgresql` and `users` items related to the postgresql database\n\n`users` item related to MySQL database, necessarily contains `root` and `zabbix` entries\n\nFor examples see fixture data bag `test/fixtures/databags/zabbix/`\n\n## Using node.run_state\nOptionally this data can be provided in node.run_state instead of data bags.\n\nThis is useful in a wrapper cookbook that retrieves credentials from other locations such as chef-vault.\n\nSimply set the 'databag' attributes to the value of the run_state key that contains the data.\n\n### Example Wrapper Cookbook\n```ruby\n  #Your super secret code to get credentials here\n  \n  node.default['zabbix']['server']['database']['databag'] = 'zabbix_data'\n  node.default['zabbix']['server']['database']['postgresql']['databag'] = 'zabbix_data'\n  node.default['zabbix']['server']['credentials']['databag'] = 'zabbix_data'\n\n  node.run_state['zabbix_data'] = {\n    'users' =\u003e {\n      'id' =\u003e 'users',\n      'users' =\u003e {\n        'zabbix' =\u003e {\n          'options' =\u003e {\n             'password' =\u003e secret_zabbix_pass_here\n             'superuser' =\u003e false\n           }\n         }\n       }\n    },\n    'databases' =\u003e {\n      'id' =\u003e 'databases',\n      'databases' =\u003e {\n        'zabbix' =\u003e { 'options' =\u003e { 'owner' =\u003e 'zabbix' } }\n      }\n    },\n    'admin' =\u003e {'id' =\u003e 'admin', 'pass' =\u003e secret_admin_pass_here }\n  }\n\n  include_recipe 'zabbix_lwrp::default'\n  include_recipe 'zabbix_lwrp::database'\n  include_recipe 'zabbix_lwrp::server'\n  include_recipe 'zabbix_lwrp::web'\n```\n\n\n# Resources\n\nThis cookbooks provides next resources:\n* [zabbix_action](#zabbix_action)\n* [zabbix_application](#zabbix_application)\n* [zabbix_connect](#zabbix_connect)\n* [zabbix_database](#zabbix_database)\n* [zabbix_graph](#zabbix_graph)\n* [zabbix_host](#zabbix_host)\n* [zabbix_media_type](#zabbix_media_type)\n* [zabbix_screen](#zabbix_screen)\n* [zabbix_template](#zabbix_template)\n* [zabbix_user_group](#zabbix_user_group)\n* [zabbix_user_macro](#zabbix_user_macro)\n\n## zabbix_action\n\nCreates zabbix action with operations, conditions and messages.\n\n### Actions\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAction\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esync\u003c/td\u003e\n    \u003ctd\u003eDefault action. Sync action description with one's in zabbix server\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Attributes\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ename\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eName attribute\u003c/strong\u003e. Name of the action (required)\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eevent_source\u003c/td\u003e\n    \u003ctd\u003eSource of event for action, now only :trigger allowed\u003c/td\u003e\n    \u003ctd\u003e:triggers\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eescalation_time\u003c/td\u003e\n    \u003ctd\u003eDelay between escalation steps\u003c/td\u003e\n    \u003ctd\u003e60\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eenabled\u003c/td\u003e\n    \u003ctd\u003eIs action enabled?\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emessage_subject\u003c/td\u003e\n    \u003ctd\u003eSubject of action message\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emessage_body\u003c/td\u003e\n    \u003ctd\u003eBody of action message\u003c/td\u003e\n    \u003ctd\u003etrue\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esend_recovery_message\u003c/td\u003e\n    \u003ctd\u003eSend recovery message when conditions of action become false\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003erecovery_message_subject\u003c/td\u003e\n    \u003ctd\u003eSubject of recovery message\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003erecovery_message_body\u003c/td\u003e\n    \u003ctd\u003eBody of recovery message\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eoperation\u003c/td\u003e\n    \u003ctd\u003eAdd an operation to action, see below. It's possible to add more then one operation\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003econdition\u003c/td\u003e\n    \u003ctd\u003eAdd an condition to action, see below. It's possible to add more the one condition\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nAttributes for operation.\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etype\u003c/td\u003e\n    \u003ctd\u003eType of operation, can be :message or :command\u003c/td\u003e\n    \u003ctd\u003e:message\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eescalation_time\u003c/td\u003e\n    \u003ctd\u003eTime to escalate to next step\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003estart\u003c/td\u003e\n    \u003ctd\u003eStart step, when this operation take place\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003estop\u003c/td\u003e\n    \u003ctd\u003eLast step, when this operation take place\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003euser_groups\u003c/td\u003e\n    \u003ctd\u003eZabbix user group names that'll receive message\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emessage\u003c/td\u003e\n    \u003ctd\u003eMessage description, see below\u003c/td\u003e\n    \u003ctd\u003eUse default actin message if empty\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nAttributes for conditions.\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etype\u003c/td\u003e\n    \u003ctd\u003eType of condition, can be one of :trigger, :trigger_value, :trigger_serverity, :host_group, :maintenance\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eoperator\u003c/td\u003e\n    \u003ctd\u003eOperator for condition, can be one of :equal, :not_equal, :like, :not_like, :in, :gte, :lte, :not_in\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003evalue\u003c/td\u003e\n    \u003ctd\u003eValue for condition.\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nIt also possible to use short form of condition, like:\n```ruby\n  condition :trigger, :equal, '42th trigger name'\n```\n\nAttributes for message.\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003euse_default_message\u003c/td\u003e\n    \u003ctd\u003eUse default message from action\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esubject\u003c/td\u003e\n    \u003ctd\u003eMessage subject\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emessage\u003c/td\u003e\n    \u003ctd\u003eMessage body\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emedia_type\u003c/td\u003e\n    \u003ctd\u003eName of media type to use\u003c/td\u003e\n    \u003ctd\u003eBy default all media types are used\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Examples\n```ruby\nzabbix_action 'Test action' do\n  action :sync\n  event_source :triggers\n  operation do\n    user_groups 'Test group'\n    message do\n      use_default_message false\n      subject 'Test {TRIGGER.SEVERITY}: {HOSTNAME1} {TRIGGER.STATUS}: {TRIGGER.NAME}'\n      message \"Trigger: {TRIGGER.NAME}\\n\"\\\n        \"Trigger status: {TRIGGER.STATUS}\\n\" \\\n        \"Trigger severity: {TRIGGER.SEVERITY}\\n\" \\\n        \"\\n\" \\\n        \"Item values:\\n\" \\\n        '{ITEM.NAME1} ({HOSTNAME1}:{TRIGGER.KEY1}): {ITEM.VALUE1}'\n      media_type 'sms'\n    end\n  end\n\n  condition :trigger_severity, :gte, :high\n  condition :host_group, :equal, 'Main'\n  condition :maintenance, :not_in, :maintenance\nend\n\n```\n\n\n## zabbix_application\n\nCreates application, items and triggers. You should think about items and triggers like nested\nresources inside zabbix_application resource.\n\n### Actions\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAction\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esync\u003c/td\u003e\n    \u003ctd\u003eDefault action. Sync application description with one's in zabbix server\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Attributes\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ename\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eName attribute\u003c/strong\u003e. Name of the application (required)\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eitem\u003c/td\u003e\n    \u003ctd\u003eAdd an item to application, see below. It's possible to add more then one item\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etrigger\u003c/td\u003e\n    \u003ctd\u003eAdd an trigger to application, see below. It's possible to add more the one trigger\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Item attributes\nCreate/update zabbix item\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ekey\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eName attribute\u003c/strong\u003e. Zabbix key for an item, should be unique.\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etype\u003c/td\u003e\n    \u003ctd\u003eType of zabbix check, possible values\n      :zabbix, :trapper, :active, :calculated\n    \u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ename\u003c/td\u003e\n    \u003ctd\u003eDescriptive name of zabbix check, shown in web-interface\n    \u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003efrequency\u003c/td\u003e\n    \u003ctd\u003eHow often zabbix checks this item in seconds\u003c/td\u003e\n    \u003ctd\u003e60\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ehistory\u003c/td\u003e\n    \u003ctd\u003eHow many days store item's history\u003c/td\u003e\n    \u003ctd\u003e7 days\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emultiplier\u003c/td\u003e\n    \u003ctd\u003eSet a multiplier for item\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etrends\u003c/td\u003e\n    \u003ctd\u003eHow many days store item's trends (archived history)\u003c/td\u003e\n    \u003ctd\u003e365\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eunits\u003c/td\u003e\n    \u003ctd\u003eSet a unit for item\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003evalue_type\u003c/td\u003e\n    \u003ctd\u003eType of gathered value, possible values\n      :float, :character, :log_line, :unsigned_int, :text\n    \u003c/td\u003e\n    \u003ctd\u003e:unsigned_int\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Trigger attributes\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Examples\n```ruby\nzabbix_application \"Test application\" do\n  action :sync\n\n  item 'vfs.fs.size[/var/log,free]' do\n    type :active\n    name 'Free disk space on /var/log'\n    frequency 600\n    value_type :unsigned_int\n  end\n\n  trigger \"Number #{node.fqdn} of free inodes on log \u003c 10%\" do\n    expression \"{#{node.fqdn}:vfs.fs.size[/var/log,free].last(0)}\u003e0\"\n    severity :high\n  end\nend\n```\n\n## zabbix_connect\n\n### Examples\n```ruby\n\nzabbix_connect 'default' do\n  action :make\n  apiurl 'http://localhost/api_jsonrpc.php'\n  databag 'zabbix'\nend\n```\n\n## zabbix_database\n\n### Examples\n```ruby\n\nzabbix_database db_name do\n  db_user db_user\n  db_pass db_pass\n  db_host db_host\n  db_port db_port\n  action :create\nend\n```\n\n## zabbix_graph\n\n### Examples\n```ruby\n\nzabbix_graph 'Test Graph' do\n  action :create\n  width 640\n  height 480\n  graph_items [:key =\u003e 'vfs.fs.size[/var/log,free]', :color =\u003e '111111']\nend\n```\n\n## zabbix_host\n\n### Examples\n```ruby\nzabbix_host node['fqdn'] do\n  action :create\n  host_group 'Hosts'\n  use_ip true\n  ip_address node['ipaddress']\nend\n```\n\n## zabbix_media_type\n\n### Examples\n```ruby\nzabbix_media_type 'sms' do\n  action :create\n  type :sms\n  gsm_modem '/dev/modem'\nend\n```\n\n## zabbix_screen\n\n### Examples\n```ruby\nzabbix_screen 'Test Screen' do\n  action :sync\n  screen_item 'Test Graph' do\n    resource_type :graph\n  end\nend\n```\n\n## zabbix_template\n\n### Actions\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAction\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eadd\u003c/td\u003e\n    \u003ctd\u003eDefault action. Add a template to node\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eimport\u003c/td\u003e\n    \u003ctd\u003eImport templates from xml file to zabbix server\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Attributes\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epath\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eName attribute\u003c/strong\u003e. Path to file for :import or name of template for :add action (required)\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ehost_name\u003c/td\u003e\n    \u003ctd\u003eName of host new template to add\u003c/td\u003e\n    \u003ctd\u003eFQDN of current node\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Examples\n```ruby\nzabbix_template '/opt/zabbix/templates/zbx_templates_linux.xml' do\n  action :import\nend\n\nzabbix_template 'Linux_Template'\n  action :add\nend\n```\n\n## zabbix_user_group\n\n### Actions\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAction\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ecreate\u003c/td\u003e\n    \u003ctd\u003eDefault action. Create a new zabbix user group\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Attributes\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eAttribute\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ename\u003c/td\u003e\n    \u003ctd\u003e\u003cstrong\u003eName attribute\u003c/strong\u003e. Name of new zabbix user group (required)\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Examples\n```ruby\nzabbix_user_group 'Test group' do\n  action :create\nend\n```\n\n## zabbix_user_macro\n\n### Examples\n```ruby\nzabbix_user_macro 'Test_macro' do\n  action :create\n  value 'foobar'\nend\n```\n\n\n# Usage\n\nTo install Zabbix agent just include `zabbix_lwrp` default recipe into your node's `run_list`:\n\n```json\n{\n  \"name\":\"my_node\",\n  \"run_list\": [\n    \"recipe[zabbix_lwrp]\"\n  ]\n}\n```\n\nThis recipe should be included before all usage of LWRP, because connection to zabbix server is established here.\n\nTo install Zabbix server include the following recipes:\n\n```json\n{\n  \"name\":\"my_node\",\n  \"run_list\": [\n    \"recipe[zabbix_lwrp::default]\",\n    \"recipe[zabbix_lwrp::database]\",\n    \"recipe[zabbix_lwrp::server]\",\n    \"recipe[zabbix_lwrp::web]\"\n  ]\n}\n```\n\nFor examples of LWRP see fixture cookbook in `tests/fixtures/cookbooks`.\n\n\n# License and Maintainer\n\nMaintainer:: LLC Express 42 (\u003ccookbooks@express42.com\u003e)\nSource:: https://github.com/express42/zabbix_lwrp\nIssues:: https://github.com/express42/zabbix_lwrp/issues\n\nLicense:: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress42%2Fzabbix_lwrp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpress42%2Fzabbix_lwrp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress42%2Fzabbix_lwrp/lists"}