collectd icon indicating copy to clipboard operation
collectd copied to clipboard

Redfish plugin: complete rework and enhancement

Open matsKNY opened this issue 3 years ago • 1 comments

ChangeLog: Redfish plugin: complete rework and enhancement

The Redfish plugin of Collectd was, in the facts, unusable. Indeed, it suffered from several heavy limitations which made it impossible to monitor standard "recent" IT components (such as HPC compute blades):

  • Only members of anonymous collections could be collected;
  • Those members had to have a DeviceName attribute (this criteria was hard-coded and, thus, not configurable). The value of this attribute was compulsorily the type instance associated with the metric;
  • There was no way to select/filter which members of an anonymous collection should be collected;
  • The plugin could generate segmentation errors, and induced memory leaks;
  • The test suite and the documentation associated with the plugin were greatly incomplete.

Consequently, the Redfish plugin of Collectd was refactored and extensively enhanced to make it possible and easy to monitor metrics and collect information exposed by Redfish interfaces.

Hereinbelow are the main features of this refined Redfish plugin, when compared to its previous implementation:

  • Attributes of any Redfish resource, together with attributes of non-nested composite objects, and attributes of members of non-nested anonymous collections can be collected (without any constraint on their attributes);
  • Possibility to select members of anonymous collections to be monitored based on their IDs, the fact that they have specific attributes, and/or the values of those attributes;
  • Possibility to prefix the type instance of a member of an anonymous collection with its ID in the collection;
  • Possibility to use the value of a configurable attribute of the members of an anonymous collection as their type instances;
  • As a result, by combining the two previous features, it is even possible to use an attribute for which the values exhibited by the members of the anonymous collection are not unique to define the type instance of the associated metrics, without any risk of overwriting;
  • The source of segmentation errors and memory leaks within the plugin were corrected (though, there are still some memory leaks which seems unrelated to the plugin);
  • A complete and effective test suite, based on an up-to-date mockup Redfish interface developed by the DMTF, was implemented;
  • A thorough documentation of the plugin was written.

On top of that, the function oconfig_print_tree, which prints the oconfig configuration tree which root was specified, was implemented. The latter is effectively compiled in liboconfig only if the debug mode of Collectd is enabled.

matsKNY avatar Nov 22 '21 16:11 matsKNY

Hello,

To begin with, I had created two PRs which were not compliant with the contribution rules and CI/CD checks. I hence closed them and asked for their deletions. I don't know what is the standard process for Collectd, but in the company I am currently working for, a PR which does not abide by the contribution rules or is rejected by the CI/CD checks is ignored and deleted.

Then, I am sorry to submit such a "pretty big" PR. If necessary, I might be able to split it in several PRs, but the latter would not be of approximately equal sizes (the main one will most probably remain voluminous).

For the testing part, the configuration trees to be read and translated into data structures specific to the Redfish plugin, and the Redfish payloads associated with the test requests, were inserted into the test file. I did so for two reasons:

  • To make the tests "autonomous" and "self-contained";
  • It seemed to be the usual way to implement tests in Collectd (i.e. no dependencies to other files and/or services such as a Redfish interface).

I hope the work done to update and enhance the Redfish plugin of Collectd will be useful to the community.

matsKNY avatar Nov 22 '21 16:11 matsKNY