https://prometheus.io/download/
目前創(chuàng)新互聯(lián)公司已為上千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬空間、網(wǎng)站托管、服務(wù)器租用、企業(yè)網(wǎng)站設(shè)計(jì)、鄂州網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。1.原理圖
2.安裝
tar?xf?alertmanager-0.19.0.linux-amd64.tar.gz???-C??/usr/local/alertmanager cd???/usr/local/alertmanager 修改配置: [root@zabbix-proxy?alertmanager]#?cat?alertmanager.yml? global: ??resolve_timeout:?5m ??smtp_smarthost:?'smtp.163.com:25' ??smtp_from:?'ww673004768@163.com' ??smtp_auth_username:?'ww673004768@163.com' ??smtp_auth_password:?'123456' ??smtp_require_tls:?false route: ??group_by:?['alertname'] ??group_wait:?10s ??group_interval:?10s ??repeat_interval:?1h ??receiver:?'email' receivers: -?name:?'email' ??email_configs: ??-?to:?'w673004768@163.com' inhibit_rules: ??-?source_match: ??????severity:?'critical' ????target_match: ??????severity:?'warning' ????equal:?['alertname',?'dev',?'instance'] [root@zabbix-proxy?alertmanager]#? 校驗(yàn)配置: [root@zabbix-proxy?alertmanager]#?./amtool?check-config?./alertmanager.yml? Checking?'./alertmanager.yml'??SUCCESS Found: ?-?global?config ?-?route ?-?1?inhibit?rules ?-?1?receivers ?-?0?templates [root@zabbix-proxy?alertmanager]#?pwd /usr/local/alertmanager [root@zabbix-proxy?alertmanager]#3.systemd管理 alertmanager
[root@zabbix-proxy?alertmanager]#?cat?/usr/lib/systemd/system/alertmanager.service? [Unit]? Description=Alertmanager? After=network.target? [Service]? Type=simple? User=root ExecStart=/usr/local/alertmanager/alertmanager?--config.file=/usr/local/alertmanager/alertmanager.yml?--storage.path=/usr/local/alertmanager/data Restart=on-failure [Install]? WantedBy=multi-user.target You?have?new?mail?in?/var/spool/mail/root [root@zabbix-proxy?alertmanager]#4.設(shè)置prometheus的配置
vim? prometheus.yml
?./promtool? ?check? config? prometheus.yml? 校驗(yàn)配置文件 并重啟
5.查看報(bào)警配置rule
[root@zabbix-proxy?rules]#?cat?general.yml? groups: -?name:?general ??rules: ??-?alert:?InstanceDown ????expr:?up?==?0 ????for:?1m? ????labels: ??????severity:?error ????annotations: ??????summary:?"Instance?{{?$labels.instance?}}?down"? ??????description:?"{{?$labels.instance?}}?of?job?{{?$labels.job?}}?has?been?down?for?more?than?1?minutes."? [root@zabbix-proxy?rules]#?pwd /usr/local/prometheus/rules [root@zabbix-proxy?rules]#6.測(cè)試
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。