From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: 'collectd' and 'cpufreq' on IPFire Duobox - wrong path in initscript? Date: Wed, 04 Jul 2018 10:17:02 +0100 Message-ID: <209fb2c11e4681b36caf9d5fb5b13ddb92bddf3f.camel@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0387659991879601215==" List-Id: --===============0387659991879601215== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, 2018-07-04 at 01:09 +0200, Arne Fitzenreiter wrote: > On some maschines the file i The file was what? >=20 > I think this need more investigation. >=20 >=20 >=20 > > This was triggered by > > https://git.ipfire.org/?p=3Dipfire-2.x.git;a=3Dcommitdiff;h=3D37458540bf7= 27df09989 > > c10d640ad13c1a989029 > >=20 > > I thought some cpu graphs on my "Duo Box" could be helpful and=20 > > installed > > 'cpufrequtils'. > >=20 > > But after adding the above commit to '/etc/init.d/collectd' > > and restarting 'collectd' =3D> no graphs appeared. > >=20 > > Reason: > > The needed directory '/sys/devices/system/cpu/cpufreq/policy0/' doesn't > > exist on my machine, so the 'LoadPlugin' was always commented and > > deactivated. > >=20 > > Instead there are '/sys/devices/system/cpu/cpu0' and > > '/sys/devices/system/cpu/cpu1'. > >=20 > > So I tested this the hard way. > >=20 > > After commenting the if-statement, everything is working, CPU graphs > > appear and show reasonable values: > >=20 > > ... > > # Enable cpufreq plugin if cpufreq found > > #if [ ! -e /sys/devices/system/cpu/cpufreq/policy0/*_cur_freq ]; then > > # sed -i -e "s|^LoadPlugin cpufreq|#LoadPlugin cpufreq|g"=20 > > /etc/collectd.conf > > #else > > sed -i -e "s|^#LoadPlugin cpufreq|LoadPlugin cpufreq|g"=20 > > /etc/collectd.conf > > #fi > > ... > >=20 > > Changed this to: > >=20 > > ... > > if [ ! -e /sys/devices/system/cpu/cpu0/cpufreq/*_cur_freq ]; then > > .. > >=20 > > But this gave me an error: > >=20 > > /etc/init.d/collectd: line 95: [: > > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: binary operator > > expected > >=20 > > I changed the line to: > >=20 > > ... > > if [ ! -e /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq ]; then > > ... > >=20 > > And now it is running as expected. > >=20 > > Would this be ok for other machines? > > Bug or feature - can anyone confirm? > >=20 > > Best, > > Matthias > >=20 > > P.S.: I didn't forget the Telko - I was still at work. Too bad... --===============0387659991879601215==--