From: Florian Forster Date: Mon, 10 Jul 2006 18:56:27 +0000 (+0200) Subject: vserver plugin: Use `plugin_complain' and `plugin_relief'. X-Git-Tag: collectd-3.11.0~78 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9f28f6102a27ad0c0fa75e776ac19091de514722;p=collectd.git vserver plugin: Use `plugin_complain' and `plugin_relief'. --- diff --git a/src/vserver.c b/src/vserver.c index 694b6d02..3a77961b 100644 --- a/src/vserver.c +++ b/src/vserver.c @@ -343,11 +343,17 @@ static void vserver_read (void) DIR *proc; struct dirent *dent; /* 42 */ + static complain_t complain_obj; + errno = 0; - if (NULL == (proc = opendir (PROCDIR))) { - syslog (LOG_ERR, "Cannot open '%s': %s", PROCDIR, strerror (errno)); + if (NULL == (proc = opendir (PROCDIR))) + { + plugin_complain (LOG_ERR, &complain_obj, "vserver plugin: " + "fopen (%s) failed: %s", PROCDIR, strerror (errno)); return; } + plugin_relief (LOG_NOTICE, &complain_obj, "vserver plugin: " + "fopen (%s) succeeded.", PROCDIR); while (NULL != (dent = readdir (proc))) { int len;