|
45 | 45 | #include "ne_processes.h" |
46 | 46 | #include "ne_nvme.h" |
47 | 47 | #include "ne_thermalzone.h" |
| 48 | +#include "ne_hwmon.h" |
48 | 49 |
|
49 | 50 | /* |
50 | 51 | * Update the metrics, this function is invoked every time 'scrape_interval' |
@@ -200,6 +201,7 @@ static int in_ne_init(struct flb_input_instance *in, |
200 | 201 | mk_list_add(&processes_collector._head, &ctx->collectors); |
201 | 202 | mk_list_add(&nvme_collector._head, &ctx->collectors); |
202 | 203 | mk_list_add(&thermalzone_collector._head, &ctx->collectors); |
| 204 | + mk_list_add(&hwmon_collector._head, &ctx->collectors); |
203 | 205 |
|
204 | 206 | mk_list_foreach(head, &ctx->collectors) { |
205 | 207 | coll = mk_list_entry(head, struct flb_ne_collector, _head); |
@@ -428,6 +430,12 @@ static struct flb_config_map config_map[] = { |
428 | 430 | "scrape interval to collect nvme metrics from the node." |
429 | 431 | }, |
430 | 432 |
|
| 433 | + { |
| 434 | + FLB_CONFIG_MAP_TIME, "collector.hwmon.scrape_interval", "0", |
| 435 | + 0, FLB_FALSE, 0, |
| 436 | + "scrape interval to collect hwmon metrics from the node." |
| 437 | + }, |
| 438 | + |
431 | 439 | { |
432 | 440 | FLB_CONFIG_MAP_CLIST, "metrics", |
433 | 441 | NE_DEFAULT_ENABLED_METRICS, |
@@ -503,6 +511,31 @@ static struct flb_config_map config_map[] = { |
503 | 511 | 0, FLB_TRUE, offsetof(struct flb_ne, dt_regex_skip_devices_text), |
504 | 512 | "ignore regular expression for disk devices" |
505 | 513 | }, |
| 514 | + |
| 515 | + /* hwmon specific settings */ |
| 516 | + { |
| 517 | + FLB_CONFIG_MAP_STR, "collector.hwmon.chip-include", NULL, |
| 518 | + 0, FLB_TRUE, offsetof(struct flb_ne, hwmon_chip_regex_include_text), |
| 519 | + "regex of chips to include" |
| 520 | + }, |
| 521 | + |
| 522 | + { |
| 523 | + FLB_CONFIG_MAP_STR, "collector.hwmon.chip-exclude", NULL, |
| 524 | + 0, FLB_TRUE, offsetof(struct flb_ne, hwmon_chip_regex_exclude_text), |
| 525 | + "regex of chips to exclude" |
| 526 | + }, |
| 527 | + |
| 528 | + { |
| 529 | + FLB_CONFIG_MAP_STR, "collector.hwmon.sensor-include", NULL, |
| 530 | + 0, FLB_TRUE, offsetof(struct flb_ne, hwmon_sensor_regex_include_text), |
| 531 | + "regex of sensors to include" |
| 532 | + }, |
| 533 | + |
| 534 | + { |
| 535 | + FLB_CONFIG_MAP_STR, "collector.hwmon.sensor-exclude", NULL, |
| 536 | + 0, FLB_TRUE, offsetof(struct flb_ne, hwmon_sensor_regex_exclude_text), |
| 537 | + "regex of sensors to exclude" |
| 538 | + }, |
506 | 539 | /* EOF */ |
507 | 540 | {0} |
508 | 541 | }; |
|
0 commit comments