当前位置:网站首页>Netdata mail alarm configuration
Netdata mail alarm configuration
2022-06-29 13:13:00 【gsls200808】
Connected to a msmtp Service configuration When it's done , This article continues to configure email alerts
1. To configure netdata Mail to
/etc/netdata/edit-config health_alarm_notify.conf
Command similar vi i Enter edit mode , Edit finish esc Input :wq preservation
modify
DEFAULT_RECIPIENT_EMAIL="root" take root Change to email address , Multiple addresses are separated by spaces , Mail can be received |critical Alarm level , Such as
DEFAULT_RECIPIENT_EMAIL="[email protected] [email protected]|critical"The first email address receives all levels of alarms , The second email address receives critical Level alarm results .
2. To configure sendmail The path of is msmtp The path of
Modify the configuration
/etc/netdata/edit-config health_alarm_notify.conftake
sendmail=""Change to
sendmail="/usr/bin/msmtp"Test send
/usr/libexec/netdata/plugins.d/alarm-notify.sh test The first email address can receive 3 Messages , The second email address can receive 2 Messages , One more than the first warning mail .
3. use stress Pressure measurement cpu
install stress
yum install epel-release.noarch
yum install stress
Pressure measurement cpu
stress --cpu 1 --timeout 600
Here we use simulation 1 individual CPU Usage rate 100% Scene
1 yes cpu Check the number , Adjust according to your computer , Change the number of cores to a few , wait for 10 Minutes critical Level alarm .
common problem
1. After ten minutes, no email was sent to find the log
Log error message
msmtp: account default not found: no configuration file availabletake .msmtprc File permissions are changed to 644 And cut to /etc/msmtprc Under the table of contents , Don't copy , There will be configuration conflicts during replication
chmod 644 ~/.msmtprc
mv ~/.msmtprc /etc/msmtprc2. Log error message
msmtp: /etc/msmtprc: line 11: account default was already definedresolvent : take /root/.msmtprc File deletion , Only keep /etc/msmtprc file
3. belt |critical The alarm cannot be recovered clear mail
View log messages
touch: /var/cache/netdata/alarm-notify/email/[email protected]/1655974263: Permission deniedIf it is docker Environmental Science , take :/var/cache/netdata The directory is mapped out and solved
docker run Command addition
-v netdatacache:/var/cache/netdata \Full command
docker run -d --name=netdata \
-p 19999:19999 \
-v netdatacache:/var/cache/netdata \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdataActual alarm recovery clear The mail is half an hour late ,critical and warning There is no delay in the mail , The specific situation still needs further study .
Be careful : there -v netdatacache The use of docker Data volume , Do not use other directories such as ${PWD}/netdatacache Instead of , otherwise docker Can't start
5.docker Log and mail log time is utc
Check the related issue Find out ,netdata Will read /etc/localtime Configuration of , Just do the directory mapping
Add mapping
-v /etc/localtime:/etc/localtime:ro \Full command
docker run -d --name=netdata \
-p 19999:19999 \
-v netdatacache:/var/cache/netdata \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /etc/localtime:/etc/localtime:ro \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata边栏推荐
- ZALSM_ EXCEL_ TO_ INTERNAL_ Solving the big problem of importing data from table
- Hystrix断路器
- C#通过中序遍历对二叉树进行线索化
- Cvpr2022 | panopticdepth: a unified framework for depth aware panoramic segmentation
- Golang image/png processing image rotation writing
- Recurrence of recommended models (IV): multi task models esmm and MMOE
- Interview shock 61: tell me about MySQL transaction isolation level?
- 倍福控制器连接松下EtherCAT伺服注意事项
- Cnpm reports an error 'cnpm' is not an internal or external command, nor is it a runnable program or batch file
- mybaits入门(含实例教程和源码)
猜你喜欢

超 Nice 的表格响应式布局小技巧

CVPR2022 | 长期行动预期的Future Transformer

QT custom control: value range

三维模型下载与动画控制

如何計算win/tai/loss in paired t-test

别再重复造轮子了,推荐使用 Google Guava 开源工具类库,真心强大!

MATLAB求极限

CVPR2022 | 重新审视池化:你的感受野不是最理想的

Cvpr2022 | reexamine pooling: your receptive field is not the best

SCHIEDERWERK电源维修SMPS12/50 PFC3800解析
随机推荐
从零搭建Pytorch模型教程(五)编写训练过程--一些基本的配置
倍福PLC通过CANOpen通信控制伺服
Cvpr2022 | panopticdepth: a unified framework for depth aware panoramic segmentation
Cvpr2022 | knowledge distillation through target aware transformer
hutool工具类的学习(持续更新)
树状数组应用(AcWing 242,243,244)
Comparison table of LR and Cr button batteries
如何計算win/tai/loss in paired t-test
Precautions for Beifu controller connecting Panasonic EtherCAT servo
Async principle implementation
强大、优秀的文件管理软件评测:图片管理、书籍管理、文献管理
netdata邮件告警配置
qt 自定义控件 :取值范围
C # implementation of binary tree non recursive middle order traversal program
Matlab to find the limit
Interview shock 61: tell me about MySQL transaction isolation level?
编写一个shell脚本,求一个数的”逆序数“
C#通過中序遍曆對二叉樹進行線索化
[intelligent QBD risk assessment tool] Shanghai daoning brings you leanqbd introduction, trial and tutorial
Deep understanding of volatile keyword