Olhando para o arquivo de configuração mcelog.conf
de amostra, ele parece conter a maioria, se não todos, os tipos de gatilhos com os quais ele pode lidar.
DIMMs
[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
Soquetes
[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
[cache]
# Processing of cache error thresholds reported by Intel CPUs
cache-threshold-trigger = cache-error-trigger
Página
[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
Disparadores
Os acionadores podem ser controlados nesta seção.
[trigger]
# Maximum number of running triggers
children-max = 2
# execute triggers in this directory
directory = /etc/mcelog
Gatilhos de amostra
Existem alguns exemplos de gatilhos aqui na página do mithog github.
Script de disparo de amostra, 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