php原生态开发公司网站,网页设计公司济南兴田德润优惠吗,网站开发模板免费下载,做的很好的淘宝客网站S.M.A.R.T.是Self-Monitoring, Analysis, and Reporting Technology的缩写#xff0c;它是一种硬盘自我监测、分析和报告技术。硬盘S.M.A.R.T.信息的主要用途是帮助用户和系统管理员监测硬盘的健康状态和性能#xff0c;例如温度、振动、读写错误率、坏道数量等Self-Monitoring, Analysis, and Reporting Technology的缩写它是一种硬盘自我监测、分析和报告技术。硬盘S.M.A.R.T.信息的主要用途是帮助用户和系统管理员监测硬盘的健康状态和性能例如温度、振动、读写错误率、坏道数量等同时对预测故障、数据恢复、性能监测具有重要作用。
因此监控硬盘S.M.A.R.T.信息对运维有着非常重要的意义本文将分享两种Zabbix监控硬盘S.M.A.R.T.信息的方法
方案一用Zabbix官方方案
Zabbix官网地址https://www.zabbix.com/cn/integrations/smart
操作步骤
1.安装Zabbix Agent 2Windows可以直接下载使用Linux需要通过参数-enable-agent2编译安装。
2.安装Smartmontools版本要求7.1。
3.Windows平台zabbix_agentd.conf需要增加配置定义smartctl的路径。
Plugins.Smart.PathC:\Program
Files\smartmontools\bin\smartctl.exe
方案二使用第三方方案
地址https://github.com/nikimaxim/zbx-smartmonitor
Windows系统
1.下载安装Smartmontools要求版本7.1下载地址https://builds.smartmontools.org/
2.检查PowerShell版本要求版本5.1打开PowerShell并执行该命令可查版本信息Get-Host|Select-Object Version
3.下载硬盘发现脚本smartctl-storage-discovery.ps1保存到C:\
4.在zabbix_agentd.conf添加自定义监控项
UserParameterstorage.discovery[*],powershell -NoProfile -ExecutionPolicy Bypass -File “C:\smartctl-storage-discovery.ps1”
UserParameterstorage.get[*],powershell -NoProfile -ExecutionPolicy Bypass -Command “if (”$1) { ‘C:\Program Files\smartmontools\bin\smartctl.exe’ -i -H -A -l error -l background $1}
UserParametersmartctl.version,powershell -NoProfile -ExecutionPolicy Bypass -Command “(( ‘C:\Program Files\smartmontools\bin\smartctl.exe’ --version | Where-Object {KaTeX parse error: Undefined control sequence: \s at position 20: …atch ^smartctl\̲s̲\d}) -ireplace…).Trim()”
5.下载监控模板Template smartmonitor.xml并导入
Linux系统
1.下载安装Smartmontools要求版本7.1下载地址https://builds.smartmontools.org/
2.下载硬盘发现脚本smartctl-storage-discovery.sh保存到/usr/local/sbin/
3.在zabbix_agentd.conf添加自定义监控项
UserParameterstorage.discovery[*],sudo /usr/local/sbin/smartctl-storage-discovery.sh
UserParameterstorage.get[*],if [ -n “$1” ]; then sudo /usr/sbin/smartctl -i -H -A -l error -l background $1; fi
UserParametersmartctl.version,/usr/sbin/smartctl --version | grep -Eo “^smartctl\s[0-9.[:space:]\r-]” | sed -e ‘s/^smartctl.//’
如果Zabbix Agent不是以root身份运行则需要visudo添加以下内容
Defaults:zabbix !requiretty
zabbix ALL(root) NOPASSWD: /usr/sbin/smartctl
zabbix ALL(root) NOPASSWD: /usr/local/sbin/smartctl-storage-discovery.sh
5.下载监控模板Template smartmonitor.xml并导入
相关问题
Zabbix Server升级到6.0 LTS后Linux客户端无法获取S.M.A.R.T.信息Agent日志提示
“storage.get[”/dev/sda -dsat] is not supported: Incorrect update interval.”
解决方案
检查第三方模板把自动发现规则里面监控项storage.get[“{#STORAGE.CMD}”]的“自定义时间间隔”删除。
以上就是这一期的Zabbix技术分享。
大家好我是乐乐关注我学习更多Zabbix使用小技巧如在Zabbix使用过程中碰到问题还可以到乐维社区进行留言提问。