mcelogの書き込みトリガ

mcelogの書き込みトリガ

私は最初にこの研究を始めましたmcelog(私は以前にアクティブにしてsyslog出力を見たことがありますが、デフォルトではない作業を試みることは今回が初めてです)。トリガーの作成方法に関する情報を探しています。具体的には、mcelogどのタイプのイベントに反応できるか、実行するスクリプトをどのように決定するかを探しています。トリガの例で得られる最善の点は、スクリプトを呼び出す前に複数の環境変数を設定することです。それでは、トリガーディレクトリ(RHELにあります)のすべてのエントリを実行し、/etc/mcelogスクリプトに必要なアクションを決定させますか?

MCEイベントのように見える名前を持つ他のトリガースクリプトを見たことがあります。これはルールですか、それとも特別な機能ですか?/etc/mcelog/joel.sh私のGmailアカウントにデフォルトのメールを送信するトリガーを作成しました。数日前、スクリプトを手動で実行せずにスクリプトから電子メールを受信したため、トリガーが発生したようです。env出力をコマンドmailxにパイプするつもりはなかったので、どのハードウェアイベントがスクリプトの実行を促したのか、なぜスクリプトとして実行することを選択したのかわかりませjoel.shん。mcelogjoel.sh

mcelog基本的に、私はトリガーシステムが何であるか、そしてそれを使ってハードウェアの状態を監視する方法についての基本的な方向性を提示することができる答えを探しています。慣れれば、より進化した内容を把握できると確信しています。

ベストアンサー1

サンプル構成ファイルを見ると、mcelog.conf処理できるトリガーの種類がすべてではなくても、ほとんど含まれているようです。

DIMM

[dimm]
#
# execute these triggers when the rate of corrected or uncorrected
# errors per DIMM exceeds the threshold
# Note when the hardware does not report DIMMs this might also
# be per channel
# The default of 10/24h is reasonable for server quality·
# DDR3 DIMMs as of 2009/10
#uc-error-trigger = dimm-error-trigger
uc-error-threshold = 1 / 24h
#ce-error-trigger = dimm-error-trigger
ce-error-threshold = 10 / 24h

ソケット

[socket]
# Threshold and trigger for uncorrected memory errors on a socket
# mem-uc-error-trigger = socket-memory-error-trigger
mem-uc-error-threshold = 100 / 24h
# Threshold and trigger for corrected memory errors on a socket
mem-ce-error-trigger = socket-memory-error-trigger
mem-ce-error-threshold = 100 / 24h

隠れ家

[cache]
# Processing of cache error thresholds reported by Intel CPUs
cache-threshold-trigger = cache-error-trigger

ページ

[page]
# Memory error accouting per 4K memory page
# Threshold for the correct memory errors trigger script
memory-ce-threshold = 10 / 24h
# Trigger script for corrected errors
# memory-ce-trigger = page-error-trigger

トリガー

このセクションではトリガーを制御できます。

[trigger]
# Maximum number of running triggers
children-max = 2
# execute triggers in this directory
directory = /etc/mcelog

トリガーの例

持ついくつかの例のトリガーmcelog githubページから。

トリガスクリプトの例dimm-error-triggers:

#!/bin/sh
#  This shell script can be executed by mcelog in daemon mode when a DIMM
#  exceeds a pre-configured error threshold
# 
# environment:
# THRESHOLD     human readable threshold status
# MESSAGE   Human readable consolidated error message
# TOTALCOUNT    total count of errors for current DIMM of CE/UC depending on
#       what triggered the event
# LOCATION  Consolidated location as a single string
# DMI_LOCATION  DIMM location from DMI/SMBIOS if available
# DMI_NAME  DIMM identifier from DMI/SMBIOS if available
# DIMM      DIMM number reported by hardware
# CHANNEL   Channel number reported by hardware
# SOCKETID  Socket ID of CPU that includes the memory controller with the DIMM
# CECOUNT   Total corrected error count for DIMM
# UCCOUNT   Total uncorrected error count for DIMM
# LASTEVENT Time stamp of event that triggered threshold (in time_t format, seconds)
# THRESHOLD_COUNT Total umber of events in current threshold time period of specific type
#
# note: will run as mcelog configured user
# this can be changed in mcelog.conf

logger -s -p daemon.err -t mcelog "$MESSAGE"
logger -s -p daemon.err -t mcelog "Location: $LOCATION"

[ -x ./dimm-error-trigger.local ] && . ./dimm-error-trigger.local

exit 0

引用する

おすすめ記事