Page 1 of 1

[Rpi-monitor] Add hard drive monitoring

Posted: Thu May 22, 2014 2:39 pm
by Quift
Hello,

I would like to monitore my new hard drive in rpimonitord.
I've added theses few lines to the default.conf:

Code: Select all

static.9.name=hard_drive_total
static.9.source=df -t fuseblk
static.9.regexp=sda1.\s+(\d+).*\/mnt/usb$
static.9.postprocess=$1/1024

dynamic.16.name=hard_drive_used
dynamic.16=df -t fuseblk
dynamic.16.regexp=sda1.\s+\d+\s+(\d+).*\/mnt/usb$
dynamic.16.postprocess=$1/1024
dynamic.16.rrd=GAUGE
Here is what I get what I run it:

Code: Select all

Can't use string ("df -t fuseblk") as a HASH ref while "strict refs" in use at /usr/bin/rpimonitord line 180, <FILE> line 215.
There was the default SDCard which is basically the same code:

Code: Select all

static.8.name=sdcard_boot_total
static.8.source=df -t vfat
static.8.regexp=mmcblk0p.\s+(\d+).*\/boot$
static.8.postprocess=$1/1024

dynamic.7.name=sdcard_boot_used
dynamic.7.source=df -t vfat
dynamic.7.regexp=mmcblk0p.\s+\d+\s+(\d+).*\/boot$
dynamic.7.postprocess=$1/1024
dynamic.7.rrd=GAUGE

Do you know what I've done wrong please ?
Thanks in advance :)

Re: [Rpi-monitor] Add hard drive monitoring

Posted: Thu May 22, 2014 3:21 pm
by DeeJay
Purely an "intelligent guess" that your line

Code: Select all

dynamic.16=df -t fuseblk
should really say

Code: Select all

dynamic.16.source=df -t fuseblk
??

Re: [Rpi-monitor] Add hard drive monitoring

Posted: Thu May 22, 2014 4:38 pm
by Quift
Call me Mister Dumb I've searching this for more than an hour :D
thanks :D

Re: [Rpi-monitor] Add hard drive monitoring

Posted: Mon Oct 15, 2018 3:14 am
by VTR
Then add that in web.status section:

web.status.1.content.9.name=External Disk
web.status.1.content.9.icon=usb_hdd.png
web.status.1.content.9.line.1="<b>/media/USBHDD1</b> Used: <b>"+KMG(data.hard_drive_used,'M')+"</b> (<b>"+Percent(data.hard_drive_used,data.hard_drive_total,'M')+"</b>) Free: <b>"+KMG(data.hard_drive_total-data.hard_drive_used,'M')+ "</b> Total: <b>"+ KMG(data.hard_drive_total,'M') +"</b>"
web.status.1.content.9.line.2=ProgressBar(data.hard_drive_used,data.hard_drive_total)