projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be5074e
)
cpu plugin: Removed the `complain' stuff.
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
ba0c1b1
..
c79c4b6
100644
(file)
--- a/
src/cpu.c
+++ b/
src/cpu.c
@@
-277,20
+277,14
@@
static int cpu_read (void)
char *fields[9];
int numfields;
char *fields[9];
int numfields;
- static complain_t complain_obj;
-
if ((fh = fopen ("/proc/stat", "r")) == NULL)
{
char errbuf[1024];
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);
}
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))
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;
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];
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);
}
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]);
cpuinfo[CP_SYS] += cpuinfo[CP_INTR];
submit (0, "user", cpuinfo[CP_USER]);