Page 1 of 1
Python Plugin: Psutil Motherboard Sensors
Posted: Sunday 16 September 2018 17:29
by febalci
Using Ubuntu, I couldn't get any reliable information from Domoticz Native 'Motherboard Sensors' plugin. Especially the empty space for HDD was always giving wrong information. So I wrote this plugin for my own needs and decided to give up on native 'Motherboard Sensors'.
Installation:
Please install the 'psutil' Python module first:
sudo pip3 install psutil
When you first enable this Plugin It provides:
- Memory (Virtual) Memory Usage
- All mounted HDD Usage Percentages
And, if supported by your platform:
- Sensor Temperatures (Celcius)
You can find this plugin in
https://github.com/febalci/DomoticzPsutil
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Sunday 11 November 2018 23:46
by dextm80
Hi! Nice work! I've this issue:
2018-11-11 23:44:43.723 Error: (PsUtil) 'onHeartbeat' failed 'KeyError'.
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 247 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 159 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
do you known what's the matter?
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Monday 12 November 2018 10:24
by febalci
dextm80 wrote: ↑Sunday 11 November 2018 23:46
Hi! Nice work! I've this issue:
2018-11-11 23:44:43.723 Error: (PsUtil) 'onHeartbeat' failed 'KeyError'.
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 247 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 159 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
do you known what's the matter?
It turns out the snap devices on ubuntu is causing a problem on both native domoticz motherboard sensors and this psutil motherboard sensors. Please check:
https://github.com/domoticz/domoticz/issues/2822
On Ubuntu, the loop devices created with snap are changing the df -h output order. So the number of disk devices and their order changes everytime, which in native motherboard sensors gives the wrong result, or in psutil motherboard sensors, an error. As a quick fix i deleted all my snap devices; but since snap is a thing on ubuntu now, i need to correct this situation in my plugin someday.
Can you please check 'df -h' and look if any loop devices or canonical snap devices exist?
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Monday 12 November 2018 17:24
by dextm80
febalci wrote: ↑Monday 12 November 2018 10:24
dextm80 wrote: ↑Sunday 11 November 2018 23:46
Hi! Nice work! I've this issue:
2018-11-11 23:44:43.723 Error: (PsUtil) 'onHeartbeat' failed 'KeyError'.
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 247 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
2018-11-11 23:44:43.723 Error: (PsUtil) ----> Line 159 in '/home/luigi/domoticz/plugins/psutil/plugin.py', function onHeartbeat
do you known what's the matter?
It turns out the snap devices on ubuntu is causing a problem on both native domoticz motherboard sensors and this psutil motherboard sensors. Please check:
https://github.com/domoticz/domoticz/issues/2822
On Ubuntu, the loop devices created with snap are changing the df -h output order. So the number of disk devices and their order changes everytime, which in native motherboard sensors gives the wrong result, or in psutil motherboard sensors, an error. As a quick fix i deleted all my snap devices; but since snap is a thing on ubuntu now, i need to correct this situation in my plugin someday.
Can you please check 'df -h' and look if any loop devices or canonical snap devices exist?
this is my df -h report:
Code: Select all
File system Dim. Usati Dispon. Uso% Montato su
udev 3,7G 0 3,7G 0% /dev
tmpfs 764M 3,0M 761M 1% /run
/dev/sda2 82G 46G 32G 59% /
tmpfs 3,8G 124M 3,7G 4% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,8G 0 3,8G 0% /sys/fs/cgroup
/dev/sdc1 916G 16G 855G 2% /media/sdd1
/dev/sdb1 1,8T 1,2T 572G 68% /media/sdb1
/dev/sdd1 459G 401G 35G 93% /media/sdc1
/dev/sda1 511M 6,2M 505M 2% /boot/efi
/dev/sde1 250G 19M 250G 1% /media/sdf1
/dev/sdf1 932G 298G 635G 32% /media/sde1
tmpfs 764M 40K 764M 1% /run/user/1000
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Friday 16 November 2018 10:21
by febalci
dextm80 wrote: ↑Monday 12 November 2018 17:24
this is my df -h report:
Code: Select all
File system Dim. Usati Dispon. Uso% Montato su
udev 3,7G 0 3,7G 0% /dev
tmpfs 764M 3,0M 761M 1% /run
/dev/sda2 82G 46G 32G 59% /
tmpfs 3,8G 124M 3,7G 4% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,8G 0 3,8G 0% /sys/fs/cgroup
/dev/sdc1 916G 16G 855G 2% /media/sdd1
/dev/sdb1 1,8T 1,2T 572G 68% /media/sdb1
/dev/sdd1 459G 401G 35G 93% /media/sdc1
/dev/sda1 511M 6,2M 505M 2% /boot/efi
/dev/sde1 250G 19M 250G 1% /media/sdf1
/dev/sdf1 932G 298G 635G 32% /media/sde1
tmpfs 764M 40K 764M 1% /run/user/1000
I guess i fixed the keyError now. Also added 'Network Mount Drives' if you want to follow up the mounted network drives disk usage; that is selectable on the plugin profile page. Could you try the new version 0.3 on the github?
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Sunday 18 November 2018 1:01
by dextm80
febalci wrote: ↑Friday 16 November 2018 10:21
dextm80 wrote: ↑Monday 12 November 2018 17:24
this is my df -h report:
Code: Select all
File system Dim. Usati Dispon. Uso% Montato su
udev 3,7G 0 3,7G 0% /dev
tmpfs 764M 3,0M 761M 1% /run
/dev/sda2 82G 46G 32G 59% /
tmpfs 3,8G 124M 3,7G 4% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 3,8G 0 3,8G 0% /sys/fs/cgroup
/dev/sdc1 916G 16G 855G 2% /media/sdd1
/dev/sdb1 1,8T 1,2T 572G 68% /media/sdb1
/dev/sdd1 459G 401G 35G 93% /media/sdc1
/dev/sda1 511M 6,2M 505M 2% /boot/efi
/dev/sde1 250G 19M 250G 1% /media/sdf1
/dev/sdf1 932G 298G 635G 32% /media/sde1
tmpfs 764M 40K 764M 1% /run/user/1000
I guess i fixed the keyError now. Also added 'Network Mount Drives' if you want to follow up the mounted network drives disk usage; that is selectable on the plugin profile page. Could you try the new version 0.3 on the github?
Yes, but i get this error:
Code: Select all
2018-11-18 01:00:13.400 Error: (Psutil) failed to load 'plugin.py', Python Path used was '/home/luigi/domoticz/plugins/PSUtil/:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload'.
2018-11-18 01:00:13.400 Error: (PSUtil Motherboard Sensor) Module Import failed, exception: 'ModuleNotFoundError'
2018-11-18 01:00:13.400 Error: (PSUtil Motherboard Sensor) Module Import failed: ' Name: psutil'
2018-11-18 01:00:13.400 Error: (PSUtil Motherboard Sensor) Error Line details not available.
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Sunday 18 November 2018 12:00
by febalci
dextm80 wrote: ↑Sunday 18 November 2018 1:01
Yes, but i get this error:
You have to install psutil python module in order for this plugin to work. You can do it with:
sudo pip3 install psutil
Re: Python Plugin: Psutil Motherboard Sensors
Posted: Sunday 18 November 2018 20:56
by dextm80
febalci wrote: ↑Sunday 18 November 2018 12:00
dextm80 wrote: ↑Sunday 18 November 2018 1:01
Yes, but i get this error:
You have to install psutil python module in order for this plugin to work. You can do it with:
sudo pip3 install psutil
it seems ok now, thank you