QNAP app enable API

Hello,

I’ve been running a node for a while now and have set up Zabbix agent on QNAP to monitor NAS itself, but I would like to go one step further and poll storj API for additional data like “Online %”

If I understand correctly the API can be accessed via 127.0.0.1:14002, right?

The curl command output on the NAS is as follows:

curl -s -v 127.0.0.1:14002/api/dashboard

  • Trying 127.0.0.1…
  • connect to 127.0.0.1 port 14002 failed: Connection refused
  • Failed to connect to 127.0.0.1 port 14002: Connection refused

The Dashboard itself is running on port 14002 and I can access it via browser http://nas_IP:14002

As far as I understand I have to enable the parameter console.address and set it as 127.0.0.1:14002, right?

QNAP STORJ app which automatically runs the docker instance passes following parameter: “–console.address=:14002”

Editing config.yaml file on the NAS and restarting the app does not do anything, because it is overridden by the console.address parameter set by QNAP STORJ app startup script.

I guess I could tinker around with the QNAP STORJ app config.php file or the “storagenodestart.sh” bash script and change the :14002 to 127.0.0.1:14002, but that might not survive a future update so I would rather not do it if possible.

I couldn’t find any config file where I could set the console.address as a parameter that is passed on to the docker run command. But there should be one, I would guess, one where my public DNS name is stored, storage dir and other parameters.

Could you please point me in a direction how can I enable API access for the storj? Thanks.

Hello @kasparsk ,
Welcome to the forum!

How to find: Search results for '#storagenode-api Faq' - Storj Community Forum (official)

Thank you, Alexey! The Connection refused threw me off and I concluded that something additional has to be enabled in order for the API requests to work, but as it turns out, I was just requesting invalid URL.

You need to change the binding for the dashboard port, if you run commands not from QNAP.
By default the dashboard port is binding to 127.0.0.1 (localhost), thus you can access the dashboard and API only from the same host, i.e. QNAP.
For the LAN access you need to bind it either to the LAN interface or to any interface.
To bind to any interface you can remove the 127.0.0.1: from the port mapping for dashboard port, and it would look like -p 14002:14002.
If you want to limit access only to LAN, and IP of your QNAP is 192.168.1.33 (for example), then it would be -p 192.168.1.33:14002:14002.
I think you should get an idea

Thanks! I managed to access the API via Zabbix HTTP agent and then with Preprocessing parsing out the items I’m interested in from the JSON.

1 Like