mcelog.triggers(5)

✨ mcelog.triggers β€” the trigger scripts reference (section 5, File Formats Manual bestie) ✨

okay so. you found the mcelog.triggers(5) page and honestly? iconic of you. this is the file formats manual, section 5, and it's all about the little scripts that fire off when your memory is going through it. let's get into it πŸ’…


🌸 NAME 🌸

mcelog.triggers β€” the mcelog trigger scripts reference, aka the group chat where your errors report in


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole squad, living rent-free in /etc/mcelog:

/etc/mcelog/bus-error-trigger
/etc/mcelog/cache-error-trigger
/etc/mcelog/dimm-error-trigger
/etc/mcelog/iomca-error-trigger
/etc/mcelog/page-error-trigger
/etc/mcelog/socket-memory-error-trigger
/etc/mcelog/unknown-error-trigger

πŸ’– DESCRIPTION πŸ’–

so mcelog(8) keeps track of error thresholds using a leaky-bucket algorithm β€” yes bestie, a bucket, with a leak, it's giving plumbing but make it math πŸͺ£βœ¨ When the number of errors inside a specific time window goes over a pre-configured threshold, a trigger gets executed. Triggers are usually shell scripts chilling in the /etc/mcelog directory, but they can also be other internal actions. Thresholds and triggers get configured in mcelog.conf(5).

The trigger runs as whatever user you configured for mcelog in mcelog.conf, and by default that's root πŸ‘‘. You can override the default trigger action by specifying a different trigger script in the configuration file. Wanna do extra stuff on top of the default trigger (like, oh I don't know, notifying an admin)? Drop it into the respective /etc/mcelog/*.local script, which runs after the default action. That way you can update the default scripts without steamrolling your local actions. Also β€” all trigger actions get logged to syslog. every single one. no secrets here πŸ”₯

🧚 The DIMM and socket memory error triggers 🧚

The /etc/mcelog/dimm-error-trigger and /etc/mcelog/socket-memory-error-trigger scripts get executed when a DIMM or a CPU socket exceeds a configured corrected or uncorrected memory error threshold. Those thresholds live in the mcelog.conf [dimm] and [socket] sections. The default triggers just log a warning message in the system log. Important: these triggers are only executed when mcelog runs as a daemon.

Arguments are passed as environment variables:

  • THRESHOLD β€” human readable threshold status
  • MESSAGE β€” Human readable consolidated error message
  • TOTALCOUNT β€” total corrected or uncorrected count of errors for current DIMM, 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

After the default action, local actions in /etc/mcelog/dimm-error-trigger.local or the respective /etc/mcelog/socket-memory-error-trigger.local are executed.

πŸŽ€ The page error trigger πŸŽ€

The /etc/mcelog/page-error-trigger script is executed by mcelog in daemon mode when a page in memory exceeds a pre-configured corrected or uncorrected error threshold. mcelog internally also implements offlining the page through the kernel. This is configured through the [page] section of mcelog.conf(5).

The environment arguments are the same as for the dimm-error-trigger script.

After the default action, local actions in /etc/mcelog/page-error-trigger.loccal are executed.

πŸ’œ The cache error trigger πŸ’œ

The /etc/mcelog/cache-error-trigger shell script is called for cache error handling in daemon mode when a CPU reports excessive corrected cache errors. This could be a indication for future uncorrected errors πŸ‘€

This trigger is configured through the [cache] section in the mcelog.conf(5) configuration file. The threshold is defined by the CPU. The default trigger offlines the affected CPU cores, unless it is the last core running.

Arguments are passed as environment variables:

  • MESSAGE β€” Human readable error message
  • CPU β€” Linux CPU number that triggered the error
  • LEVEL β€” Cache level affected by error
  • TYPE β€” Cache type affected by error (Data, Instruction, Generic)
  • AFFECTED_CPUS β€” List of CPUs sharing the affected cache
  • SOCKETID β€” Socket ID of affected CPU

After the default action, local actions in /etc/mcelog/cache-error-trigger.local are executed.

🌈 The bus-uc-threshold-trigger 🌈

The bus-uc-threshold-trigger runs on uncorrected errors on a IO bus. It is configured through the bus-uc-threshold-trigger and bus-uc-threshold-trigger-threshold options in /etc/mcelog.conf(5). By default it logs a message with the error location to the system log. After the default action, local actions in /etc/mcelog/bus-uc-error-trigger.local are executed.

Arguments are passed as environment variables:

  • MESSAGE β€” Human readable consolidated error message.
  • LOCATION β€” Consolidated location as a single string
  • SOCKETID β€” Socket ID of CPU that includes the memory controller with the DIMM
  • LEVEL β€” Interconnect level
  • PARTICIPATION β€” Processor Participation (Originator, Responder or Observer)
  • REQUEST β€” Request type (read, write, prefetch, etc.)
  • ORIGIN β€” Memory or IO
  • TIMEOUT β€” The request timed out or not

πŸ’… The iomca-error-trigger πŸ’…

The iomca-error-trigger runs when a socket receives bus or interconnect errors. It is configured through the iomca-error-trigger and iomca-error-trigger-threshold options in /etc/mcelog.conf. By default it logs a message with the error location to the system log. After the default action, local actions in /etc/mcelog/iomca-error-trigger.local are executed.

Arguments are passed as environment variables:

  • MESSAGE β€” Human readable consolidated error message
  • LOCATION β€” Consolidated location as a single string
  • SOCKETID β€” Socket ID of CPU that includes the memory controller with the DIMM
  • CPU β€” Linux CPU number that triggered the error
  • SET β€” PCI segment number
  • BUS β€” PCI bus number
  • DEVICE β€” PCI device number
  • FUNCTION β€” PCI function number

⭐ The unknown-error-trigger ⭐

The unknown-error-trigger runs on any errors not otherwise categorized. It is configured through the unknown-error-trigger and unknown-error-trigger-threshold options in /etc/mcelog.conf. By default it logs a message to the system log. After the default action, local actions in /etc/mcelog/unknown-error-trigger.local are executed.

Arguments are passed as environment variables:

  • MESSAGE β€” Human readable consolidated error message
  • LOCATION β€” Consolidated location as a single string
  • SOCKETID β€” Socket ID of CPU that includes the memory controller with the DIMM
  • CPU β€” Linux CPU number that triggered the error
  • STATUS β€” IA32_MCi_STATUS register value
  • ADDR β€” IA32_MCi_ADDR register value
  • MISC β€” IA32_MCi_MISC register value
  • MCGSTATUS β€” IA32_MCG_STATUS register value
  • MCGCAP β€” IA32_MCG_CAP register value

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie 🫢 this came straight out of the mcelog manual β€” section 5, mcelog.triggers(5) β€” so if you see it floating around anywhere, that's where it lives. go forth and configure your triggers responsibly πŸ’–βœ¨πŸŽ€