eschava / psmqtt

Utility reporting system health and status via MQTT
MIT License
159 stars 35 forks source link

Help with disk_usage #16

Closed iainp999 closed 4 years ago

iainp999 commented 4 years ago

Hi,

Thanks for this project.

I am running on ubuntu, and a little confused by some of the results I am getting. Of course, this could easily be user error :)

Disk space according to df -h :

df -H /dev/sda2
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       491G  122G  344G  27% /

I am making a request on a topic as follows

psmqtt/<myhost>/request/disk_usage/free/|dev|sda2

listening on psmqtt/<myhost>/disk_usage/free/|dev|sda2, I receive the value 3927171072

which at a glance, looks about right, but if this is bytes, then

echo "scale = 2; 3927171072 / (1024^3) " | bc
3.65

Where am I going wrong? :)

eschava commented 4 years ago

Did you try to use the mounted path (/) not device path (/dev/sda2) ? psmqtt/<myhost>/request/disk_usage/free/|

iainp999 commented 4 years ago

I think I just rubber-ducked this one, sorry :)

Thanks @eschava - that was exactly my issue. It was only when I checked in the .conf file that I saw the example.