sos.collector.clusters — Cluster Profiles¶
This is the class that cluster profiles should subclass in order to add support for different clustering technologies and environments to sos-collector.
A profile should at minimum define a package that indicates the node is configured for the type of cluster the profile is intended to serve and then additionally be able to return a list of enumerated nodes via the
dict) – The commons dict containing system information. The same as what is handed to
- option_list (
tuples) – Options supported by the profile, and set by the –cluster-option cmdline arg
- packages (
tuple) – What package(s) should this profile enable on
- sos_plugins (
list) – Which plugins to forcibly enable for node reports
- sos_plugin_options (
dict) – Plugin options to forcibly set for nodes
- sos_preset (
str) – A SoSReport preset to forcibly enable on nodes
- cluster_name (
str) – The name of the cluster type
Some clusters generate and/or deploy well-known and consistent SSH keys across environments. If this is the case, the cluster profile may call this command so that subsequent node connections will use that key rather than prompting the user for one or a password.
Note this will only function if collector is being run locally on the master node.
This may be overridden by clusters
This is called by sos collect on each cluster type that exists, and is meant to return True when the cluster type matches a criteria that indicates that is the cluster type is in use.
Only the first cluster type to determine a match is run
Trueif the cluster profile should be used, or
Used to retrieve command output from a (master) node in a cluster
- cmd (
str) – The command to run
- need_root (
bool) – Does the command require root privileges
The output and status of cmd
- cmd (
Format the returned list of nodes from a cluster into a known format. This being a list that contains no duplicates
Returns: A list of nodes, without extraneous entries from cmd output Return type:
SosNode()to retrieve the appropriate label from the cluster as set by
set_node_label()in the cluster profile.
Parameters: node (
str) – The name of the node to get a label for
Returns: The label to use for the node’s report Return type:
This MUST be overridden by a cluster profile subclassing this class
A cluster should use this method to return a list or string that contains all the nodes that a report should be collected from
Returns: A list of node FQDNs or IP addresses Return type:
This is used to by clusters to check if a cluster option was supplied to sos collect
Parameters: option (
str) – The name of the option to fetch
Returns: The value of the requested option if it exists, or
This may be overridden by clusters profiles subclassing this class
If there is a distinction between masters and nodes, or types of nodes, then this can be used to label the sosreport archive differently.
- option_list (