diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-04-12 20:42:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 13:42:30 -0400 |
commit | 2a1f4e8ee7ba4cd89a0a05d55029db953c2fc23b (patch) | |
tree | e9e243ac0e3761fd0c79a38fc7d9934c9bd6d066 /src/collectors/plugins.d/ndsudo.c | |
parent | 6dbe22e75d1ced14f00deddcd9df8244baddc3e8 (diff) |
add simple collector to monitor lvm thin volumes space usage (#17394)
* add lvs to ndsudo
* simple collector to monitor lvm thin volumes space usage
* allow comma in ndsudo params
* fixes
* enable by default
* add this pool check for now
Diffstat (limited to 'src/collectors/plugins.d/ndsudo.c')
-rw-r--r-- | src/collectors/plugins.d/ndsudo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/collectors/plugins.d/ndsudo.c b/src/collectors/plugins.d/ndsudo.c index d401c885a9..0ba1c86978 100644 --- a/src/collectors/plugins.d/ndsudo.c +++ b/src/collectors/plugins.d/ndsudo.c @@ -13,7 +13,15 @@ struct command { const char *params; const char *search[MAX_SEARCH]; } allowed_commands[] = { - { + { + .name = "lvs-report-json", + .params = "--reportformat json --units b --nosuffix -o {{options}}", + .search = { + [0] = "lvs", + [1] = NULL, + }, + }, + { .name = "igt-json", .params = "-J -s {{interval}}", .search = { @@ -117,7 +125,7 @@ bool check_string(const char *str, size_t index, char *err, size_t err_size) { if(!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || - c == ' ' || c == '_' || c == '-' || c == '/' || c == '.')) { + c == ' ' || c == '_' || c == '-' || c == '/' || c == '.' || c == ',')) { snprintf(err, err_size, "command line argument No %zu includes invalid character '%c'", index, c); return false; } |