GithubHelp home page GithubHelp logo

electricbrainuk / unraidapi Goto Github PK

View Code? Open in Web Editor NEW
125.0 12.0 13.0 38.37 MB

A WIP open source Node JS API for controlling UNraid

License: GNU General Public License v3.0

JavaScript 71.07% Vue 27.26% HTML 1.51% Dockerfile 0.11% Stylus 0.05%

unraidapi's Introduction

unraidapi's People

Contributors

willnnotdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unraidapi's Issues

Huge ammount of querry to hassio.lan

Describe the bug
When i look at my pihole stats and query, I am being drowned by the amount of hassio.lan queries.
approximately 2 per seconds.

These make my pihole stats and it's kind of annoying.

Expected behavior
A way to disable query to hassio.lan

I have 2 Suggestions to prevent "unknown" status after HA restart.

Is your feature request related to a problem? Please describe.
Every time HA restarts all dockers are in an "unknown" status until the MQTT refresh timer (default 1 hour) updates them.

Describe the solution you'd like
It can be prevented in one of two ways:

  1. add "retain=true" to your MQTT messages, It will save the last value and survive HA restarts.
  2. you are already connected to the MQTT broker, you can subscribe to the home assistant start event and force a refresh.
    Any of the two suggestions above will work, but implementing both will work great!

Describe alternatives you've considered
My alternatives right now is sending a command to Unraid to restart your docker when HA starts (ugly but works)
if you won't implement the change above, my next solution will be re-sending your mqtt messages with a retain=true flag through an automation.

Additional context
When your docker sensors are in "unknown" state, some of my dashboards doesn't work because I am using missing attributes that only shows up after the next mqtt message that you send.
An addon that is mainly used for Home assistant should survive HA restarts.
My solutions are very easy to implement, Let me know if you need help.

[HA Plugin] Config not being read or saving in GUI, causing validation issue and unable to start.

Describe the bug
Home Assistant configuration for the Unraid API addon gets reset when attempting to save.

To Reproduce
Steps to reproduce the behavior:
After adding the repo, cloning, building, then once complete I go to the addon configuration page and attempt to modify any of the values, either in the input boxes or from the "edit yaml" submenu then hit "Save", the values are just reset to defaults.

I tried to go in manually and edit the file:

Details
{
  "name": "Unraid API",
  "version": "1.1",
  "slug": "unraid_api",
  "description": "An Unraid REST/MQTT Bridge for HA and other IOT platforms",
  "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
  "startup": "before",
  "boot": "auto",
  "webui": "http://[HOST]:[PORT:80]",
  "options": {
    "MQTTBroker": "192.168.50.231",
    "MQTTPort": 1883,
    "MQTTUser": mqtt,
    "MQTTPass": mypass,
    "MQTTBaseTopic": unraidmqtt,
    "MQTTSecure": null,
    "MQTTSelfSigned": null,
    "MQTTRefreshRate": 5,
    "MQTTCacheTime": 5,
    "KeyStorage": config
  },
  "schema": {
    "MQTTBroker": "str?",
    "MQTTPort": "int?",
    "MQTTUser": "str?",
    "MQTTPass": "str?",
    "MQTTBaseTopic": "str?",
    "MQTTSecure": "bool?",
    "MQTTSelfSigned": "bool?",
    "MQTTRefreshRate": "int?",
    "MQTTCacheTime": "int?",
    "KeyStorage": "str?"
  },
  "ports": {
    "80/tcp": 3005
  }
}

While this is saved to disk, it is never loaded into the GUI, so the start button is not able to be pressed without failing the validation check. Permission on all the files in the plugin directory seemed to be fine, as least when comparing them to other plugins.

HomeAssistant:
core-2021.3.4
supervisor-2021.03.9

Unraid API (HA plugin)
Current version: 1.1

Unraid 6.9.1

Thanks,
-MH

Cannot read properties of undefined (reading '0') There was a problem retrieving a field for a docker image

Describe the bug
With unraid 6.12 the docker does not work anymore. Getting this in the logs
Cannot read properties of undefined (reading '0')
There was a problem retrieving a field for a docker image

To Reproduce
Steps to reproduce the behavior:

  1. Install Unraid 6.12
  2. Start this docker container
  3. See error in logs

Expected behavior
Application should work as normal

Screenshots

Unraid server (please complete the following information):

  • Version 6.12.0

Unraidapi docker container (please complete the following information):

  • Latest

Additional context

Diagnostic files from unRAID

To do list

Github:

Self:

  • Glances support with MQTT | more info: #17
  • Nvidia transcode data
  • Sensors for disk status (List all disks and whether they are span up or down)
  • More metrics (Glances?)
  • Recreate dockers after docker image recreation
  • Update all dockers
  • Grab docker info for dockers installed without a template
  • NodeRed Compatible MQTT | more info: #5
  • Routine VM XML backup

Requests

  • Toggle to disable new dockers / VMS by default | #20
  • Get docker details via cli not UI
  • Update docs on docker and move to wiki
  • Stagger cache refresh so as not to crash ha
  • Spin up all disks
  • UPS details
  • ha add-on
  • unraid version
  • uptime

UPS data

Hi,
First thank you for this great program!

It would be nice if you could fetch the UPS data, here the unraid link:
/plugins/dynamix.apcupsd/include/UPSstatus.php?all=true

Output (only the first row is relevant):
<tr><td class='green-text'>Online</td><td class='green-text'>100.0 Percent</td><td class='green-text'>17.1 Minutes</td><td class='green-text'>1000 Watts</td><td class='green-text'>400 Watts</td><td class='green-text'>40.0 Percent</td></tr>...

Thank you,
Mathieu

help

the unraid api log:
56EAEEC2-BF3D-4EA4-9AFE-5EF2473B5109

the unraid api webui:
F7654EFB-C8E8-4331-8C7F-033B5E910B9C

this is my config:
652001C5-85ED-4B6D-A66E-1F686B70E2B1

Update Wiki with correct home assistant exmaple UI config

There are a 2 mistakes related to the example config given for HA UI integration, i have given example configs of old and new
Can you update the wiki?

card-modder has been depreciated turning old implementation
'''

  • type: custom:card-modder
    card:
    type: picture
    image: /local/images/unraid.png
    style:
    border-radius: 5px

'''

now is done with card-mod with the config

'''

  • type: picture
    image: /file.png
    card_mod:
    style: |
    ha-card {
    border-radius: 50px;
    }
    '''

entity-attributes-card has been updated to require headers
so you must add these params to it
heading_name: Name
heading_state: State

bar-card's title parameter has been renamed to name turning

  • type: custom:bar-card
    entities:
    - entity: sensor.glances_containers_active
    title: Num Active Containers
    max: 40

to

  • type: custom:bar-card
    entities:
    - entity: sensor.glances_containers_active
    name: Num Active Containers
    max: 40

VMs don't show up.

I have installed the docker container and all my containers show up in Home Assistant as expected. I can toggle them on and off. VMs, while they appear in entities they also have no status and I can't toggle them on and off.

To Reproduce
Steps to reproduce the behavior:

  • entity_id: switch.gobo_vm_*
    shows as unavailable.

Expected behavior
should show on or off

Unraid server (please complete the following information):

  • 6.8.3 Nvidia

Unraidapi docker container (please complete the following information):

  • newest version available from github

Seeing a bunch of lines containing (I removed my domain name for privacy) in the docker log
getaddrinfo EAI_AGAIN domainnameremoved
Get VM Details for ip: domainnameremoved Failed with status code: undefined

Logs filled with authlimit

Describe the bug
Logs filled with authlimit

To Reproduce
Steps to reproduce the behavior:
Unknown

Unraid server (please complete the following information):

  • Version 6.8.2

Unraidapi docker container (please complete the following information):

  • Version, latest as of today

192.168.4.15 = unraidapi
192.168.3.2 = unraid

Feb 27 09:18:52 unraid nginx: 2020/02/27 09:18:52 [error] 26957#26957: *2672413 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.vm.manager/include/VMMachines.php HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:52 unraid nginx: 2020/02/27 09:18:52 [error] 26957#26957: *2672413 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.vm.manager/include/VMMachines.php HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:52 unraid nginx: 2020/02/27 09:18:52 [error] 26957#26957: *2672414 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.docker.manager/include/DockerContainers.php HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:52 unraid nginx: 2020/02/27 09:18:52 [error] 26957#26957: *2672414 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.docker.manager/include/DockerContainers.php HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:52 unraid nginx: 2020/02/27 09:18:52 [error] 26957#26957: *2671238 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "POST /login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2671238 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /Dashboard HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2671238 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /Dashboard HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672422 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.vm.manager/include/VMMachines.php HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672422 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.vm.manager/include/VMMachines.php HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672423 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.docker.manager/include/DockerContainers.php HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672423 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /plugins/dynamix.docker.manager/include/DockerContainers.php HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672424 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 192.168.4.15, server: , request: "GET /Main HTTP/1.1", subrequest: "/auth_request.php", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672424 auth request unexpected status: 502 while sending to client, client: 192.168.4.15, server: , request: "GET /Main HTTP/1.1", host: "192.168.3.2"
Feb 27 09:18:53 unraid nginx: 2020/02/27 09:18:53 [error] 26957#26957: *2672431 limiting requests, excess: 20.637 by zone "authlimit", client: 192.168.4.15, server: , request: "GET /login HTTP/1.1", host: "192.168.3.2"

Please advise.

Docker: Massive amount of writes to Unraid USB flash drive

Hi,

I have a issue with the Unraid API docker container. When it is running, it constantly "writes" to /boot/config/domains.cfg, although the contents of the file itself remain the same (no changes). In exactly two days of server uptime, the flash drive has accumulated ~440k of writes. When I stop the Unraid API docker, the excessive writes stop imediatelly and do not continue.

Steps to reproduce the behavior:

  1. Start Unraid API docker
  2. Check number of flash drive writes

Expected behavior
No excessive writes to the flash drive.

Unraid server (please complete the following information):

  • Version [6.9.2]

Unraidapi docker container (please complete the following information):

  • Version [0.6]

Diagnostic files from unRAID
Attached.

diagnostics-20220411-1208.zip

There was a problem retrieving a field for a docker image

Describe the bug
When the unraid-api docker container starts, most of the topics update in mqtt. When it gets to my custom docker containers this error appears in the console:
There was a problem retrieving a field for a docker image Cannot read property 'contents' of undefined
After the error the api is unresponsive, and it does not update any mqtt topics.

Unraid server (please complete the following information):

  • Version 6.8.3

Unraidapi docker container (please complete the following information):

  • Version 0.5.0 (latest as of 6 feb 2021)

Any way to log in automatically on container start?

Hello,

Perhaps I have not configured everything properly, but any time the container is restarted, I have to open the UnRAID API webUI and log in with my unraid server credentials. Is there a way to initiate a log in automatically on container start?

Can't install HA-Addon

Hello,

I receive the following error message:

Logger: homeassistant.components.hassio
Source: components/hassio/websocket_api.py:138
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 13:01:48 (3 occurrences)
Last logged: 13:12:52

Failed to to call /addons/ec6fce2f_unraid_api/install - The command '/bin/sh -c npm install' returned a non-zero code: 134

What could be the reason for this?

Best regards

Allow server key storage option

Currently the server keys are kept in the containers memory so as not to save the encoded password in a file. This means the user must enter their password each time the container is updated.

Should add an option to allow these keys to be stored.

Issue with docker running on UNRaid

Hi,

I have an issue where the unraid docker starts, runs for a while and the just crashes out with the following.

Below are the logs

Connected to mqtt broker

READY Server listening on http://0.0.0.0:80

Get Docker Details for ip: https://10.2.10.248 Failed

Cannot read property 'forEach' of undefined
/app/mqtt/index.js:547
let docker = server.docker.details.containers[dockerId];
^

TypeError: Cannot read property 'containers' of undefined
at ModuleContainer.getDockerDetails (/app/mqtt/index.js:547:38)
at listOnTimeout (internal/timers.js:551:17)
at processTimers (internal/timers.js:492:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
npm ERR! Exit status 1

npm ERR! Failed at the [email protected] start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-04T09_04_05_039Z-debug.log

[email protected] start /app
cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js

Feature request, Network Monitoring

i want to monitor Network speed ( Upload, Download ) with Home Assistant. Unraid-api is a really easy tool for monitoring most of the system components of my Server, except Networking.

My optimal answer woudt be to just add Download & Upload speed to the Unraid API Project . Such that Homeassistant can just grab the two attributes and use them in Automations and Display.

No data coming back

I setup the docker container, then went to :3005 webpage to put in my credentials. The webpage shows nothing after:

Screen Shot 2020-01-04 at 4 17 59 PM

And if I hit the REST endpoint it comes back empty too:

$ curl -q http://tower:3005/api/getServers | jq

{
  "servers": {
    "192.168.1.8": {
      "docker": {
        "details": {
          "images": {},
          "containers": {}
        }
      },
      "vm": {
        "details": {}
      },
      "serverDetails": {
        "on": false
      }
    }
  },
  "status": 200
}

(This is unraid 6.8.0)

Also nothing useful in the docker log ->

> [email protected] start /app
> cross-env NUXT_HOST=0.0.0.0 NUXT_PORT=80 NODE_ENV=production node server/index.js

Connected to mqtt broker

READY Server listening on http://0.0.0.0:80

Change Host Port

Hello,

i run my Unraid server on port 8088 and not 80. it would be nice to change that

[FR] - Unraid current version

Describe the solution you'd like
I can pull the available version as a sensor into HA. Any idea how you could service the current running Version?

Describe alternatives you've considered
snmp doesnt seem to work

Additional context
alerts / automation based on available update ๐Ÿ‘

CPU temperature

Is your feature request related to a problem? Please describe.
I would like to request the addition of CPU temp

State attributes for switch.unas_array exceed maximum size of 16384 bytes.

Receiving the following errors in HA

"State attributes for switch.unas_array exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored
State attributes for binary_sensor.unas_server exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored"

Seems to be the "version" attribute

arrayStatus: Started
moverRunning: true
parityCheckRunning: true
title: uNAS
cpu: 
memory: 

motherboard: le>uNAS/Dashboard
version: E html>
<html lang="en">
<head>
<title>uNAS/Dashboard</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
<meta name="format-detection" content="telephone=no">

Expected behavior
No HTML in this attribute

Unraid server (please complete the following information):

  • Version 6.12.6 2023-12-01

Unraidapi docker container (please complete the following information):

  • Version [LATEST]

[Request] Add Parity Rebuild status

Hi, just installed this on my server which I had also just replaced the parity drive in and I noticed that the ParityCheckRunning state was false.

Which is true I suppose, it is not a parity check that is running, it is a rebuild.

This seems like a status that would be worth monitoring, along with the Elapsed Time, Current Position, and maybe Estimated Speed. I'm not sure Estimated Finish is needed or not.

image

Basically looking for this info block, I clipped it from the Main page in Unraid.

Unraid crashes when unraid API is booted up

Describe the bug
When i am starting the following stack, over the unraid compose addon, I am getting my Unraid Array stopped and unraid is no more reachable after another minute / array is finally stopped.

To Reproduce
Steps to reproduce the behavior:

  1. add my docker compose
  2. add .ENV File
  3. start it over docker compose addon of unraid
  4. after unraid connects to my MQTT Server which is hosted on IOBroker, another service which is not included here.
  5. I see in Unraid WebUI that my Array getting stopped
  6. After 1-2 Minutes my Unraid Webui is no more reachable
  7. System needs to reboot to get available again.

Expected behavior
My Unraid System is not touched

Screenshots
If applicable, add screenshots to help explain your problem.

Unraid server (please complete the following information):
8.11.5

Unraidapi docker container (please complete the following information):
latest

Additional context

Diagnostic files from unRAID
Its not including the error, because its not saved due to reboot
tower-diagnostics-20230107-0816.zip

i used the Ulimate Unraid Dashboard Guide to setup a Dashboard for Unraid. Part of it is Unraid API. When i boot this one up, my Unraid Array gets offline, Unraid crashes/gets unavailable over network after a Minute or so.
https://github.com/HStep20/Ultimate-Unraid-Dashboard-Guide

I have a NGinx network, most of the rest docker-compose is untouched.

https://github.com/HStep20/Ultimate-Unraid-Dashboard-Guide/blob/master/Ultimate_Unraid_Dashboard.yml

and here is my edited compose

version: "3"
services:
  influxdb:
    container_name: GUS-influx
    image: influxdb:1.8.4
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - 8086:8086
    volumes:
      - ${APPDATA_PATH}/GUS-influxdb:/var/lib/influxdb
    restart: unless-stopped
    environment:
      TZ: ${TIMEZONE}
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/pootzko/InfluxData.Net/master/nuget-icon.png"
      
  chronograf:
    image: chronograf:alpine
    container_name: GUS-chronograf
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    volumes:
      - ${APPDATA_PATH}/GUS-chronograf:/var/lib/chronograf
    ports:
      - ${CHRONOGRAF_UI_PORT}:8888
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://external-content.duckduckgo.com/ip3/docs.influxdata.com.ico"
      - "net.unraid.docker.webui=http://[IP]:[PORT:7889]/"

  telegraf:
    container_name: GUS-telegraf
    image: telegraf:1.20.2-alpine
    privileged: true
    network_mode: host
    hostname: ${HOSTNAME}
    expose:
      - 6379
    volumes:
      - /var/run/utmp:/var/run/utmp:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /:/rootfs:ro
      - /sys:/rootfs/sys:ro
      - /etc:/rootfs/etc:ro
      - /proc:/rootfs/proc:ro
      - ${APPDATA_PATH}/GUS-telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
      - /run/udev:/run/udev:ro
    environment:
      HOST_PROC: /rootfs/proc
      HOST_SYS: /rootfs/sys
      HOST_ETC: /rootfs/etc
      HOST_MOUNT_PREFIX: /rootfs
      TZ: ${TIMEZONE}
    restart: unless-stopped
    command: /bin/sh -c 'apk update && apk upgrade && apk add ipmitool && apk add smartmontools && apk add lm_sensors && telegraf'
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://github.com/atribe/unRAID-docker/raw/master/icons/telegraf.png"  
      
  varken:
    container_name: GUS-varken
    image: boerderij/varken
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    volumes:
      - ${APPDATA_PATH}/GUS-varken:/config
    environment:
      TZ: ${TIMEZONE}
    restart: unless-stopped
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/benderstwin/docker-templates/master/images/varken.png"
 
  grafana:
    container_name: GUS-grafana
    image: grafana/grafana
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - ${GRAFANA_UI_PORT}:3000
    volumes:
      - ${APPDATA_PATH}/GUS-grafana:/var/lib/grafana
    environment:
      GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL}
      GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
      TZ: ${TIMEZONE}
    depends_on:
      - influxdb
      - telegraf
    #  - unraidapi
      - varken
    restart: unless-stopped
    command: grafana-cli plugins install grafana-piechart-panel && grafana-cli plugins install grafana-worldmap-panel && grafana-cli plugins install marcusolsson-json-datasource && grafana-cli plugins install dalvany-image-panel
    labels:
      - "net.unraid.docker.icon=https://github.com/atribe/unRAID-docker/raw/master/icons/grafana.png"
      - "net.unraid.docker.webui=http://[IP]:[PORT:3000]/"

  unraidapi:
    container_name: GUS-unraidapi
    image: electricbrainuk/unraidapi
    network_mode: bridge
    networks: 
      - nginx
    hostname: ${HOSTNAME}
    ports:
      - ${UNRAID_API_UI_PORT}:80
    volumes:
      - ${APPDATA_PATH}/GUS-UnraidAPI:/app/config
    environment:
      MQTTBroker: 192.168.3.2
      MQTTPort: 1883
      MQTTPass: supersecure
      MQTTUser: username
      MQTTBaseTopic: unraidapi
      KeyStorage: config
      TZ: ${TIMEZONE}
    restart: unless-stopped
    depends_on:
      - influxdb
    labels:
      - "net.unraid.docker.icon=https://raw.githubusercontent.com/ElectricBrainUK/UnraidAPI/master/static/iconx64.png"
      - "net.unraid.docker.webui=http://[IP]:[PORT:13305]/"


networks:
  nginx:
    external: true

here my ENV File

HOSTNAME="192.168.3.2"
TIMEZONE="Europe/Berlin"
APPDATA_PATH="/mnt/user/appdata"
CHRONOGRAF_UI_PORT=7889
UNRAID_API_UI_PORT=13305
GRAFANA_UI_PORT=3000
GF_SERVER_ROOT_URL="https://grafana.domain.com"
GF_SECURITY_ADMIN_PASSWORD="SUPERSECUREPASSWORD"

The last 2 entries are anonymized.


In my AppData folder of unraidAPI these files where created:

  • server.json
  • mqttKeys

The server.json includes a lot of personal information I don't want to share but:

  • file was created when the service started
  • it includes a state where the array was not stopped, no mover was running, no party check was performed, which was for starting time of this service was a valid info. [1]

mqttKeys includes a valid key

{"192.168.3.2":"ABCIAMAKEY=="}

[1]
"192.168.3.2":{"serverDetails":{"arrayStatus":"Started","moverRunning":false,"parityCheckRunning":false,"title":"Tower","cpu":"11th Gen Intel&#174; Core&#8482; i7-11700K @ 3.60GHz","memory":"64 GiB DDR4 ","motherboard":"Micro-Star International Co., Ltd. MAG B560 TORPEDO (MS-7D15) , Version 2.0","version":"6.11.5","on":true}

Feature Request: Checkbox for Toggling Auto VM/Docker/USB Expose

Is your feature request related to a problem? Please describe.
Docker Containers/VMs are automatically exposed to MQTT. With HA autodiscovery on, this can cause needless headaches when experimenting with containers.

Describe the solution you'd like
A simple check box like "do not expose automatically" for VMs, Dockers, USB devices etc.

6.10.0-rc1 excess libvirt logs

When running UnraidAPI w/ Unraid 6.10.0-rc1 I get this in my libvirt logs non-stop that eventually fills up /var/log after a day or two.

2021-10-25 16:41:16.860+0000: 22571: error : virConnectNumOfDefinedStoragePools:244 : this function is not supported by the connection driver: virConnectNumOfDefinedStoragePools
2021-10-25 16:41:16.861+0000: 22570: error : virConnectNumOfStoragePools:164 : this function is not supported by the connection driver: virConnectNumOfStoragePools
2021-10-25 16:41:16.863+0000: 22568: error : virConnectNumOfStoragePools:164 : this function is not supported by the connection driver: virConnectNumOfStoragePools
2021-10-25 16:41:16.863+0000: 68515: error : virConnectNumOfDefinedStoragePools:244 : this function is not supported by the connection driver: virConnectNumOfDefinedStoragePools
2021-10-25 16:41:16.863+0000: 34239: error : virConnectNumOfSecrets:79 : this function is not supported by the connection driver: virConnectNumOfSecrets

Is there a workaround to stop the excess logging?

Password on WebUI

Hi there,

I would like to request a password on the WebUI
Anyone within the network can now control Unraid like stopping the Array.

Thanks!

NodeRed Compatible MQTT

Add a more segmented option for mqtt to work better with NodeRed as suggested by Karatekid in the unraid forums
e.g.:

servername
    systeminfo
        arrayStatus
        arrayProtection
        ...
    vm
        vm1
            switch_1
            id
            status
            usb
                name
                attached
            ...
    docker
        container1
            switch_1
            imageUrl
            name
            status
            ...

Unraid container maxing out CPU cores / threads

Hi there.

Thanks for this - looks v promising!

Just installed this on my Unraid server and connected to HA (which runs on a VM also on that Unraid server).

All connects fine, MQTT broker in HA connects and entities appear in HA.

However, aprox 30 sec after I start your API container in Unraid, my CPU / CORES go from around 25%-35% (their base level with what I run on unraid) to 100% and stay there. The VMS / dockers slow to a crawl.

Here is log from your API container after starting:

[email protected] start
cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
WARN mode option is deprecated. You can safely remove it from nuxt.config
READY Server listening on http://0.0.0.0:80
Connected to mqtt broker
Connected to mqtt broker
Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: started assigning ID: MQTT-R-knafunrt
MQTT-R-knafunrt succeeded
Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: stopped assigning ID: MQTT-R-knafuthk
Received MQTT Topic: homeassistant/hal/daapd/dockerState and Message: started assigning ID: MQTT-R-knafuxsj
MQTT-R-knafuxsj succeeded
MQTT-R-knafuthk succeeded
npm notice
npm notice New minor version of npm available! 7.5.1 -> 7.9.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.9.0
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! path /app
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-04-09T15_06_27_910Z-debug.log
[email protected] start
cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
WARN mode option is deprecated. You can safely remove it from nuxt.config
READY Server listening on http://0.0.0.0:80
Connected to mqtt broker
npm ERR! path /app
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-04-09T15_14_49_813Z-debug.log
[email protected] start
cross-env NUXT_HOST=0.0.0.0 NODE_ENV=production node server/index.js
WARN mode option is deprecated. You can safely remove it from nuxt.config
READY Server listening on http://0.0.0.0:80
Connected to mqtt broker
Connected to mqtt broker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.