告警系統配置文件
- shell項目-告警系統mon.conf內容
- 配置文件(必定要放到conf目錄下,名稱必須爲mon.conf ——PS:不能隨意改動,由於在主腳本中已經設置好了)
- 定義一些開關,定義一些對應的日誌路徑,或者說監控mysql的用戶名和密碼,以及IP地址port端口等
[root@hf-01 bin]# pwd
/usr/local/sbin/mon/bin
[root@hf-01 bin]# cd ..
[root@hf-01 mon]# vim conf/mon.conf
## to config the options if to monitor
## 定義mysql的服務器地址、端口以及user、password
to_mon_cdb=0
##cdb等於0 or 1, default 0,0 not monitor, 1 monitor
db_ip=10.20.3.13
db_port=3315
db_user=username
db_pass=passwd
## httpd 若是是1則監控,爲0不監控
to_mon_httpd=0
## php 若是是1則監控,爲0不監控
to_mon_php_socket=0
## http_code_502 須要定義訪問日誌的路徑
to_mon_502=1
logfile=/data/log/xxx.xxx.com/access.log
## request_count 定義日誌路徑以及域名
to_mon_request_count=0
req_log=/data/log/www.discuz.net/access.log
domainname=www.discuz.net
- 把請求日誌摘出來的目的,你要考慮到要想把shell寫得規範化,標準化,那你確定要考慮監控的機器確定不止1臺;要想要讓腳本通用,兼容性很強,就須要把全部須要監控的服務的日誌都載入到配置文件中,改動起來方便,免得後期改動起來一個一個的對應腳本去修改,就太麻煩了