From acaf997e930cf6878d79fb65d1ef261852f3d65a Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Tue, 7 May 2013 11:13:32 +0200 Subject: [PATCH] added the option 'cmd' in order to configure the path of the command so get Raspberry Pi sensors --- lib/raspberrypi.pm | 12 ++++++------ monitorix.conf | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/raspberrypi.pm b/lib/raspberrypi.pm index e6f82ab..dd99df3 100644 --- a/lib/raspberrypi.pm +++ b/lib/raspberrypi.pm @@ -106,8 +106,8 @@ sub raspberrypi_update { $n = 0; foreach my $c (split(',', ($raspberrypi->{clocks} || ""))) { $c = trim($c); - if(!open(IN, "vcgencmd measure_clock $c |")) { - logger("$myself: unable to execute 'vcgencmd measure_clock $c'. $!"); + if(!open(IN, "$raspberrypi->{cmd} measure_clock $c |")) { + logger("$myself: unable to execute '$raspberrypi->{cmd} measure_clock $c'. $!"); next; } while() { @@ -119,8 +119,8 @@ sub raspberrypi_update { $n++; } - if(!open(IN, "vcgencmd measure_temp |")) { - logger("$myself: unable to execute 'vcgencmd measure_temp'. $!"); + if(!open(IN, "$raspberrypi->{cmd} measure_temp |")) { + logger("$myself: unable to execute '$raspberrypi->{cmd} measure_temp'. $!"); } else { while() { if(/^temp=(\d+\.\d+)/) { @@ -135,8 +135,8 @@ sub raspberrypi_update { $n = 0; foreach my $v (split(',', ($raspberrypi->{volts} || ""))) { $v = trim($v); - if(!open(IN, "vcgencmd measure_volts $v |")) { - logger("$myself: unable to execute 'vcgencmd measure_volts $v'. $!"); + if(!open(IN, "$raspberrypi->{cmd} measure_volts $v |")) { + logger("$myself: unable to execute '$raspberrypi->{cmd} measure_volts $v'. $!"); next; } while() { diff --git a/monitorix.conf b/monitorix.conf index f7dc67a..bd58006 100644 --- a/monitorix.conf +++ b/monitorix.conf @@ -419,6 +419,7 @@ secure_log_date_format = %b %e # RASPBERRYPI graph # ----------------------------------------------------------------------------- + cmd = /opt/vc/bin/vcgencmd clocks = arm, core, h264, isp, v3d, uart, emmc, pixel, hdmi volts = core, sdram_c, sdram_i, sdram_p rigid = 0, 0, 0