Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mulitipathd_info text collector example #1375

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

ssinha-ionos
Copy link
Contributor

multipathd_info is a script that exposes device mapper multipathing
metrics from multipathd daemon.

Signed-off-by: Saket Sinha [email protected]

@dswarbrick
Copy link
Contributor

dswarbrick commented Jun 11, 2019

It might be prudent to specify the exact format that we want multipathd to output, in case the order of the columns changes in future (thus breaking the awk script).

Based on the columns selected by the awk script, we want dev, dm_st and chk_st, which are %d, %t and %T respectively (check multipathd show wildcards).

This produces a cleaner output which is safer (and probably easier) to parse:

# multipathd show paths format '%d %t %T'
dev dm_st  chk_st
sdd active ready 
sdb active ready 
sdh active ready 
sdf active ready

@SuperQ
Copy link
Member

SuperQ commented Jun 11, 2019

@dswarbrick Nice suggestion. It's too bad that the format string is picky, I get errors when I try and format the whole metric line with it. ☹️

@ssinha-ionos
Copy link
Contributor Author

@dswarbrick Nice suggestion. It's too bad that the format string is picky, I get errors when I try and format the whole metric line with it.

Modified the commit based on @dswarbrick review comments.

Also corrected the metric name -

  1. dm_st refers to the DM module(kernel)'s view of the path's state. It can be in one of the two states:
  • active: Last I/O sent to this path successfully completed. Analogous to ready path state.
  • failed: Last I/O to this path failed. Analogous to faulty path state.
  1. chk_st refers to the physical state of a path. A path can be in one of the following states:
  • ready: Path is up and can handle I/O requests.
  • faulty: Path is down and cannot handle I/O requests.
  • ghost: Path is a passive path. This state is shown in the passive path in Active/Passive mode.
  • shaky: Path is up, but temporarily not available for I/O requests.

@dswarbrick
Copy link
Contributor

Shebang is still incorrect (see @SuperQ's earlier comment):

$ shellcheck multipathd_info 

In multipathd_info line 1:
#/bin/bash
 ^-- SC1113: Use #!, not just #, for the shebang.

@bdrung
Copy link
Contributor

bdrung commented Jun 11, 2019

And please use /bin/sh instead of /bin/bash since you do not use bash specific feautures.

multipathd_info is a script that exposes device mapper multipathing
metrics from multipathd daemon.

Signed-off-by: Saket Sinha <[email protected]>
@discordianfish discordianfish merged commit e972e38 into prometheus:master Jun 25, 2019
@discordianfish
Copy link
Member

LGTM

oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
multipathd_info is a script that exposes device mapper multipathing
metrics from multipathd daemon.

Signed-off-by: Saket Sinha <[email protected]>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
multipathd_info is a script that exposes device mapper multipathing
metrics from multipathd daemon.

Signed-off-by: Saket Sinha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants