summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be5074e)
raw | patch | inline | side by side (parent: be5074e)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 9 Dec 2007 14:32:13 +0000 (15:32 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 9 Dec 2007 14:32:13 +0000 (15:32 +0100) |
src/cpu.c | patch | blob | history |
diff --git a/src/cpu.c b/src/cpu.c
index ba0c1b1a2880db85195a77b6bf67c7a82edc5dc6..c79c4b66bc4e01b994eb95222189592a413487d6 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
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))
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]);