-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzabbix_server
113 lines (94 loc) · 2.43 KB
/
zabbix_server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
基于Postgresql 的Zabbix_server安装
安装步骤:
1.rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
2. yum install zabbix-server-pgsql zabbix-web-pgsql zabbix-agent
3.创建postgresql 的zabbix 用户
createuser -P -s -e zabbix
CREATE DATABASE zabbix OWNER zabbix;
GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;
zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | psql -Uzabbix zabbix
4.创建用户zabbix
adduser zabbix
passwd zabbix
5.更改/etc/php.ini的配置
6.修改zabbix/conf下的zabbix.conf.php DB改为:POSTGRESQL
cp -a /usr/share/zabbix/* /var/www/html/zabbix
chown -R apache:apache /var/www/html/zabbix
7.更改zabbix.conf配置
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
8.启动httpd
9.启动zabbix_agent zabbix_server
logstash.conf配置
input {
12 file {
13 path => ["/home/ruishi/log/fas.log","/home/ruishi/log/das.log"]
14 #start_position => "beginning"
15 stat_interval => "2"
16 }
17 }
18
19 filter {
20 if [message] !~ "error|ERROR|Exception" {
21 ruby {
22 code => "event.cancel"
23 }
24 }
25 }
26
27 output {
28 elasticsearch {
29 hosts => ["http://localhost:9200"]
30 index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
31 #user => "elastic"
32 #password => "changeme"
33 }
34 stdout { codec => rubydebug }
35 }
elk sentinl 邮件配置
{
"actions": {
"Email_alarm_26c3072f-c8f5-42db-ac47-bf38dbc20d98": {
"name": "Email alarm",
"throttle_period": "2m",
"email": {
"priority": "high",
"stateless": false,
"body": "event:{{payload.hits.total}} errorMsgConent:{{payload.hits.hits.0._source.message}}",
"to": [
],
"from": "[email protected]",
"subject": "Sentinl Alarm"
}
}
},
"input": {
"search": {
"request": {
"index": [
"%{[@metadata][beat]}-%{[@metadata][version]}-2018.11.14"
],
"body": {}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total >= 20"
}
},
"trigger": {
"schedule": {
"later": "every 30 minutes"
}
},
"disable": false,
"report": false,
"title": "errorlog",
"save_payload": false,
"spy": false,
"impersonate": false
}