瀏覽代碼

some monit fixes. add fail2ban monit dist conf file and rootfs check. dont generate invalid password.

Thomas Buck 5 年之前
父節點
當前提交
21f6ac8d7e
共有 2 個檔案被更改,包括 11 行新增2 行删除
  1. 1
    1
      roles/monitoring/defaults/main.yml
  2. 10
    1
      roles/monitoring/templates/etc_monit_monitrc.j2

+ 1
- 1
roles/monitoring/defaults/main.yml 查看文件

@@ -4,7 +4,7 @@ secret: '{{ secret_root + "/" + secret_name }}'
4 4
 
5 5
 # must match values in roles/common
6 6
 monit_admin_username: "{{ main_user_name }}"
7
-monit_admin_password: "{{ lookup('password', secret + '/' + 'monit_admin_password length=16') }}"
7
+monit_admin_password: "{{ lookup('password', secret + '/' + 'monit_admin_password length=16 chars=hexdigits') }}"
8 8
 
9 9
 monit_page_public: 1
10 10
 monit_subdomain: status

+ 10
- 1
roles/monitoring/templates/etc_monit_monitrc.j2 查看文件

@@ -224,6 +224,14 @@ set httpd port 2812 and
224 224
 #    if inode usage > 99% then stop
225 225
 #    group server
226 226
 #
227
+
228
+check filesystem rootfs with path /
229
+    if space usage > 80% for 5 times within 15 cycles then alert
230
+    if space usage > 99% then alert
231
+    if inode usage > 80% for 5 times within 15 cycles then alert
232
+    if inode usage > 99% then alert
233
+    group server
234
+
227 235
 #
228 236
 ## Check a file's timestamp. In this example, we test if a file is older
229 237
 ## than 15 minutes and assume something is wrong if its not updated. Also,
@@ -266,5 +274,6 @@ set httpd port 2812 and
266 274
 ## It is possible to include additional configuration parts from other files or
267 275
 ## directories.
268 276
 #
269
-   include /etc/monit/conf.d/*
270 277
 
278
+include /etc/monit/conf.d/*
279
+include /etc/monit/monitrc.d/*

Loading…
取消
儲存