diff options
Diffstat (limited to 'collectors/cups.plugin')
-rw-r--r-- | collectors/cups.plugin/cups_plugin.c | 23 | ||||
-rw-r--r-- | collectors/cups.plugin/integrations/cups.md | 5 |
2 files changed, 11 insertions, 17 deletions
diff --git a/collectors/cups.plugin/cups_plugin.c b/collectors/cups.plugin/cups_plugin.c index 82bc457a..8efd32e3 100644 --- a/collectors/cups.plugin/cups_plugin.c +++ b/collectors/cups.plugin/cups_plugin.c @@ -226,22 +226,8 @@ void reset_metrics() { } int main(int argc, char **argv) { - stderror = stderr; clocks_init(); - - // ------------------------------------------------------------------------ - // initialization of netdata plugin - - program_name = "cups.plugin"; - - // disable syslog - error_log_syslog = 0; - - // set errors flood protection to 100 logs per hour - error_log_errors_per_period = 100; - error_log_throttle_period = 3600; - - log_set_global_severity_for_external_plugins(); + nd_log_initialize_for_external_plugins("cups.plugin"); parse_command_line(argc, argv); @@ -437,6 +423,13 @@ int main(int argc, char **argv) { // restart check (14400 seconds) if (!now_monotonic_sec() - started_t > 14400) break; + + fprintf(stdout, "\n"); + fflush(stdout); + if (ferror(stdout) && errno == EPIPE) { + netdata_log_error("error writing to stdout: EPIPE. Exiting..."); + return 1; + } } httpClose(http); diff --git a/collectors/cups.plugin/integrations/cups.md b/collectors/cups.plugin/integrations/cups.md index aa981a99..a8ea5b15 100644 --- a/collectors/cups.plugin/integrations/cups.md +++ b/collectors/cups.plugin/integrations/cups.md @@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/cups.plugi sidebar_label: "CUPS" learn_status: "Published" learn_rel_path: "Data Collection/Hardware Devices and Sensors" +most_popular: False message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> @@ -129,8 +130,8 @@ sudo ./edit-config netdata.conf | Name | Description | Default | Required | |:----|:-----------|:-------|:--------:| -| update every | Data collection frequency. | 1 | False | -| command options | Additional parameters for the collector | | False | +| update every | Data collection frequency. | 1 | no | +| command options | Additional parameters for the collector | | no | </details> |