diff --git a/src/cpufreq.c b/src/cpufreq.c
index 50bd771f0ddcba686e8b24512045f640e434baff..ba0149ad1f390298af4049690cc56c9458f4c8b7 100644 (file)
--- a/src/cpufreq.c
+++ b/src/cpufreq.c
/**
* collectd - src/cpufreq.c
/**
* collectd - src/cpufreq.c
- * Copyright (C) 2005 Peter Holik
+ * Copyright (C) 2005,2006 Peter Holik
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
static char *ds_def[] =
{
static char *ds_def[] =
{
- "DS:value:GAUGE:25:0:U",
+ "DS:value:GAUGE:"COLLECTD_HEARTBEAT":0:U",
NULL
};
static int ds_num = 1;
NULL
};
static int ds_num = 1;
while (1)
{
while (1)
{
- status = snprintf (filename, BUFSIZE, "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_cur_freq", num_cpu);
+ status = snprintf (filename, BUFSIZE, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", num_cpu);
if (status < 1 || status >= BUFSIZE)
break;
if (status < 1 || status >= BUFSIZE)
break;
if (fgets (buffer, 16, fp) == NULL)
{
syslog (LOG_WARNING, "cpufreq: fgets: %s", strerror (errno));
if (fgets (buffer, 16, fp) == NULL)
{
syslog (LOG_WARNING, "cpufreq: fgets: %s", strerror (errno));
+ fclose (fp);
return;
}
return;
}