(Terramaster) NAS monitoring via MQTT

Hi all,
Just wanted to share with you that it’s possible to publish monitoring information (in my case CPU usage, CPU temp and HDD temperatures) related to Terramaster ARM NAS devices (in my case an F2-210) via the nice ‘psmqtt’ project.
I managed to integrate it on my TNAS by applying a few changes and then using a docker container. See my fork at

GitHub - f18m/psmqtt: Utility reporting system health and status via MQTT

TL;DR:

docker run -d -v <your config file>:/opt/psmqtt/conf/psmqtt.conf \
   --privileged --hostname tnas \
   ghcr.io/f18m/psmqtt:1.0.2

Hope this helps anybody else other users having a TerraMaster NAS (or just a NAS even)!

2 Likes

Could you give any more instruction on how to set this up on a TerraMaster NAS? I’m new to docker and would like to try this out

hey @makeitworktech ,
You should enable SSH access on your TerraMaster NAS.
Then login via SSH (if you’re on Windows you can use the Putty client or the MobaXTerm client) and then copy paste the lines of my post on the terminal:

docker run -d -v <your config file>:/opt/psmqtt/conf/psmqtt.conf \
   --privileged --hostname tnas \
   ghcr.io/f18m/psmqtt:1.0.2

See e.g. How to log in to the SSH terminal? - TerraMaster Official Forum for more details on how to setup SSH

HTH,
Francesco

Awesome, thanks! What do we substitute for ?
Do we need to create a config file ?

yeah you’re right. I forgot to mention that you will need to store somewhere (e.g. /home/) a file like this one:

More info about its syntax in the psmqtt README psmqtt/README.rst at c137c460a5df82b70b02f56b80214453b02e374a · eschava/psmqtt · GitHub

Once your file is ready, the -v <your config file>:/opt/psmqtt/conf/psmqtt.conf portion of the command I posted earlier will expose your customized configuration file to the psmqtt application that runs inside the docker container…

Hello, can you help me? I get an error - socket.gaierror: [Errno -2] Name does not resolve
What should I change in the file - psmqtt.conf ?
Thanks in advance

Hey @Triplid ,
I see you’re mentioning the file psmqtt.conf.
That was used in psmqtt v1.
Can you update to the latest psmqtt version, i.e. v2, which uses a YAML file for configuration, see e.g. psmqtt/psmqtt.yaml at d06449a576684f9182ba3e51afe0f81c0da5b58f · eschava/psmqtt · GitHub

1 Like

Please note that the earlier comments in this thread, showing the contents of psmqtt.conf apply only to the old version v1, which is not supported anymore. Checkout the latest docs at psmqtt/doc/usage.md at d06449a576684f9182ba3e51afe0f81c0da5b58f · eschava/psmqtt · GitHub

1 Like

Hi, thanks for the links and help, everything worked out! The only thing I couldn’t get was the CPU temperature, do you know how to fix the code? The device is terramaster f2-212. I also tried to get the fan data, but I’m new to this and it hasn’t worked yet

@Triplid I think the F2-212 would be similar to my TNAS, so try this:


schedule:
  - cron: "every 1 minute"
    tasks:
      # cpu temp
      - task: sensors_temperatures
        params: [ rtk_thermal, 0 ]
        ha_discovery:
          name: "CPU Temperature"
          unit_of_measurement: "°C"
          platform: sensor
          device_class: temperature
          icon: mdi:thermometer
1 Like

Unfortunately it didn’t work either, but neural networks helped :slight_smile:
in the end it worked - [ cpu-thermal, 0 ]

1 Like