From: Florian Forster Date: Sun, 9 Dec 2007 14:32:13 +0000 (+0100) Subject: cpu plugin: Removed the `complain' stuff. X-Git-Tag: collectd-4.3.0beta0~68 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0a6ac95dc2a768e7c849673c476db55a41e7f4de;p=collectd.git cpu plugin: Removed the `complain' stuff. --- diff --git a/src/cpu.c b/src/cpu.c index ba0c1b1a..c79c4b66 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -277,20 +277,14 @@ static int cpu_read (void) char *fields[9]; int numfields; - static complain_t complain_obj; - if ((fh = fopen ("/proc/stat", "r")) == NULL) { char errbuf[1024]; - plugin_complain (LOG_ERR, &complain_obj, "cpu plugin: " - "fopen (/proc/stat) failed: %s", + ERROR ("cpu plugin: fopen (/proc/stat) failed: %s", sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - plugin_relief (LOG_NOTICE, &complain_obj, "cpu plugin: " - "fopen (/proc/stat) succeeded."); - while (fgets (buf, 1024, fh) != NULL) { if (strncmp (buf, "cpu", 3)) @@ -360,22 +354,16 @@ static int cpu_read (void) long cpuinfo[CPUSTATES]; size_t cpuinfo_size; - static complain_t complain_obj; - cpuinfo_size = sizeof (cpuinfo); if (sysctlbyname("kern.cp_time", &cpuinfo, &cpuinfo_size, NULL, 0) < 0) { char errbuf[1024]; - plugin_complain (LOG_ERR, &complain_obj, "cpu plugin: " - "sysctlbyname failed: %s.", + ERROR ("cpu plugin: sysctlbyname failed: %s.", sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - plugin_relief (LOG_NOTICE, &complain_obj, "cpu plugin: " - "sysctlbyname succeeded."); - cpuinfo[CP_SYS] += cpuinfo[CP_INTR]; submit (0, "user", cpuinfo[CP_USER]);