From e972e38b423632a4f45326bd33eb127a4935f1f6 Mon Sep 17 00:00:00 2001 From: ssinha-ionos <51702740+ssinha-ionos@users.noreply.github.com> Date: Tue, 25 Jun 2019 11:02:02 +0200 Subject: [PATCH] Add mulitipathd_info text collector example (#1375) multipathd_info is a script that exposes device mapper multipathing metrics from multipathd daemon. Signed-off-by: Saket Sinha --- text_collector_examples/multipathd_info | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 text_collector_examples/multipathd_info diff --git a/text_collector_examples/multipathd_info b/text_collector_examples/multipathd_info new file mode 100755 index 00000000..cddbb2b7 --- /dev/null +++ b/text_collector_examples/multipathd_info @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Description: Expose device mapper multipathing metrics from multipathd. +# +# Author: Saket Sinha + +echo '# HELP node_dmpath_info State info for dev-mapper path' +echo '# TYPE node_dmpath_info gauge' +/sbin/multipathd show paths format '%d %t %T' | /usr/bin/awk '{ if ( NR > 1) {print "node_dmpath_info{device=\""$1"\"," "dm_path_state=\""$2"\"," "path_state=\""$3"\"}" " 1"}}'