How to monitor system resources on another pi?

Anyone know how to do this?

Hi,

I would try this method:

  1. https://stackoverflow.com/questions/38666350/check-if-remote-process-is-running-linux
  2. Create a cron task that calls the chosen solution from the above link with a periodicity of your liking
  3. Store the result in a file on your machine running HASS.
  4. Create a sensor based on platform: file

Regards PH

I would submit your system resources to a MQTT broker. You could do so with a cron.
I created a cron reading out my Pi’s temperature to test my broker/sensor setup.

A remote Pi can easily submit to your semi-/public broker.

Yes, and if the mqtt sensor hasn’t been updated for some time consider the process dead.

Another alternative is to use ssh in a command line sensor to get the data directly into HA.

Just remember to add the public ssh key for the homeassistant user to the remote pi.

SNMP component

Could you please elaborate a bit more on how to solve it with SNMP?
Regards PH

You may install SNMP on pi
http://www.satsignal.eu/raspberry-pi/monitoring.html

You may monitor in home Assistant with snmp component

Finally I got around to get this sorted. Did it without SNMP, that became just to complicated.

First, make sure you can ssh into the remote server without password: https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md
and since HASS uses the username “homeassistant” (at least for me) make sure you have the right files in /home/homeassistant/.ssh

Then create a script with the correct username and ip-adress i.e checkDB.sh:

#!/bin/sh
ssh [email protected] “sudo ps cax | grep mysqld > /dev/null”
if [ $? -eq 0 ]
then
echo “1”
else
echo “0”
fi

make it executable: chmod 755

Then create a sensor:

>   - platform: command_line
>     command: "/home/homeassistant/.homeassistant/checkDB.sh"
>     name: BerryDB

Done!

i have 2 raspberry pi
i would like to monitor 1st on 2nd pi with HA.
my pi ask for password once rebooted,
it doenst remember passphrase
can somebody guide,
thanks

I just use glances and ha-dockermon. Covers everything I’m interested in monitoring.

Also check this small python deamon out:

This is how I do it using the API interface to HA