Sensu:配置检查项
配置监控项:
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 |
[root@zabbix conf.d]# pwd /etc/sensu/conf.d [root@zabbix conf.d]# [root@zabbix conf.d]# ls -ltr total 24 -rw-r--r-- 1 root root 73 Sep 5 16:25 api.json -rw-r--r-- 1 root root 63 Sep 5 16:26 redis.json -rw-r--r-- 1 root root 136 Sep 5 16:27 rabbitmq.json -rw-r--r-- 1 root root 274 Sep 5 17:27 check_cpu_linux.json -rw-r--r-- 1 root root 305 Sep 5 17:28 check_disk_usage_linux.json -rw-r--r-- 1 root root 317 Sep 5 17:28 check_memory_linux.json [root@zabbix conf.d]# [root@zabbix conf.d]# cat check_* { "checks": { "check-cpu-linux": { "handlers": ["mailer"], "command": "/opt/sensu/embedded/bin/check-cpu.rb -w 80 -c 90 ", "interval": 60, "occurrences": 5, "subscribers": [ "linux" ] } } } { "checks": { "check-disk-usage-linux": { "handlers": ["mailer"], "type": "metric", "command": "/opt/sensu/embedded/bin/check-disk-usage.rb", "interval": 60, "occurrences": 5, "subscribers": [ "linux" ] } } } { "checks": { "check_memory_linux": { "handlers": ["mailer"], "command": "/opt/sensu/embedded/bin/check-memory-percent.rb -w 80 -c 90 ", "interval": 60, "occurrences": 5, "refresh": 1800, "subscribers": [ "linux" ] } } } [root@zabbix conf.d]# |
安装模块:
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 |
[root@zabbix conf.d]# sensu-install -p cpu-checks [SENSU-INSTALL] installing Sensu plugins ... [SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-cpu-checks' is already installed ... true [SENSU-INSTALL] Sensu gem 'sensu-plugins-cpu-checks' has already been installed [SENSU-INSTALL] Sensu plugin gems to be installed: [] [SENSU-INSTALL] successfully installed Sensu plugins: [] [root@zabbix conf.d]# [root@zabbix conf.d]# sensu-install -p disk-checks [SENSU-INSTALL] installing Sensu plugins ... [SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-disk-checks' is already installed ... true [SENSU-INSTALL] Sensu gem 'sensu-plugins-disk-checks' has already been installed [SENSU-INSTALL] Sensu plugin gems to be installed: [] [SENSU-INSTALL] successfully installed Sensu plugins: [] [root@zabbix conf.d]# [root@zabbix conf.d]# sensu-install -p memory-checks [SENSU-INSTALL] installing Sensu plugins ... [SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-memory-checks' is already installed ... false [SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-memory-checks"] [SENSU-INSTALL] installing Sensu gem 'sensu-plugins-memory-checks' Fetching: sensu-plugins-memory-checks-3.2.0.gem (100%) You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu Successfully installed sensu-plugins-memory-checks-3.2.0 1 gem installed [SENSU-INSTALL] successfully installed Sensu plugins: ["sensu-plugins-memory-checks"] [root@zabbix conf.d]# |
重启SENSU
服务端:
1 2 3 4 5 6 |
[root@zabbix conf.d]# service sensu-server restart Redirecting to /bin/systemctl restart sensu-server.service [root@zabbix conf.d]# [root@zabbix conf.d]# service sensu-api restart Redirecting to /bin/systemctl restart sensu-api.service [root@zabbix conf.d]# |
客户端:
[[……]