From 0a6ac95dc2a768e7c849673c476db55a41e7f4de Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 9 Dec 2007 15:32:13 +0100 Subject: [PATCH] cpu plugin: Removed the `complain' stuff. --- src/cpu.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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]); -- 2.30.2