Merge branch 'enhancement-erenfro-issue3-split-database-install' of Linux-Help/zabbix into develop
This commit is contained in:
commit
2b54793017
22 changed files with 15860 additions and 119 deletions
44
.kitchen.yml
44
.kitchen.yml
|
@ -1,37 +1,40 @@
|
|||
---
|
||||
driver:
|
||||
name: docker
|
||||
name: qemu
|
||||
|
||||
provisioner:
|
||||
name: chef_zero
|
||||
environments_path: test/environments
|
||||
nodes_path: test/fixtures/nodes
|
||||
clients_path: test/fixtures/clients
|
||||
environments_path: test/fixtures/environments
|
||||
data_bags_path: test/fixtures/data_bags
|
||||
chef_client_path: /usr/bin/chef-client
|
||||
client_rb:
|
||||
environment: integration_test_env
|
||||
environment: test
|
||||
|
||||
platforms:
|
||||
- name: centos-6.6-chef-11
|
||||
- name: centos-7.3
|
||||
driver_config:
|
||||
image: centos:6.6
|
||||
image: centos-7.3-chef.qcow2
|
||||
platform: rhel
|
||||
require_chef_omnibus: 12.5.1
|
||||
use_sudo: false
|
||||
hostname: integration.test.test
|
||||
require_chef_omnibus: false
|
||||
hostname: integration.centos7.test
|
||||
|
||||
suites:
|
||||
- name: server
|
||||
driver:
|
||||
forward:
|
||||
- 8087:80
|
||||
data_bags_path: "test/integration/data_bags"
|
||||
encrypted_data_bag_secret_key_path: "test/integration/server/encrypted_data_bag_secret"
|
||||
run_list:
|
||||
- recipe[zabbix::database]
|
||||
- recipe[zabbix::server]
|
||||
attributes:
|
||||
tags: [ 'httpd', 'openldap', 'mind1', 'mongodb', 'shibboleth', 'tomcat' ]
|
||||
tags: [ 'httpd' ]
|
||||
zabbix:
|
||||
database:
|
||||
repo:
|
||||
pgdg: true
|
||||
- name: agent
|
||||
data_bags_path: "test/integration/data_bags"
|
||||
encrypted_data_bag_secret_key_path: "test/integration/agent/encrypted_data_bag_secret"
|
||||
run_list:
|
||||
- recipe[zabbix::default]
|
||||
attributes:
|
||||
|
@ -39,10 +42,17 @@ suites:
|
|||
zabbix:
|
||||
agent_servers: ['172.17.0.3']
|
||||
- name: proxy
|
||||
data_bags_path: "test/integration/data_bags"
|
||||
encrypted_data_bag_secret_key_path: "test/integration/server/encrypted_data_bag_secret"
|
||||
run_list:
|
||||
- recipe[zabbix::proxy]
|
||||
attributes:
|
||||
tags: [ 'httpd', 'openldap', 'mind1', 'mongodb', 'shibboleth', 'tomcat' ]
|
||||
|
||||
tags: [ 'httpd' ]
|
||||
- name: database
|
||||
run_list:
|
||||
- recipe[zabbix::database]
|
||||
attributes:
|
||||
tags: [ 'httpd' ]
|
||||
zabbix:
|
||||
version: '3.0'
|
||||
database:
|
||||
repo:
|
||||
pgdg: true
|
||||
|
|
|
@ -2,5 +2,9 @@ source "https://supermarket.chef.io"
|
|||
|
||||
metadata
|
||||
|
||||
cookbook "chef-vault", '>= 2.1.1'
|
||||
cookbook "postgresql", '>= 6.0.1'
|
||||
cookbook "yum-zabbix", path: "../yum-zabbix"
|
||||
#cookbook "apt-zabbix", path: "../apt-zabbix"
|
||||
#cookbook "mysql", '>= 8.2.0'
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
default['zabbix']['database']['backend'] = 'postgresql'
|
||||
default['zabbix']['database']['repo']['pgdg'] = false
|
||||
|
||||
default['zabbix']['version'] = "3.0"
|
||||
default['zabbix']['agent_meta'] = []
|
||||
if node.run_list?('recipe[zabbix::server]')
|
||||
|
@ -16,4 +19,3 @@ default['zabbix']['trap_scripts']['daily']['del'] = []
|
|||
default['zabbix']['httpd_conf']['https_redirection_enabled'] = true
|
||||
default['letsencrypt']['enabled'] = false
|
||||
default['lba_host'] = 'default'
|
||||
|
||||
|
|
3282
files/mysql/3.0/data.sql
Normal file
3282
files/mysql/3.0/data.sql
Normal file
File diff suppressed because it is too large
Load diff
187
files/mysql/3.0/images.sql
Normal file
187
files/mysql/3.0/images.sql
Normal file
File diff suppressed because one or more lines are too long
1593
files/mysql/3.0/schema.sql
Normal file
1593
files/mysql/3.0/schema.sql
Normal file
File diff suppressed because it is too large
Load diff
3319
files/mysql/3.2/data.sql
Normal file
3319
files/mysql/3.2/data.sql
Normal file
File diff suppressed because it is too large
Load diff
187
files/mysql/3.2/images.sql
Normal file
187
files/mysql/3.2/images.sql
Normal file
File diff suppressed because one or more lines are too long
1722
files/mysql/3.2/schema.sql
Normal file
1722
files/mysql/3.2/schema.sql
Normal file
File diff suppressed because it is too large
Load diff
|
@ -569,6 +569,7 @@ INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,hi
|
|||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23145','0','','','10081','Processor load (5 min average)','system.cpu.load[percpu,avg5]','60','7','365','0','0','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23147','0','','','10081','Free swap space','system.swap.size[,free]','60','7','365','0','3','','B','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23148','0','','','10081','Total swap space','system.swap.size[,total]','3600','7','365','0','3','','B','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23664','0','','','10081','Free virtual memory, in %','vm.vmemory.size[pavailable]','60','7','365','0','0','','%','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23149','0','','','10081','System information','system.uname','3600','7','0','0','1','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','5','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23150','0','','','10081','System uptime','system.uptime','60','7','365','0','3','','uptime','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23158','0','','','10081','Free memory','vm.memory.size[free]','60','7','365','0','3','','B','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
|
@ -745,6 +746,9 @@ INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,hi
|
|||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23631','3','','','10091','Datastore discovery','vmware.hv.datastore.discovery[{$URL},{HOST.HOST}]','3600','90','0','0','4','','','0','0','','0','','','','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','1',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23632','3','','','10091','Average read latency of the datastore $3','vmware.hv.datastore.read[{$URL},{HOST.HOST},{#DATASTORE},latency]','60','90','365','0','3','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','2',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23633','3','','','10091','Average write latency of the datastore $3','vmware.hv.datastore.write[{$URL},{HOST.HOST},{#DATASTORE},latency]','60','90','365','0','3','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','2',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23665','3','','','10091','Total size of datastore $3','vmware.hv.datastore.size[{$URL},{HOST.HOST},{#DATASTORE}]','60','90','365','0','3','','B','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','2',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23666','3','','','10091','Free space on datastore $3 (percentage)','vmware.hv.datastore.size[{$URL},{HOST.HOST},{#DATASTORE},pfree]','60','90','365','0','0','','%','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','2',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23663','3','','','10091','Health state rollup','vmware.hv.sensor.health.state[{$URL},{HOST.HOST}]','60','90','365','0','3','','','0','0','','0','','','1','',NULL,'13','','','','0','0','{$USERNAME}','{$PASSWORD}','','','0',NULL,'','The host health state rollup sensor value: gray - unknown, ok, red - it has a problem, yellow - it might have a problem.','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23634','5','','','10047','Zabbix vmware cache, % free','zabbix[vmware,buffer,pfree]','60','7','365','0','0','','%','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23636','16','','','10082','jvm Name','jmx["java.lang:type=Runtime",VmName]','3600','7','0','0','1','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23637','16','','','10082','os Process CPU Load','jmx["java.lang:type=OperatingSystem",ProcessCpuLoad]','60','7','365','0','0','','%','1','0','','0','','','100','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
|
@ -770,7 +774,7 @@ INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,hi
|
|||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23657','3','','','10104','ICMP loss','icmppingloss','60','7','365','0','0','','%','0','0','','0','','','1','',NULL,NULL,'','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23658','3','','','10088','Full name','vmware.fullname[{$URL}]','3600','90','0','0','1','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23659','3','','','10088','Version','vmware.version[{$URL}]','3600','90','0','0','1','','','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23660','3','','','10089','CPU ready','vmware.vm.cpu.ready[{$URL},{HOST.HOST}]','60','90','365','0','3','','%','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','0',NULL,'','Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. CPU ready time is dependent on the number of virtual machines on the host and their CPU loads.','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23660','3','','','10089','CPU ready','vmware.vm.cpu.ready[{$URL},{HOST.HOST}]','60','90','365','0','3','','ms','0','0','','0','','','1','',NULL,NULL,'','','','0','0','{$USERNAME}','{$PASSWORD}','','','0',NULL,'','Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU during last measurement interval (VMware vCenter/ESXi Server performance counter sampling interval - 20 seconds)','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('23661','5','','','10047','Zabbix value cache operating mode','zabbix[vcache,cache,mode]','60','7','365','0','3','','','0','0','','0','','','1','',NULL,'15','','','','0','0','','','','','0',NULL,'','','0','30','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('10020','0','','','10001','Agent ping','agent.ping','60','7','365','0','3','','','0','0','','0','','','1','','22232','10','','','','0','0','','','','','0',NULL,'','The agent always returns 1 for this item. It could be used in combination with nodata() for availability check.','0','0','0','0','','0');
|
||||
INSERT INTO items (itemid,type,snmp_community,snmp_oid,hostid,name,key_,delay,history,trends,status,value_type,trapper_hosts,units,multiplier,delta,snmpv3_securityname,snmpv3_securitylevel,snmpv3_authpassphrase,snmpv3_privpassphrase,formula,logtimefmt,templateid,valuemapid,delay_flex,params,ipmi_sensor,data_type,authtype,username,password,publickey,privatekey,flags,interfaceid,port,description,inventory_link,lifetime,snmpv3_authprotocol,snmpv3_privprotocol,snmpv3_contextname,evaltype) values ('10059','0','','','10001','Version of zabbix_agent(d) running','agent.version','3600','7','0','0','1','','','0','0','','0','','','1','','22231',NULL,'','','','0','0','','','','','0',NULL,'','','0','0','0','0','','0');
|
||||
|
@ -1179,7 +1183,7 @@ INSERT INTO triggers (triggerid,expression,description,url,status,priority,comme
|
|||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13425','{12812}>0','Host information was changed on {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13428','{12815}<0','{HOST.NAME} has just been restarted','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13430','{13095}>300','Too many processes on {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13431','{12818}<100000','Lack of free swap space on {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13431','({TRIGGER.VALUE}=0 and {12818}<10) or ({TRIGGER.VALUE}=1 and {12818}<20)','Lack of available virtual memory on server {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13433','{12820}<10000','Lack of free memory on server {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13435','{13094}>5','Processor load is too high on {HOST.NAME}','','0','3','',NULL,'0','0');
|
||||
INSERT INTO triggers (triggerid,expression,description,url,status,priority,comments,templateid,type,flags) values ('13439','{12826}<20','Free disk space is less than 20% on volume {#FSNAME}','','0','2','',NULL,'0','2');
|
||||
|
@ -1484,7 +1488,7 @@ INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('
|
|||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12810','23072','13423','last','0');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12812','23149','13425','diff','0');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12815','23150','13428','change','0');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12818','23147','13431','last','0');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12818','23664','13431','min','10m');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12820','23158','13433','last','0');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12824','23160','13437','nodata','5m');
|
||||
INSERT INTO functions (functionid,itemid,triggerid,function,parameter) values ('12826','23165','13439','last','0');
|
||||
|
@ -2946,6 +2950,10 @@ INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5871','
|
|||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5872','457','23657');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5873','458','23658');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5874','458','23659');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5876','418','23663');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5881','328','23664');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5882','445','23665');
|
||||
INSERT INTO items_applications (itemappid,applicationid,itemid) values ('5885','445','23666');
|
||||
INSERT INTO mappings (mappingid,valuemapid,value,newvalue) values ('1','1','0','Down');
|
||||
INSERT INTO mappings (mappingid,valuemapid,value,newvalue) values ('2','1','1','Up');
|
||||
INSERT INTO mappings (mappingid,valuemapid,value,newvalue) values ('3','2','0','not available');
|
||||
|
@ -3288,6 +3296,8 @@ INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('208',
|
|||
INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('209','23608','23600');
|
||||
INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('218','23632','23631');
|
||||
INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('219','23633','23631');
|
||||
INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('220','23665','23631');
|
||||
INSERT INTO item_discovery (itemdiscoveryid,itemid,parent_itemid) values ('221','23666','23631');
|
||||
INSERT INTO host_discovery (hostid,parent_hostid,parent_itemid) values ('10090',NULL,'23542');
|
||||
INSERT INTO host_discovery (hostid,parent_hostid,parent_itemid) values ('10092',NULL,'23554');
|
||||
INSERT INTO application_template (application_templateid,applicationid,templateid) values ('1','207','206');
|
3408
files/postgresql/3.2/data.sql
Normal file
3408
files/postgresql/3.2/data.sql
Normal file
File diff suppressed because it is too large
Load diff
187
files/postgresql/3.2/images.sql
Normal file
187
files/postgresql/3.2/images.sql
Normal file
File diff suppressed because one or more lines are too long
1722
files/postgresql/3.2/schema.sql
Normal file
1722
files/postgresql/3.2/schema.sql
Normal file
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,7 @@ maintainer_email 'psi-jack@linux-help.org'
|
|||
license 'Apache 2.0'
|
||||
description 'Installs Zabbix Server & Client agents for EL linux distributions'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '1.4.0'
|
||||
version '1.5.0'
|
||||
source_url 'https://git.linux-help.org/Linux-Help/zabbix' if respond_to?(:source_url)
|
||||
issues_url 'https://git.linux-help.org/Linux-Help/zabbix/issues' if respond_to?(:issues_url)
|
||||
|
||||
|
@ -14,3 +14,10 @@ end
|
|||
|
||||
recipe 'zabbix', 'Installs zabbix'
|
||||
|
||||
depends 'chef-vault', '>= 2.1.1'
|
||||
depends 'postgresql', '>= 6.0.1'
|
||||
depends 'yum-zabbix', '>= 1.0.1'
|
||||
#depends 'apt-zabbix'
|
||||
#depends 'mysql', '>= 8.2.0'
|
||||
|
||||
chef_version '>= 12.1' if respond_to?(:chef_version)
|
||||
|
|
|
@ -7,91 +7,9 @@
|
|||
# Eric Renfro <psi-jack@linux-help.org>
|
||||
#
|
||||
|
||||
yum_package 'postgresql94-server'
|
||||
|
||||
directory '/tmp/database' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
action :create
|
||||
only_if { Dir.glob('/var/lib/pgsql/9.4/data/*').empty? }
|
||||
case node['zabbix']['database']['backend']
|
||||
when 'postgresql'
|
||||
include_recipe 'zabbix::database_postgresql'
|
||||
else
|
||||
Chef::Application.fatal!('Unknown database backend to use.', 101)
|
||||
end
|
||||
|
||||
template "/tmp/database/schema.sql" do
|
||||
source "schema.sql.erb"
|
||||
mode "0644"
|
||||
owner "root"
|
||||
group "root"
|
||||
action :create
|
||||
only_if { Dir.exist?('/tmp/database') }
|
||||
end
|
||||
|
||||
template "/tmp/database/images.sql" do
|
||||
source "images.sql.erb"
|
||||
mode "0644"
|
||||
owner "root"
|
||||
group "root"
|
||||
action :create
|
||||
only_if { Dir.exist?('/tmp/database') }
|
||||
end
|
||||
|
||||
template "/tmp/database/data.sql" do
|
||||
source "data.sql.erb"
|
||||
mode "0644"
|
||||
owner "root"
|
||||
group "root"
|
||||
action :create
|
||||
only_if { Dir.exist?('/tmp/database') }
|
||||
end
|
||||
|
||||
execute 'initializingdb' do
|
||||
command 'service postgresql-9.4 initdb'
|
||||
action :run
|
||||
only_if { Dir.glob('/var/lib/pgsql/9.4/data/*').empty? }
|
||||
end
|
||||
|
||||
template "/var/lib/pgsql/9.4/data/pg_hba.conf" do
|
||||
source "pg_hba.conf.erb"
|
||||
mode "0600"
|
||||
owner "postgres"
|
||||
group "postgres"
|
||||
notifies :restart, "service[postgresql-9.4]", :immediately
|
||||
end
|
||||
|
||||
service 'postgresql-9.4' do
|
||||
action [:start, :enable]
|
||||
end
|
||||
|
||||
bash 'configure_postgres' do
|
||||
user 'root'
|
||||
sensitive true
|
||||
credentials = Chef::EncryptedDataBagItem.load("odhp_credentials", "credentials")
|
||||
code <<-EOH
|
||||
su postgres -l -c "psql -U postgres -c \\"CREATE DATABASE zabbix WITH ENCODING='UTF-8';\\""
|
||||
su postgres -l -c "psql -U postgres -c \\"CREATE USER zabbixmaster WITH PASSWORD '#{credentials['zabbix']['postgres_password']}';\\""
|
||||
su postgres -l -c "psql -U postgres -c \\"GRANT ALL PRIVILEGES ON DATABASE zabbix to zabbixmaster;\\""
|
||||
EOH
|
||||
only_if { Dir.exist?('/tmp/database') }
|
||||
end
|
||||
|
||||
bash 'configure_schema' do
|
||||
credentials = Chef::EncryptedDataBagItem.load("odhp_credentials", "credentials")
|
||||
sensitive true
|
||||
environment ({
|
||||
"PGPASSWORD" => credentials['zabbix']['postgres_password']
|
||||
})
|
||||
code <<-EOH
|
||||
cd /tmp/database/
|
||||
psql -h 127.0.0.1 -U zabbixmaster -d zabbix -f /tmp/database/schema.sql;
|
||||
psql -h 127.0.0.1 -U zabbixmaster -d zabbix -f /tmp/database/images.sql;
|
||||
psql -h 127.0.0.1 -U zabbixmaster -d zabbix -f /tmp/database/data.sql;
|
||||
EOH
|
||||
only_if { Dir.exist?('/tmp/database') }
|
||||
end
|
||||
|
||||
directory "cleanup" do
|
||||
path "/tmp/database"
|
||||
recursive true
|
||||
action :delete
|
||||
end
|
||||
|
||||
|
|
90
recipes/database_mysql.rb
Normal file
90
recipes/database_mysql.rb
Normal file
|
@ -0,0 +1,90 @@
|
|||
#
|
||||
# Cookbook Name:: zabbix
|
||||
# Recipe:: database_mysql
|
||||
#
|
||||
# Copyright 2017, Linux-Help.org
|
||||
# Authors:
|
||||
# Eric Renfro <psi-jack@linux-help.org>
|
||||
#
|
||||
|
||||
include_recipe 'chef-vault'
|
||||
|
||||
if not node['zabbix']['database']['backend'] == 'mysql'
|
||||
Chef::Application.fatal!('database_mysql, but backend is set differently.', 111)
|
||||
end
|
||||
|
||||
mysql_service 'zabbix' do
|
||||
port '3306'
|
||||
initial_root_password 'password'
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
directory '/tmp/database' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
action :create
|
||||
not_if "true"
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/schema.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/schema.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/schema.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/images.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/images.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/images.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/data.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/data.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/data.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
bash 'create_zabbix_db_user' do
|
||||
user 'postgres'
|
||||
sensitive true
|
||||
credentials = chef_vault_item("secrets", "zabbix")
|
||||
code <<-EOH
|
||||
psql -c "CREATE DATABASE zabbix WITH ENCODING='UTF-8';"
|
||||
psql -c "CREATE USER zabbix WITH PASSWORD '#{credentials['postgres']}';"
|
||||
psql -c "GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;"
|
||||
EOH
|
||||
action :nothing
|
||||
subscribes :run, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
bash 'initialize_zabbix_db' do
|
||||
sensitive true
|
||||
user 'postgres'
|
||||
code <<-EOH
|
||||
psql -d zabbix -f /tmp/database/schema.sql
|
||||
psql -d zabbix -f /tmp/database/images.sql
|
||||
psql -d zabbix -f /tmp/database/data.sql
|
||||
EOH
|
||||
action :nothing
|
||||
subscribes :run, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
directory "cleanup" do
|
||||
path "/tmp/database"
|
||||
recursive true
|
||||
action :nothing
|
||||
subscribes :delete, 'directory[/tmp/database]', :immediately
|
||||
end
|
97
recipes/database_postgresql.rb
Normal file
97
recipes/database_postgresql.rb
Normal file
|
@ -0,0 +1,97 @@
|
|||
#
|
||||
# Cookbook Name:: zabbix
|
||||
# Recipe:: database_postgresql
|
||||
#
|
||||
# Copyright 2017, Linux-Help.org
|
||||
# Authors:
|
||||
# Eric Renfro <psi-jack@linux-help.org>
|
||||
#
|
||||
|
||||
include_recipe 'chef-vault'
|
||||
|
||||
if node['zabbix']['database']['backend'] == 'postgresql'
|
||||
if node['zabbix']['database']['repo']['pgdg']
|
||||
node.default['postgresql']['enable_pgdg_apt'] = true
|
||||
node.default['postgresql']['enable_pgdg_yum'] = true
|
||||
node.default['postgresql']['version'] = "9.6"
|
||||
end
|
||||
node.default['postgresql']['pg_hba'] = [
|
||||
{ type: 'local', db: 'all', user: 'postgres', addr: nil, method: 'ident' },
|
||||
{ type: 'local', db: 'all', user: 'all', addr: nil, method: 'md5' },
|
||||
{ type: 'host', db: 'all', user: 'all', addr: '127.0.0.1/32', method: 'md5' },
|
||||
{ type: 'host', db: 'all', user: 'all', addr: '::1/128', method: 'md5' },
|
||||
]
|
||||
include_recipe 'postgresql::server'
|
||||
else
|
||||
Chef::Application.fatal!('database_postgresql, but backend is set differently.', 111)
|
||||
end
|
||||
|
||||
directory '/tmp/database' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
action :create
|
||||
not_if "sudo -u postgres psql -lqtA | grep -q '^zabbix'"
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/schema.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/schema.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/schema.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/images.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/images.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/images.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
cookbook_file '/tmp/database/data.sql' do
|
||||
source %W{
|
||||
host-#{node['fqdn']}/data.sql
|
||||
#{node['zabbix']['database']['backend']}/#{node['zabbix']['version']}/data.sql
|
||||
}
|
||||
backup false
|
||||
action :nothing
|
||||
subscribes :create, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
bash 'create_zabbix_db_user' do
|
||||
user 'postgres'
|
||||
sensitive true
|
||||
credentials = chef_vault_item("secrets", "zabbix")
|
||||
code <<-EOH
|
||||
psql -c "CREATE DATABASE zabbix WITH ENCODING='UTF-8';"
|
||||
psql -c "CREATE USER zabbix WITH PASSWORD '#{credentials['postgres']}';"
|
||||
psql -c "GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;"
|
||||
EOH
|
||||
action :nothing
|
||||
subscribes :run, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
bash 'initialize_zabbix_db' do
|
||||
sensitive true
|
||||
user 'postgres'
|
||||
code <<-EOH
|
||||
psql -d zabbix -f /tmp/database/schema.sql
|
||||
psql -d zabbix -f /tmp/database/images.sql
|
||||
psql -d zabbix -f /tmp/database/data.sql
|
||||
EOH
|
||||
action :nothing
|
||||
subscribes :run, 'directory[/tmp/database]', :immediately
|
||||
end
|
||||
|
||||
directory "cleanup" do
|
||||
path "/tmp/database"
|
||||
recursive true
|
||||
action :nothing
|
||||
subscribes :delete, 'directory[/tmp/database]', :immediately
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
# MANAGED BY CHEF, DO NOT MODIFY
|
||||
#
|
||||
# "local" is for Unix domain socket connections only
|
||||
local all all peer
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 md5
|
||||
host all all 10.10.2.0/16 md5
|
||||
# IPV6 local connections:
|
||||
host all all ::1/128 md5
|
5
test/fixtures/data_bags/secrets/zabbix.json
vendored
Normal file
5
test/fixtures/data_bags/secrets/zabbix.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"id": "zabbix",
|
||||
"postgres": "password",
|
||||
"server": "password"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "integration_test_env",
|
||||
"name": "test",
|
||||
"description": "placeholder for integration testing",
|
||||
"cookbook_versions": {
|
||||
|
Loading…
Reference in a new issue