Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Prometheus Textfile Collector Script for Multipathd
Title: Add script
multipathd_exporter.sh
to collect multipathd metrics for PrometheusDescription:
This pull request introduces a new script,
multipathd_exporter.sh
, designed to collect and expose metrics from themultipathd show multipaths
command in a format compatible with the Prometheus textfile collector. This script leveragesjq
to parse the JSON output ofmultipathd
and extracts key information about multipath devices and their paths, output is then written to file using sponge.Metrics Exposed:
The script currently exposes the following metrics:
node_multipath_paths_dm_st
: A gauge representing the count of paths with anactive
Direct Mapped (DM) state within each multipath device's path groups. Labels includename
(multipath device name),uuid
,vend
(vendor),prod
(product), andstate="active"
.node_multipath_paths_chk_st
: A gauge representing the count of paths with aready
check status (chk_st
) within each multipath device's path groups. Labels includename
,uuid
,vend
,prod
, andstate="ready"
.node_multipath_paths_dev_st
: A gauge representing the count of paths with arunning
device status (dev_st
) within each multipath device's path groups. Labels includename
,uuid
,vend
,prod
, andstate="running"
.node_multipath_dm_st
: A gauge representing the count of multipath devices with anactive
DM state. Labels includename
,uuid
,vend
,prod
, andstate="active"
.node_multipath_path_nr
: A gauge representing the total number of paths associated with each multipath device. Labels includename
,uuid
,vend
, andprod
.node_multipath_path_faults
: A gauge representing the number of faults reported for each multipath device. Labels includename
,uuid
,vend
, andprod
.Usage:
jq
andmoreutils
are installed on the system where the script will run.multipathd_exporter.sh
(or a similar name).chmod +x multipathd_exporter.sh
.--collector.textfile.directory
flag to a directory where Prometheus can read the output of this script.Benefits:
Author: Nick Galtry