System Monitoring - How does yours look?

Thank you. I just started to get into SNMP in the last few days. I will have to experiment more with it.
Greatly appreciated and Happy Holidays.
carltonb

Another question for you; do you configure your snmp at the unifi controller or on at the AP itself

How are you monitoring the ERX?

I configured SNMP from the unifi controller. But it just pushes (provisions) the configuration to the AP itself. When I configure Home Assistant, the IP address is of the AP.

sensor:
  - platform: snmp
    name: 'AP Model'
    host: 1.1.1.1
    community: 'private'
    baseoid: 1.3.6.1.4.1.41112.1.6.3.3.0

thank you for your reply

Hi @tom_l! I’m monitoring the ERX using a custom_component created by @bar

Here’s the link to the github page. Also here is the link to the HA forum page.

1 Like


That image inspires me!

I’m generally not a big fan of image backgrounds, but it would be totally cool to get some imagery of old-time monitors, oscilloscopes, tvs, radios, airplane instruments, or auto instruments and use them to as frames for HASS graphs etc.

I don’t have the time to do it, but I am inspired to suggest it.

Cheers, Richard

2 Likes

Hasn’t been updated in 4 years. I wouldn’t count on this.

Can you share your configuration? Thank you……可以分享下你的配置么?谢谢……

brazil-terminal

1 Like

what part would you be interested in?

Here is mine… Lot of system monitor things :smiley:

Hey…

How far are you with this new cockpit view?

I am quite interested on using it, maybe slightly modified to show the battery level of my Xiaomi devices. I have tons of them but no easy way to show all the battery levels at once.

curous how you are pulling data from another computer? ssh server, and mqtt server?
care to post up your config for that?

thanks

Im using a script on every server:

Install below on every server: (my situation Debian Stretch)

sudo apt-get install build-essential python-dev python-pip
sudo pip install paho-mqtt
sudo pip install psutil
sudo reboot
cd /home/USER-DIR/
nano systemdata.py

Change in your script your MQTT SERVER INFO
script:

#References: Thanks to these resoruces!
#http://www.isendev.com/app/entry/39
#https://pythonhosted.org/psutil/

import sys, psutil, datetime, paho.mqtt.client as mqtt, json
from time import gmtime, strftime
import os

def getVoltage():
        try:
                res1 = os.popen('vcgencmd measure_volts core').readline()
                tmp2 = res1.replace("volt=","")
                tmp2 = tmp2.replace("V","")
                tmp2 = tmp2.replace("\n","")
                return tmp2
        except:
                return 0

def getCPUtemperature():
        try:
                res = os.popen('vcgencmd measure_temp').readline()
                tmp1 = res.replace("temp=","")
                tmp1 = tmp1.replace("'","")
                tmp1 = tmp1.replace("C","")
                #print tmp1
                return tmp1
        except:
                return 0

def bytes2human(n):
# http://code.activestate.com/recipes/577972-disk-usage/
    symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
    prefix = {}
    for i, s in enumerate(symbols):
        prefix[s] = 1 << (i+1)*10
    for s in reversed(symbols):
        if n >= prefix[s]:
            value = float(n) / prefix[s]
            return '%.1f%s' % (value, s)
    return "%sB" % n


temp1 = int(float(getCPUtemperature()))
cputemp=temp1
#cputemp = 9.0/5.0*temp1+32

voltage = getVoltage()

currtime = strftime("%H:%M:%S - %d-%m-%Y")

boottime = datetime.datetime.fromtimestamp(psutil.boot_time()).strftime("%H:%M:%S - %d-%m-%Y")

topic = "homeassistant/ssh_server/systemstatus"

cpupercent = psutil.cpu_percent(interval=1)
vmem = psutil.virtual_memory().percent
diskusage =  psutil.disk_usage('/').percent
disktotal = bytes2human( psutil.disk_usage('/').total )

payload = { 'datetimedatacollected': currtime,
 'cpuusage': cpupercent, 'boottime': boottime,
 'virtualmem': vmem, 'diskusage': diskusage,
 'volt': voltage, 'cputemp': cputemp, 'disktotal': disktotal }

mqtthost = "MQTT SERVER IP"
mqttuser = "MQTT SERVER USERNAME"
mqttpwd = "MQTT SERVER PASSWORD"

client = mqtt.Client()
client.username_pw_set(mqttuser, mqttpwd)
client.connect(mqtthost, 1883, 60)

payload_json = json.dumps(payload)

print (payload_json)

persistant_data = True

client.publish(topic, payload_json, 0, persistant_data)
client.disconnect()

sys.exit()
sudo crontab -e
*/5 * * * * python /home/pi/systemdata.py

In HA I have some MQTT Sensors:

---
platform: mqtt
state_topic: "homeassistant/mqtt_server/systemstatus"
name: "MQTT Boot Time"
value_template: "{{ value_json.boottime }}"

create for every below status a sensor mqtt and change the line:

value_template: “{{ value_json.XXXXX }}”

XXXXX is value below

currtime
cpupercent
boottime
vmem
diskusage
voltage
cputemp
disktotal

3 Likes

thanks, got it all installed, but when i restart my (working) mosquitto server i get a subscribe from the paho client but nothing is sent or =updated.

not even sure how to debug that,. lol

ok got it somewhat working, didn’t realize this is for a RPI. sop the voltage and temp wont work, because of the vcgencmd command specific to the rpis. anyone know how to implement those two commands to work in this python script? i know this:

- platform: command_line
  name: CPU Temp
  command: "cat /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp2_input"
  unit_of_measurement: "°C"
  value_template: '{{ (value | multiply(0.001)) | round(0) }}'

works on linux, just dont know how to modify that script with it, or if its possble,.

anyway thanks, i may still use the other bits that work,

Would you mind sharing the writing of lights and switches? It’s beautiful!

These are made with button-card. Take a look over there, the possibilities are near endless… :wink: