Author: Vijay Khemka vijaykhemka@fb.com, Sui Chen suichen@google.com, Jagpal Singh Gill paligill@gmail.com
Created: 2020-05-04
The problem is to monitor the health of a system with a BMC so we have some means to make sure the BMC is working correctly. User can get required metrics data as per configurations instantly. Set of monitored metrics may include CPU and memory utilization, uptime, free disk space, I2C bus stats, and so on. Actions can be taken based on monitoring data to correct the BMC’s state.
For this purpose, there may exist a metric producer (the subject of discussion of this document), and a metric consumer (a program that makes use of health monitoring data, which may run on the BMC or on the host.) They perform the following tasks:
Among those tasks, 1), 2), and 3) are the producer’s responsibility. 4) is accomplished by both the producer and consumer. 5) is up to the consumer.
We realize there is some overlap between sensors and health monitoring in terms of design rationale and existing infrastructure. But there are also quite a few differences between sensors and metrics:
Based on above, it doesn't sound reasonable to use sensors for representing the metrics data.
References: dbus-monitor
The metric producer should provide
The metric consumer may be written in various different ways. No matter how the consumer is obtained, it should be able to obtain the health metrics from the producer through a set of interfaces.
The metric consumer is not in the scope of this document.
The metric producer is a daemon running on the BMC that performs the required tasks and meets the requirements above. As described above, it is responsible for
For 1) Configuration, the daemon will have a default in code configuration. Platform may supply a configuration file if it wants to over-ride the specific default attributes. The format for the JSON configuration file is as under -
"kernel" : { "Frequency" : 1, "Window_size": 120, "Type": "CPU", "Threshold": { "Critical": { "Value": 90.0, "Log": true, "Target": "reboot.target" }, "Warning": { "Value": 80.0, "Log": false, "Target": "systemd unit file" } } }, "available" : { "Frequency" : 1, "Window_size": 120, "Type": "Memory", "Threshold": { "Critical": { "Value": 90.0, "Log": true, "Target": "reboot.target" } } }
Frequency : It is time in second when these data are collected in regular interval. Window_size: This is a value for number of samples taken to average out usage of system rather than taking a spike in usage data. Log : A boolean value which allows to log an alert. This field is an optional with default value for this in critical is 'true' and in warning it is 'false'. Target : This is a systemd target unit file which will called once value crosses its threshold and it is optional. Type: This indicates the type of configuration entry. Possible values are Memory, CPU, Reboot, Storage.
For 2) Metric collection, this will be done by running certain functions within the daemon, as opposed to launching external programs and shell scripts. This is due to performance and security considerations.
For 3) Metric staging & disperse, the daemon creates a D-bus service named "xyz.openbmc_project.HealthManager". The design proposes new Metrics Dbus interfaces.
Interface Name | Purpose |
---|---|
xyz.openbmc_project.Metrics.Value | Interface to represent value for Metrics. |
xyz.openbmc_project.Metrics.Reset | Interface to reset persistent Metrics counters. |
xyz.openbmc_project.Common.Threshold | Interface to represent Metric thresholds and signals for threshold violations. |
Each metric will be exposed on a specific object path and above interfaces will be implemented at these paths. Reset Interfaces are optional and may only be implemented for persistent counters/intervals.
/xyz/openbmc_project |- /xyz/openbmc_project/metrics/bmc/memory/total |- /xyz/openbmc_project/metrics/bmc/memory/free |- /xyz/openbmc_project/metrics/bmc/memory/available |- /xyz/openbmc_project/metrics/bmc/memory/shared |- /xyz/openbmc_project/metrics/bmc/memory/buffered_and_cached |- /xyz/openbmc_project/metrics/bmc/cpu/user |- /xyz/openbmc_project/metrics/bmc/cpu/kernel |- /xyz/openbmc_project/metrics/bmc/reboot/count |- /xyz/openbmc_project/metrics/bmc/reboot/count_with_failure
Servers for Metrics Data
Interface Name | Interface Server | Info Source |
---|---|---|
Memory Utilization | phosphor-health-manager | /proc/meminfo |
CPU Utilization | phosphor-health-manager | /proc/stat |
Reboot Statistics | phosphor-state-manager | Persistent counters incremented based on reboot status |
Multiple devices of same type -
In case there are multiple devices of same type, the D-Bus path can be extended to add context about "which device". For example -
/xyz/openbmc_project/metrics/device-0/memory/total /xyz/openbmc_project/metrics/device-1/memory/total ...
These paths can be hosted by different daemons, for example, pldmd can host DBus paths for BICs if master BMC uses PLDM to communicate with BIC. The Value interface for each metric would need to be associated with the appropriate system inventory item.
We have tried doing health monitoring completely within the IPMI Blob framework. In comparison, having the metric collection part a separate daemon is better for supporting more interfaces.
We have also tried doing the metric collection task by running an external binary as well as a shell script. It turns out running shell script is too slow, while running an external program might have security concerns (in that the 3rd party program will need to be verified to be safe).
Collected: Collectd provides multiple plugins which allows to gather wide variety of metrics from various sources and provides mechanisms to store them in different ways. For exposing these metrics to DBus, a Collectd C plugin can be written.
Pros:
Cons:
Extend Metrics Dbus interface for -
Most of what the Health Monitoring Daemon does is to do metric collection and update DBus objects. The impacts of the daemon itself should be small.
The proposed design changes the DBus interface from Sensors to Metrics, so following daemons would need to refactored/updated to account for interface change -
No, changes will go into phosphor-health-monitor.
To verify the daemon is functioning correctly, monitor the DBus traffic generated by the Daemon and the metric values from Daemon’s DBus objects. Automated unit testing will be covered via GTest.
Manual end to end testing can be performed via Redfish GET for ManagerDiagnosticData. The end to end automated testing will be covered using openbmc-test-automation. To verify the performance aspect, we can stress-test the Daemon’s DBus interfaces to make sure the interfaces do not cause a high overhead.