nagios mail告警通知
nagios使用郵件來告警通知是很常見的一種方式。
1. 使用sendEmail來傳送郵件
sendEmail工具非常好用。具體內容參見:
2. 建立一個聯絡人
1 2 3 4 5 6 7 8 9 10 11 12 | # vim /usr/local/nagios/etc/objects/contacts.cfg define contact{ contact_name mobei alias mobei service_notification_period 24x7 host_notification_period 24x7 service_notification_options w,u,c host_notification_options d,u service_notification_commands notify-service-by-email host_notification_commands notify-host-by-email email 【You email address】 } |
3. 建立一個組
1 2 3 4 5 | define contactgroup{ contactgroup_name ops alias ops members mobei } |
4. 修改傳送郵件命令
1 2 3 4 5 6 7 8 9 10 11 12 | # vim /usr/local/nagios/etc/objects/commands.cfg # 'notify-host-by-email' command definition define command{ command_name notify-host-by-email command_line /usr/local/bin/sendEmail -l /tmp/sendEmail.log -f jiank@126.com -t $CONTACTEMAIL$ -s smtp.126.com -u "$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" -xu jiank@126.com -xp jiankong -m "Service: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$ State: $SERVICESTATE$\\nDate/Time: $SHORTDATETIME$\\nInfo:$SERVICEOUTPUT$" }
# 'notify-service-by-email' command definition define command{ command_name notify-service-by-email command_line /usr/local/bin/sendEmail -l /tmp/sendEmail.log -f jiank@126.com -t $CONTACTEMAIL$ -s smtp.126.com -u "$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" -xu jiank@126.com -xp jiankong -m "Service: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$ State: $SERVICESTATE$\\nDate/Time: $SHORTDATETIME$\\nInfo:$SERVICEOUTPUT$" } |
5. 指定監控專案。如:
1 2 3 4 5 6 7 | define service { use generic-service hostgroup_name Mongo Servers service_description Mongo Mapped Memory Usage check_command check_mongodb!10.0.0.160!12345!'ttlsa'!'www.ttlsa.com'!memory_mapped!20!28 contact_groups ops } |
相關文章
- prometheus + alertmanager 搭建告警通知Prometheus
- 快速實現釘釘告警通知、處理告警、關閉告警
- nagios 呼叫webhook 給微信發告警資訊iOSWebHook
- Dell OpenManage Essential 監控告警設定 - windows mailWindowsAI
- nagios 外掛引發的 資料庫告警iOS資料庫
- Oracle的OEM 郵件告警通知設定Oracle
- 如何實現告警的郵件通知方式?
- 運維告警管理—多渠道的通知必達運維
- Nagios傳送告警的幾個關鍵引數【轉】iOS
- 如何快速實現告警簡訊的通知方式?
- Zabbix實現電話告警通知的配置方法分享
- nagios提示linux主機磁碟空間不足,清空/var/spool/mail/rootiOSLinuxAI
- crontab執行結果未透過傳送mail通知使用者的方法AI
- IoT 邊緣叢集基於 Kubernetes Events 的告警通知實現
- mailAI
- Nagios 裡面監控MySQL 監控事務夯住(RUNNING)報警通知iOSMySql
- You have new mail in /var/spool/mail/rootAI
- Send MailAI
- mail with attachmentAI
- Mail To SyntaxAI
- System.Net.Mail和System.Web.MailAIWeb
- 163郵箱傳送郵件通知異常 org.springframework.mail.MailAuthenticationException: Authentication failedSpringFrameworkAIException
- cacti+nagios之nagios的搭建(三)iOS
- cacti+nagios 之cacti整合nagios(四)iOS
- oracle send mailOracleAI
- nagios 搭建iOS
- 告警與恢復告警原理及實現
- 22.Prometheus告警之Alertmanager告警(二)-手機電話加簡訊告警Prometheus
- nagios安裝配置pnp4nagios-0.6.6薦iOS
- IoT 邊緣叢集基於 Kubernetes Events 的告警通知實現(二):進一步配置
- Others_2_MailAI
- 6.12.MailAI
- drupal7 mailAI
- awr 自動mailAI
- utl_mail packageAIPackage
- 163mailAI
- nagios安裝iOS
- Nagios簡介iOS