UnRaid Monitoring

I see lots of topics about running HA on unraid, but is it possible to get stats into HA from UnRaid?

I run HA on a VM and not on unraid, but i would like to see the performance and capacity info in HA.

I just replaced a qnap array with unraid and would like to be able to monitor performance / capacity like I was able to with qnap.

Thanks

3 Likes

I’d also be interested in monitoring Temperatures, warnings and drive settings etc… on my Unraid server on a different computer/over the network through Home Assistant (Hassio) - could be really useful (for me).

2 Likes

I am also interested in this. Perhaps via an unRAID plugin?

1 Like

Any luck with this?

I don’t have hass.io, so i’m not sure how to do a plugin, or if this helps at all, but i’ll post this anyway as it seems relevant.

i created a small python script to read the /var/local/emhttp/disks.ini file on Unraid for disk status, and then use a command_line sensor in the hass configuration:

Unraid.py (note: you will probably need to make a symbolic link and/or a mount point to /var/local/emhttp)

import configparser, json

numErrors = 0
config = configparser.ConfigParser()
config.read("/mnt/sage/disks.ini")
for s in config.sections():
    e = config[s]['numErrors'].replace('"','')
    numErrors += int(e)
    if not config[s]['status'].startswith('"DISK_NP'):
       if config[s]['status'] != '"DISK_OK"':
           result = {"result":"{}:{}".format(s,config[s]['status'])}
       else:
           result = {"result":"Ok"}
result['numErrors'] = numErrors
print(json.dumps(result))

configuration.yaml:

  - platform: command_line
    command: '~/homeassistant/bin/python /home/pi/.homeassistant/unraid.py'
    name: Unraid Disk Status
    value_template: '{{ value_json.result }}'
    json_attributes:
      - numErrors

this will create sensor.unraid_disk_status, the state of which should be “Ok” if all the disks are “DISK_OK”, otherwise the state should be whatever the last failed disk status is marked as. (although i haven’t tested this because my array hasn’t failed yet < fingers-crossed >). The sensor will have also have an attribute called numErrors that will show how many errors were collected for the whole array.

i think this could be a model for other data points in disks.ini and the other ini files in that directory that contain more unraid state information, ie: var.ini, cpuload.ini, …

2 Likes

Simple unraid plugin that publishes via mqtt would probably be the easiest.

2 Likes

I look forward to this feature too.

where are you telling it your ha ip or mqtt ip?

or unraifd ip…looks likde your running it as a custom component

not a custom component, just a python script run as a command_line sensor. Because the disks.ini file is accessed through a mount point, the only place the IP is coded is in /etc/fstab where the mount point gets created upon reboot.

i like it. thank you

I got this working in docker by doing mapping a container path /emhttp to the host path /var/local/emhttp

the INI files in that director are constantly updated I bet I could write a few scripts to monitor other stuff.

Thanks for this.

Hi,

I’m no programmer at all but i’m looking to find something like the synology monitor platform

but then for my unraid system

Whats the easiest way?

Anyone? Or is this dead?

I have a python script on my unraid server pushing data from the disk.ini flies to mqtt and then HA.

It isn’t tidy but has been running for about a year without issues.

I will look to tidy it up and share it if anybody is interested.

2 Likes

Comment Removed.

I’m interested and would very much welcome your component.
Thank you

Can i do that, so it updates the stats from glances on unraid, only when its up?
if its not up, then show latest value

the space of the disk array is a must :stuck_out_tongue:

1 Like

great! I would be interested too!

1 Like
2 Likes