[Support] Unraid simple monitoring API


Recommended Posts

A simple REST API to receive basic metrics about your Unraid installation such as Disk utilization and Network traffic. Originally created to be used with https://gethomepage.dev/ (Custom API Widget).

 

Dockerhub [OLD]: https://hub.docker.com/r/nebn/unraid-simple-monitoring-api

Github Container Registry [NEW]: https://github.com/NebN/unraid-simple-monitoring-api/pkgs/container/unraid-simple-monitoring-api

Github: https://github.com/NebN/unraid-simple-monitoring-api

 

*** UPDATE ***

Migrated from DockerHub to GitHub Container Registry.

If you have installed before April 2024 please reinstall or manually change  
Repository to  
ghcr.io/nebn/unraid-simple-monitoring-api:latest

 

And optionally
Registry URL to  
https://github.com/NebN/unraid-simple-monitoring-api/pkgs/container/unraid-simple-monitoring-api
 

I will keep pushing to DockerHub for now, but would like to definitively migrate.

***************

 

A configuration file needs to be placed at 

/mnt/user/appdata/unraid-simple-monitoring-api/conf.yml

 

More information on the Github readme, but in short it needs to be like this:

networks:
  - eth0
disks:
  cache:
    - /mnt/cache
  array:
    - /mnt/disk1
    - /mnt/disk2

 

 

Edited by NebN
DockerHub migration
Link to comment
Posted (edited)
3 hours ago, ptchernegovski said:

Got this installed, and running mostly. I am having issues trying to add my other caches. Have 3 different pools. Any advise?

 

Could you provide me with more information about the issue you are encountering? Have you added all your cache pool mount points to your configuration? Like this:

 

disks:
  cache:
    - /mnt/cache
    - /mnt/your/second/cache
    - /mnt/your/third/cache

 

To figure out where your caches are mounted you can mouseover this icon in your Unraid "Main" tab.

image.png.a62b0c889d0b2fbc2047754d58b08a0b.png

 

You can also check the Application's logs for any errors. You can do this by browsing to Docker > Click on the application's icon > Logs

Edited by NebN
Link to comment
11 hours ago, NebN said:

 

Could you provide me with more information about the issue you are encountering? Have you added all your cache pool mount points to your configuration? Like this:

 

disks:
  cache:
    - /mnt/cache
    - /mnt/your/second/cache
    - /mnt/your/third/cache

 

To figure out where your caches are mounted you can mouseover this icon in your Unraid "Main" tab.

image.png.a62b0c889d0b2fbc2047754d58b08a0b.png

 

You can also check the Application's logs for any errors. You can do this by browsing to Docker > Click on the application's icon > Logs

I have 3 cache pools, when I put them together like this under "cache" it combines them in homepage for space left, etc

cache1.PNG.1b138a2f66337472cb642dc08c4b2c9b.PNG

I want them to be separate in the system, so I can see each pool, and how full it is

cache2.PNG.69b7b0ad807b81fcdc0726b748a77598.PNG

These are my 3 different pools. They are only sensed by the API, if all under the 1 "cache" heading

Link to comment
Posted (edited)
46 minutes ago, ptchernegovski said:

I have 3 cache pools, when I put them together like this under "cache" it combines them in homepage for space left, etc

cache1.PNG.1b138a2f66337472cb642dc08c4b2c9b.PNG

[...]

These are my 3 different pools. They are only sensed by the API, if all under the 1 "cache" heading

 

I understand.

 

The API currently sends both "total" and separate disk / network data. You need to change your homepage configuration in order to see the information displayed separately. While trying it out myself I found out that currently the disks / network data is being sent in an unpredictable order, so for now the solution I will show you might change the order of the results when the API gets called each time. I have opened an issue to fix this (https://github.com/NebN/unraid-simple-monitoring-api/issues/3).

 

This is what you have to do in services.yaml:

If you wish to have "horizontal" data (max 4), you need to grab the data in the "cache" field, this example and screenshot is using the "array" field, as I do not have more than one cache mount to test this with, just change "array" to "cache". You can change the "label" to whatever you prefer, but unfortunately since the order of the disks in the response is random at the moment it does not make much sense to name them something like "disk0", "disk1".

 

image.png.1fedbb7c2982bf177311f54dac616942.png

# This will create 4 horizontal groups from the first 4 disks in the array
- Unraid:
    icon: unraid.png
    href: http://your-unraid-ip
    widget:
      type: customapi
      url: http://your-unraid-ip:24940
      method: GET
      mappings:
        - field:
            array: # change this to "cache" if you want cache data
              0: free # first item in the response, reading field "free"
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # change this to "cache" if you want cache data
              1: free # second item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"
         - field:
             array: # change this to "cache" if you want cache data (and have 3 cache mounts)
               2: free # third item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"
         - field:
             array: # change this to "cache" if you want cache data (and have 4 cache mounts)
               3: free # fourth item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"

 


Alternatively, you can add as many items as you want (I think) if you activate "display: list". Like this

image.png.53c607085648f80db9e505487a38e813.png

# This will create a list view of the first 5 disks in the array
- Unraid:
    icon: unraid.png
    href: http://<your-unraid-ip>
    widget:
      type: customapi
      url: http://<your-unraid-ip>:24940
      method: GET
      display: list # <-- this is the line to add to enable list view and see more than 4 items
      mappings:
        - field:
            array: # or cache
              0: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              1: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              2: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              3: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              4: free
          label: Free
          format: number
          suffix: "GiB"

 

 

You can read more about this on the official Homepage documentation on Custom API Widget

https://gethomepage.dev/latest/widgets/services/customapi/#example

 

P.S.: You can open up your browser to http://your-unraid-api:24940/ to see what data is being sent, so you see what you have available to read from  Homepage. You can also see an example example json response here on the readme.

Edited by NebN
forgot link + PS
  • Like 1
Link to comment
4 hours ago, NebN said:

 

I understand.

 

The API currently sends both "total" and separate disk / network data. You need to change your homepage configuration in order to see the information displayed separately. While trying it out myself I found out that currently the disks / network data is being sent in an unpredictable order, so for now the solution I will show you might change the order of the results when the API gets called each time. I have opened an issue to fix this (https://github.com/NebN/unraid-simple-monitoring-api/issues/3).

 

This is what you have to do in services.yaml:

If you wish to have "horizontal" data (max 4), you need to grab the data in the "cache" field, this example and screenshot is using the "array" field, as I do not have more than one cache mount to test this with, just change "array" to "cache". You can change the "label" to whatever you prefer, but unfortunately since the order of the disks in the response is random at the moment it does not make much sense to name them something like "disk0", "disk1".

 

image.png.1fedbb7c2982bf177311f54dac616942.png

# This will create 4 horizontal groups from the first 4 disks in the array
- Unraid:
    icon: unraid.png
    href: http://your-unraid-ip
    widget:
      type: customapi
      url: http://your-unraid-ip:24940
      method: GET
      mappings:
        - field:
            array: # change this to "cache" if you want cache data
              0: free # first item in the response, reading field "free"
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # change this to "cache" if you want cache data
              1: free # second item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"
         - field:
             array: # change this to "cache" if you want cache data (and have 3 cache mounts)
               2: free # third item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"
         - field:
             array: # change this to "cache" if you want cache data (and have 4 cache mounts)
               3: free # fourth item in the response, reading field "free"
           label: Free
           format: number
           suffix: "GiB"

 


Alternatively, you can add as many items as you want (I think) if you activate "display: list". Like this

image.png.53c607085648f80db9e505487a38e813.png

# This will create a list view of the first 5 disks in the array
- Unraid:
    icon: unraid.png
    href: http://<your-unraid-ip>
    widget:
      type: customapi
      url: http://<your-unraid-ip>:24940
      method: GET
      display: list # <-- this is the line to add to enable list view and see more than 4 items
      mappings:
        - field:
            array: # or cache
              0: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              1: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              2: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              3: free
          label: Free
          format: number
          suffix: "GiB"
        - field:
            array: # or cache
              4: free
          label: Free
          format: number
          suffix: "GiB"

 

 

You can read more about this on the official Homepage documentation on Custom API Widget

https://gethomepage.dev/latest/widgets/services/customapi/#example

 

P.S.: You can open up your browser to http://your-unraid-api:24940/ to see what data is being sent, so you see what you have available to read from  Homepage. You can also see an example example json response here on the readme.

excellent, thanks for that. I will play around with it when I get the next chance, and see what I can do. My response when I go to "http://your-unraid-ip:24940" is definitely changing the order, and just written continuously, not separate lines like in the example. I can screenshot when home if you need.
I like the CPU lookup you added too, may have to use that as well

Link to comment
7 hours ago, ptchernegovski said:

My response when I go to "http://your-unraid-ip:24940" is definitely changing the order, and just written continuously, not separate lines like in the example. 

 

Yes an API response is usually not meant to be read directly by a person, so it is not formatted, it's just a single line with no spaces to make the message as small as possible. It can still be useful to read it directly,  like in this case, so you know exactly what data you have available to read with Homepage. If you want to make it easier to read (like on the GitHub readme) you can google "json formatter".

 

For example you saw the new "CPU" field

"cpu":{"load_percent":6.54}

 

and looking at this JSON you know that your Homepage services.yaml should look like this to display CPU load:

- field:
    cpu: load_percent # name_of_the_main_object: name_of_the_field
  label: CPU # or whatever you prefer
  format: percent

 

Link to comment

For me, almost everything works fine. Problem is, here and there, seemingly at random, there is a parsing error:

 

...
[2024-04-01T20:49:31.797Z] warn: Invalid data for widget 'customapi' endpoint 'null':
Expected:undefined
Parse error: SyntaxError: Unexpected token j in JSON at position 0
Data: {"type":"Buffer","data":[106,115,111,110,58,32,117,110,115,117,112,112,111,114,116,101,100,32,118,97,108,117,101,58,32,78,97,78]}
[2024-04-01T20:49:51.909Z] warn: Invalid data for widget 'customapi' endpoint 'null':
Expected:undefined
Parse error: SyntaxError: Unexpected token j in JSON at position 0
Data: {"type":"Buffer","data":[106,115,111,110,58,32,117,110,115,117,112,112,111,114,116,101,100,32,118,97,108,117,101,58,32,78,97,78]}
[2024-04-01T20:50:01.985Z] warn: Invalid data for widget 'customapi' endpoint 'null':
Expected:undefined
Parse error: SyntaxError: Unexpected token j in JSON at position 0
Data: {"type":"Buffer","data":[106,115,111,110,58,32,117,110,115,117,112,112,111,114,116,101,100,32,118,97,108,117,101,58,32,78,97,78]}
...

 

and a random disk widget reports an error:

 

hpi1.thumb.png.4d7cf04d32878ed725c9c26002fec118.png

 

On the next refresh, the error goes away completely for a while, or appears for some other disk.

 

For the life of me, I can't find the reason.

 

p.s.

First seven widgets use Glances service. And I've never had this kind of problem with it.

 

Edited by IggyWhite
additional comment
Link to comment
Posted (edited)
28 minutes ago, IggyWhite said:

For me, almost everything works fine. Problem is, here and there, seemingly at random, there is a parsing error:

[...]


That's very odd.

To be able to figure this out we'll need some additional information, if you don't want to post it here feel free to message me privately.

 

I'm guessing the log you posted is from Homepage.

 

You can start by checking the application's logs, if there are any errors we might already get an answer.  You can find these by going to the Docker Tab on Unraid, click on unraid-simple-monitoring-api and select "logs".

 

If there are no errors, then I'll ideally need:
- homepage services configuration, to see what response fields you are trying to read

- unraid-simple-monitoring-api configuration, to see the data that is supposed to be sent

- response from http://your-unraid-api:24940 to see how the data is actually being sent

 

You said this error is random, so it might be difficult to figure out, but this should start to give me an idea of where the problem might be.

 

EDIT: I see you are trying to read the data from a specific disk, as mention in an above answer, the software initially sent the disk data in a random order, this has now been corrected, so if you haven't already, please update to the latest version (this version sends the data in the order specified in your conf.yml)

Edited by NebN
Link to comment

This is the excerpt from unraid-simple-monitoring-api log (sorry for the long listing):

 

...
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:29 ERROR Error trying to respond to API call error="json: unsupported value: NaN"
2024/04/01 21:59:29 ERROR Error trying to respond to API call error="json: unsupported value: NaN"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 21:59:39 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:00:47 INFO Not running in privileged mode. Will not be able to check zfs datasets.
2024/04/01 22:00:47 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:00:47 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:00:47 INFO API running on port 24940 ...
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:02:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:38 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Error trying to respond to API call error="json: unsupported value: NaN"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:40 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Error trying to respond to API call error="json: unsupported value: NaN"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:42 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:04:52 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/rx_bytes: no such file or directory"
2024/04/01 22:05:17 ERROR Cannot read network data interface=bound0 error="open /sys/class/net/bound0/statistics/tx_bytes: no such file or directory"
...

 

Link to comment

Thanks for the information.

 

Quote

but shouldn't it be bond0, not bound0?

Yes the usual name for a network interface is bond0, this is read directly from your unraid-simple-monitoring-api/conf.yml, so you probably have spelled it incorrectly.


I do suspect that this is not the source of the issue you are decribing, but rather this

Quote

ERROR Error trying to respond to API call error="json: unsupported value: NaN"

Although unfortunately it is rather vague.

 

I'd suggest you correct, or even remove if you are not interested in it, the "bound0" interface from conf.yml and see if that fixes the issue, though I have a feeling it won't.

Link to comment
Posted (edited)

I have figured out part of the problem, and added additional logs to figure out the rest. If you could it would be of great help if you could follow these instructions on how to setup a QA build. 

This build should:

  • no longer have Homepage give this error "Parse error: SyntaxError: Unexpected token j in JSON at position 0". It might give a different one, just a bit more helpful.
  • print additional logs in addition to "ERROR Error trying to respond to API call error="json: unsupported value: NaN"" in the unraid application, this is where we should be able to understand the issue better

 

 

Edited by NebN
Link to comment
14 minutes ago, NebN said:

Yes the usual name for a network interface is bond0, this is read directly from your unraid-simple-monitoring-api/conf.yml, so you probably have spelled it incorrectly.

 

 I'm such a dumbass... You were right, I misspelled bond0 to bound0 in conf.yaml. 🥺

Edited by IggyWhite
Link to comment
2 minutes ago, IggyWhite said:

But

 

ERROR Error trying to respond to API call error="json: unsupported value: NaN"

 

still persists, though.

 

Yeah as I suspected the "bound0" was not really the cause of the issue. I have run this application with several missing disks/networks and it always behaved correctly.

It would be of great help if you could install the QA build with additional logging as I described earlier in this post. If you don't feel comfortable doing this I can push an official build later with the improved logging, as this is something that will make it to the official version anyway.

Link to comment
16 hours ago, NebN said:

It would be of great help if you could install the QA build with additional logging as I described earlier in this post. If you don't feel comfortable doing this I can push an official build later with the improved logging, as this is something that will make it to the official version anyway.

I will do this later today, if time permits, and let you know how it went/post logs here.

Link to comment

It's the CPU, it seems:

2024/04/02 15:22:28 ERROR Error trying to respond to API call error="json: unsupported value: NaN" "attempting to marshal"="{Array:[{Path:/mnt/disk1 Total:3725 Used:2162 Free:1563 UsedPercent:58.04 FreePercent:41.96} {Path:/mnt/disk2 Total:3724 Used:1862 Free:1862 UsedPercent:50 FreePercent:50} {Path:/mnt/disk3 Total:3724 Used:486 Free:3238 UsedPercent:13.05 FreePercent:86.95}] Cache:[{Path:/mnt/mcache Total:953 Used:2 Free:951 UsedPercent:0.21 FreePercent:99.79} {Path:/mnt/vcache Total:953 Used:86 Free:867 UsedPercent:9.02 FreePercent:90.98}] Network:[{Iname:bond0 RxMiBs:0 TxMiBs:0 RxMbps:0 TxMbps:0}] ArrayTotal:{Path:total Total:11173 Used:4510 Free:6663 UsedPercent:40.37 FreePercent:59.63} CacheTotal:{Path:total Total:1906 Used:88 Free:1818 UsedPercent:4.62 FreePercent:95.38} NetworkTotal:{Iname:total RxMiBs:0 TxMiBs:0 RxMbps:0 TxMbps:0} Cpu:{LoadPercent:NaN} Memory:{Total:128826 Used:4411 Free:124415 UsedPercent:3.42 FreePercent:96.58}}\n"

 

There are two Intel Xeons E5-2640 v4 with 10 cores, 20 threads each.

hpi2.png

Link to comment
Posted (edited)
20 minutes ago, IggyWhite said:

It's the CPU, it seems:

2024/04/02 15:22:28 ERROR Error trying to respond to API call error="json: unsupported value: NaN" "attempting to marshal"="{Array:[{Path:/mnt/disk1 Total:3725 Used:2162 Free:1563 UsedPercent:58.04 FreePercent:41.96} {Path:/mnt/disk2 Total:3724 Used:1862 Free:1862 UsedPercent:50 FreePercent:50} {Path:/mnt/disk3 Total:3724 Used:486 Free:3238 UsedPercent:13.05 FreePercent:86.95}] Cache:[{Path:/mnt/mcache Total:953 Used:2 Free:951 UsedPercent:0.21 FreePercent:99.79} {Path:/mnt/vcache Total:953 Used:86 Free:867 UsedPercent:9.02 FreePercent:90.98}] Network:[{Iname:bond0 RxMiBs:0 TxMiBs:0 RxMbps:0 TxMbps:0}] ArrayTotal:{Path:total Total:11173 Used:4510 Free:6663 UsedPercent:40.37 FreePercent:59.63} CacheTotal:{Path:total Total:1906 Used:88 Free:1818 UsedPercent:4.62 FreePercent:95.38} NetworkTotal:{Iname:total RxMiBs:0 TxMiBs:0 RxMbps:0 TxMbps:0} Cpu:{LoadPercent:NaN} Memory:{Total:128826 Used:4411 Free:124415 UsedPercent:3.42 FreePercent:96.58}}\n"

 

I was just looking into this, it seems to me like there might be a division by zero when computing the time between CPU snapshots. I have just now pushed a new QA version, you can just update it like normal from the Docker Tab. See if it's fixed (although I'm curious as to why the time delta between CPU snapshots seems to be zero).

 

EDIT: I was wrong in my initial analysis, if the problem is where I think it is, it is not due to a 0 time difference, but a 0 difference between actual CPU usage between the 2 snapshots, which is equally weird.

Edited by NebN
Link to comment
10 hours ago, IggyWhite said:

So, six hours later, not a single error! 🙂

 

Excellent. I have just updated the official version, you can just disable/remove the QA one and update the main app. Thanks for your help with figuring this out!

Link to comment

Okay, I'm clearly being dense today.

I keep getting this error:
 

text  error  warn  system  array  login  

2024/04/08 21:59:59 ERROR Cannot read conf.yml error="read /app/conf.yml: is a directory"

** Press ANY KEY to close this window ** 

 

I have a text file named "conf.yml" inside the folder "/mnt/user/appdata/unraid-simple-monitoring-api/conf.yml" and I get the error above. 

I tried to move it to "/mnt/user/appdata/unraid-simple-monitoring-api/" but same.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.