sh 用于dmesg监控的Nagios插件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 用于dmesg监控的Nagios插件相关的知识,希望对你有一定的参考价值。

#!/bin/bash
# Source : http://lzone.de/blog/Nagios%20Plugin%20for%20dmesg%20Monitoring
SEVERITIES="err,alert,emerg,crit"
WHITELIST="microcode: |\
Firmware Bug|\
i8042: No controller|\
Odd, counter constraints enabled but no core perfctrs detected|\
Failed to access perfctr msr|\
echo 0 > /proc/sys"

# Check for critical dmesg lines from this day
date=$(date "+%a %b %e")
output=$(dmesg -T -l "$SEVERITIES" | egrep -v "$WHITELIST" | grep "$date" | tail -5)

if [ "$output" == "" ]; then
echo "All is fine."
exit 0
fi

echo "$output" | xargs
exit 1

以上是关于sh 用于dmesg监控的Nagios插件的主要内容,如果未能解决你的问题,请参考以下文章

nagios使用check_traffic.sh监控网卡流量

用于Nagios中监控elasticsearch健康状态脚本

Nagios监控系统环境部署

Nagios监控系统

nagios网卡流量监控 trffic.sh

Nagios下自带的check_mysql_query插件说明