diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
commit | 97e01009d69b8fbebfebf68f51e3d126d0ed43fc (patch) | |
tree | 02e8b836c3a9d89806f3e67d4a5fe9f52dbb0061 /collectors/cups.plugin | |
parent | Releasing debian version 1.36.1-1. (diff) | |
download | netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.tar.xz netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.zip |
Merging upstream version 1.37.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/cups.plugin')
-rw-r--r-- | collectors/cups.plugin/README.md | 4 | ||||
-rw-r--r-- | collectors/cups.plugin/cups_plugin.c | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/collectors/cups.plugin/README.md b/collectors/cups.plugin/README.md index e3d2e1661..f3b2a28d1 100644 --- a/collectors/cups.plugin/README.md +++ b/collectors/cups.plugin/README.md @@ -11,9 +11,11 @@ custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/cups. This plugin needs a running local CUPS daemon (`cupsd`). This plugin does not need any configuration. Supports cups since version 1.7. +If you installed Netdata using our native packages, you will have to additionaly install `netdata-plugin-cups` to use this plugin for data collection. It is not installed by default due to the large number of dependencies it requires. + ## Charts -`cups.plugin` provides one common section `destinations` and one section per destination. +`cups.plugin` provides one common section `destinations` and one section per destination. > Destinations in CUPS represent individual printers or classes (collections or pools) of printers (<https://www.cups.org/doc/cupspm.html#working-with-destinations>) diff --git a/collectors/cups.plugin/cups_plugin.c b/collectors/cups.plugin/cups_plugin.c index 77bd3e0ed..9a200c31d 100644 --- a/collectors/cups.plugin/cups_plugin.c +++ b/collectors/cups.plugin/cups_plugin.c @@ -137,10 +137,7 @@ getIntegerOption( return ((int)intvalue); } -static int reset_job_metrics(const char *name, void *entry, void *data) { - (void)name; - (void)data; - +static int reset_job_metrics(const DICTIONARY_ITEM *item __maybe_unused, void *entry, void *data __maybe_unused) { struct job_metrics *jm = (struct job_metrics *)entry; jm->is_collected = 0; @@ -175,8 +172,8 @@ struct job_metrics *get_job_metrics(char *dest) { return jm; } -int collect_job_metrics(const char *name, void *entry, void *data) { - (void)data; +int collect_job_metrics(const DICTIONARY_ITEM *item, void *entry, void *data __maybe_unused) { + const char *name = dictionary_acquired_item_name(item); struct job_metrics *jm = (struct job_metrics *)entry; @@ -205,7 +202,7 @@ int collect_job_metrics(const char *name, void *entry, void *data) { printf("DIMENSION pending '' absolute 1 1\n"); printf("DIMENSION held '' absolute 1 1\n"); printf("DIMENSION processing '' absolute 1 1\n"); - dictionary_del_having_write_lock(dict_dest_job_metrics, name); + dictionary_del(dict_dest_job_metrics, name); } return 0; @@ -243,7 +240,7 @@ int main(int argc, char **argv) { errno = 0; - dict_dest_job_metrics = dictionary_create(DICTIONARY_FLAG_SINGLE_THREADED); + dict_dest_job_metrics = dictionary_create(DICT_OPTION_SINGLE_THREADED); // ------------------------------------------------------------------------ // the main loop |