SteveO-112358

Members
  • Posts

    2
  • Joined

  • Last visited

SteveO-112358's Achievements

Noob

Noob (1/14)

0

Reputation

  1. Thanks for creating this docker template for Unraid. The template has a small bug. The webUI is active on the port that I mapped to port 80 in the template. I have Grafana running on port 3000, so I changed it to 3301. If I navigate directly to my Unraid's IP:3301, I can login, but: When I left click on the container icon in the docker tab of the Unraid dashboard and choose "WebUI", the system takes me to unraidIP:3000. Probably because of this flag in the docker command: -l net.unraid.docker.webui='http://[IP]:[PORT:3000]' that is displayed when I click on "apply" from the template. Thanks again
  2. I've been attempting to query Unraid's api for the past few days. My use case is to retrieve metrics for a grafana dashboard. I see there are some attempts to create an api for Unraid (e.g ElectricBrainUK's Unraid-API docker available in the CA). But I'm wondering if anyone has successfully used the official unraid-api implemented by the My Servers plugin to gather metrics from their own server? It uses graphql instead of the more well know REST-API. I'm part way there but I'm hoping someone with more experience than me can provide some concrete examples of how to authenticate and then get real information from a query. I finally stumbled across some information in /usr/local/bin/unraid-api/README.md and was able to find my api-key here: /boot/config/plugins/dynamix.my.servers/myservers.cfg Using the information in these, I enabled the graphQL playground at http://tower.local/graphql by restarting the unraid-api in debug mode (unraid-api restart -d) and then visiting the "/graphql" endpoint of my server. Tons of information in the graphql playground at that url, including the entire api schema and documentation. Unfortunately I'm not experienced enough with GraphQL to put 2 and 2 together to get what I need. So far I can query the endpoint with: query welcome { welcome { message } } and get back: { "data": { "welcome": { "message": "Welcome my_servers to this Unraid 6.10.0 server" } } } but anything else I try requires authentication - which I haven't yet cracked. E.g. see below query Info { info{ os {uptime } } } results in: { "errors": [ { "message": "my_servers doesn't have permission to access \"os\".", "locations": [ { "line": 3, "column": 5 } ], "path": [ "info", "os" ], "extensions": { "code": "INTERNAL_SERVER_ERROR" } } ], "data": { "info": { "os": null } } } I guess that's because the api-key I'm using and sending in the HTTP header is one that is generated by the "my_servers" user. But how to generate one that I can query my own server with? Or maybe I've got the wrong end of the stick and I can't actually use this to do what I want? Any help appreciated! Cheers