summaryrefslogtreecommitdiffstats
path: root/collectors/cups.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
commit03bf87dcb06f7021bfb2df2fa8691593c6148aff (patch)
treee16b06711a2ed77cafb4b7754be0220c3d14a9d7 /collectors/cups.plugin
parentAdding upstream version 1.36.1. (diff)
downloadnetdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.tar.xz
netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.zip
Adding upstream version 1.37.0.upstream/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.md4
-rw-r--r--collectors/cups.plugin/cups_plugin.c13
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