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 } |
相關文章
- nagios 呼叫webhook 給微信發告警資訊iOSWebHook
- prometheus + alertmanager 搭建告警通知Prometheus
- 快速實現釘釘告警通知、處理告警、關閉告警
- Oracle的OEM 郵件告警通知設定Oracle
- 運維告警管理—多渠道的通知必達運維
- 如何實現告警的郵件通知方式?
- Zabbix實現電話告警通知的配置方法分享
- 如何快速實現告警簡訊的通知方式?
- 163郵箱傳送郵件通知異常 org.springframework.mail.MailAuthenticationException: Authentication failedSpringFrameworkAIException
- crontab執行結果未透過傳送mail通知使用者的方法AI
- IoT 邊緣叢集基於 Kubernetes Events 的告警通知實現
- You have new mail in /var/spool/mail/rootAI
- Nagios安裝步驟iOS
- Send MailAI
- Nagios+PNP安裝部署iOS
- oracle send mailOracleAI
- Others_2_MailAI
- golang mail、shell、cookie、uuidGolangAICookieUI
- IoT 邊緣叢集基於 Kubernetes Events 的告警通知實現(二):進一步配置
- Cacti+Nagios監控平臺完美整合iOS
- CentOS原始碼安裝、配置Nagios(core)+PluginsCentOS原始碼iOSPlugin
- Nagios+Centreon監控系統簡介iOS
- 告警與恢復告警原理及實現
- 22.Prometheus告警之Alertmanager告警(二)-手機電話加簡訊告警Prometheus
- prometheus告警配置Prometheus
- Linux之郵件mail服務LinuxAI
- 2020-11-13 python和 mailPythonAI
- linux下mail的簡單用法LinuxAI
- 基於Spring Boot傳送 mailSpring BootAI
- linux 主機mail 系統配置.LinuxAI
- 監控系統:深度對比Zabbix、Nagios、Pandora FMSiOS
- 告警系統郵件引擎 執行告警系統
- (原創) odoo17中在訊息主題(mail.thread)中傳送訊息時,是否通知訊息作者進行控制OdooAIthread
- 通知
- 使用Nagios打造專業的業務狀態監控iOS
- Zoho mail 多樣化的使用技巧AI
- 配置mail使用SMTP傳送郵件AI
- javax.mail.MessagingException:[EOF] 解決方法JavaAIException