Linux 环境:Debian、Ubuntu、Centos
目标:
测试监控程序,在不同的cpu百分比下设置警报并触发不同的警报。
例如:(30-50%)、(51-70%) 和 >90%
所以我需要一个可以模拟每个核心特定 CPU 百分比的 CPU 压力器。
stress-mg看起来是最先进的。
根据其文档http://kernel.ubuntu.com/~cking/stress-ng/可以将负载值设置在 0 到 100% 之间:
-l P --cpu-load P 按 P % 加载 CPU,0=睡眠,100=满载(参见 -c)
stress-ng -c 1 -p 30
Run Code Online (Sandbox Code Playgroud)
压力 ng: 信息: [12650] 调度猪: 0 I/O-Sync, 1 CPU, 0 VM-mmap, 0 HDD-Write, 0 Fork, 0 Context-switch, 30 Pipe, 0 Cache, 0 Socket, 0 Yield, 0 Fallocate, 0 Flock, 0 Affinity, 0 Timer, 0 Dentry, 0 Urandom, 0 Float, 0 Int, 0 Semaphore, 0 …
要为Apache生成 SSL 证书文件,我使用以下命令:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.cert
Run Code Online (Sandbox Code Playgroud)
我用这些参数手动输入它:
Country Name(2 个字母代码)[AU]:AU
州或省名称(全名):Myname
[Some-State]:Some-State 地区
名称(例如,城市)[]:城市
组织名称(例如,公司)[互联网Widgits私人有限公司]:互联网
组织单位名称(例如,部分)[]:科
通用名称(如服务器FQDN或您的姓名)[]:提供yourname
电子邮件地址[]:email@gmail.com
是否可以使用选项从文件或直接从 OpenSSL 命令行输入它们?
OpenSSL 手册页中没有提示。
Exim 配置在新配置的 VM 上,该 VM 来自具有公共 IP 的公共云提供商 (scaleway.net)
能够从 CLI(或脚本)向公共目标收件人(gmail、yahoo 等)发送邮件
Exim4 日志文件/var/log/exim4/mainlog显示所有测试服务器(gmail、free.fr、online.net)的“连接超时”
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
Run Code Online (Sandbox Code Playgroud)
使用不同的 smtp 服务器进行测试:(gmail、free.fr、online.net)
cat /etc/exim4/update-exim4.conf.conf
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ …Run Code Online (Sandbox Code Playgroud) apache-2.4 ×1
cpu-usage ×1
exim ×1
linux ×1
openssl ×1
smtp ×1
ubuntu ×1
ubuntu-14.04 ×1
ubuntu-18.04 ×1