diff options
author | Jérémy Ruffet <sat@airnux.fr> | 2019-06-05 12:03:06 +0200 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-06-05 12:03:06 +0200 |
commit | 03f0b4db9fc49f0c888d469ed142ed89233f08c3 (patch) | |
tree | be70c2a4636b1cb73ca735130ad61be4aaf2e161 /text_collector_examples | |
parent | c39f6749fc365bf704f77cfe8972de2150b06dd1 (diff) | |
download | prometheus_node_collector-03f0b4db9fc49f0c888d469ed142ed89233f08c3.tar.bz2 prometheus_node_collector-03f0b4db9fc49f0c888d469ed142ed89233f08c3.tar.xz prometheus_node_collector-03f0b4db9fc49f0c888d469ed142ed89233f08c3.zip |
Account for spaces in repository label (#1348)
Signed-off-by: Jérémy Ruffet <jeremy.ruffet@i-run.fr>
Diffstat (limited to 'text_collector_examples')
-rwxr-xr-x | text_collector_examples/apt.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/text_collector_examples/apt.sh b/text_collector_examples/apt.sh index b78d38e..171bb0a 100755 --- a/text_collector_examples/apt.sh +++ b/text_collector_examples/apt.sh | |||
@@ -6,8 +6,8 @@ | |||
6 | 6 | ||
7 | upgrades="$(/usr/bin/apt-get --just-print upgrade \ | 7 | upgrades="$(/usr/bin/apt-get --just-print upgrade \ |
8 | | /usr/bin/awk -F'[()]' \ | 8 | | /usr/bin/awk -F'[()]' \ |
9 | '/^Inst/ { sub("^[^ ]+ ", "", $2); sub("\\[", " ", $2); | 9 | '/^Inst/ { sub("^[^ ]+ ", "", $2); gsub(" ","",$2); |
10 | sub(" ", "", $2); sub("\\]", "", $2); print $2 }' \ | 10 | sub("\\[", " ", $2); sub("\\]", "", $2); print $2 }' \ |
11 | | /usr/bin/sort \ | 11 | | /usr/bin/sort \ |
12 | | /usr/bin/uniq -c \ | 12 | | /usr/bin/uniq -c \ |
13 | | awk '{ gsub(/\\\\/, "\\\\", $2); gsub(/\"/, "\\\"", $2); | 13 | | awk '{ gsub(/\\\\/, "\\\\", $2); gsub(/\"/, "\\\"", $2); |