Sensu 모니터링 설정
5577 단어 Sensu
http://sensuapp.org/docs/0.16/adding_a_check
sensu-Plugin 설치
# gem install sensu-plugin --no-rdoc --no-ri
모니터링 스크립트 다운로드# wget -O /etc/sensu/plugins/check-procs.rb https://raw.github.com/sensu/sensu-community-plugins/master/plugins/processes/check-procs.rb
# chmod 755 /etc/sensu/plugins/check-procs.rb
subscriptions 구성※ name/address를 적절히 수정
# vi /etc/sensu/conf.d/client.json
/etc/sensu/conf.d/client.json{
"client": {
"name": "Sensu-Client",
"address": "192.168.xxx.xxx",
- "subscriptions": [ "all" ]
+ "subscriptions": [ "webservers" ]
}
}
서버 측 설정정의 설정 모니터링
# vi /etc/sensu/conf.d/check_cron.json
/etc/sensu/conf.d/check_cron.json{
"checks": {
"cron_check": {
"handlers": ["default"],
"command": "/etc/sensu/plugins/check-procs.rb -p crond -C 1 ",
"interval": 60,
"subscribers": [ "webservers" ]
}
}
}
Sensu 재부팅클라이언트
# service sensu-client restart
서버 측# service sensu-server restart
# service sensu-api restart
로그 확인클라이언트
# grep cron_check /var/log/sensu/sensu-client.log
{"timestamp":"2015-01-19T21:51:48.042368+0900","level":"info","message":"received check request","check":{"name":"cron_check","issued":1421671843,"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 "}}
{"timestamp":"2015-01-19T21:51:48.129277+0900","level":"info","message":"publishing check result","payload":{"client":"Sensu-Client","check":{"name":"cron_check","issued":1421671843,"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 ","executed":1421671908,"duration":0.086,"output":"CheckProcs OK: Found 1 matching processes; cmd /crond/\n","status":0}}}
서버 측# grep cron_check /var/log/sensu/sensu-server.log
{"timestamp":"2015-01-19T21:51:43.444922+0900","level":"info","message":"publishing check request","payload":{"name":"cron_check","issued":1421671903,"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 "},"subscribers":["webservers"]}
고장 검측 확인크롬을 멈춰봐
# service crond stop
Dashboard 확인http://<Server IP>:3000/#/events
클라이언트 로그 확인
# grep cron_check /var/log/sensu/sensu-client.log | tail -2
{"timestamp":"2015-01-19T21:58:03.577208+0900","level":"info","message":"received check request","check":{"name":"cron_check","issued":1421672203,"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 "}}
{"timestamp":"2015-01-19T21:58:03.663127+0900","level":"info","message":"publishing check result","payload":{"client":"Sensu-Client","check":{"name":"cron_check","issued":1421672203,"command":"/etc/sensu/plugins/check-procs.rb -p crond -C 1 ","executed":1421672283,"duration":0.086,"output":"CheckProcs CRITICAL: Found 0 matching processes; cmd /crond/\n","status":2}}}
Reference
이 문제에 관하여(Sensu 모니터링 설정), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/rasaka/items/0f5e37fe2e8278720b81텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)