February 19Feb 19 is there a simple SSH command for start, stop or viewing unraid's array status from SSH.example unraid status for get the status of unraid's array, that is stoped, stopping, started, or startingexample unraid start for starting arrayexample unraid stop for stopping arrayand maybe the current log it's selfexample unraid log and the terminal will show the current log of the unraid's log.thankyou, br Yongki Edited February 19Feb 19 by yongki
February 19Feb 19 Solution There is no standard command that I know of that gives that information about the array in an easily understood format.However if you install the parity check tuning plugin even if you do not use any of its features it does add the 'parity.check' CLI command that allows you to query the array operation status and start/stop the operation or the whole array amongst other things. I could easily enhance the information provided on status to give everything you mention although the critical stuff is already there.The current log is always at /var/log/syslog so you can query it using standard linux CLI commands. You can also view it easily via the GUI.
November 11Nov 11 Since 7.2 you can do this without a plugin through the built-in Unraid API (GraphQL at http://localhost/graphql). Tested on 7.4.0.Create a key that can only read and start/stop the array, saved straight to the flash (root-only):unraid-api apikey --create --name "shell cli" --roles "" -p "ARRAY:READ_ANY,ARRAY:UPDATE_ANY" --json | jq -r .key > /boot/config/unraid-api.keyA small helper. It hands the key to curl on stdin, because -H "x-api-key: $KEY" would show the key to every user in ps:gql() { printf 'header = "x-api-key: %s"\n' "$(cat /boot/config/unraid-api.key)" | curl -s --config - -H 'Content-Type: application/json' -d "$1" http://localhost/graphql; } Then:gql '{"query":"{ array { state } }"}' gql '{"query":"mutation { array { setState(input: {desiredState: STOP}) { state } } }"}' gql '{"query":"mutation { array { setState(input: {desiredState: START}) { state } } }"}'Quick and dirty, one line, if you don't mind the key being visible in ps (local security risk) while it runs:curl -s -H "x-api-key: $(cat /boot/config/unraid-api.key)" -H 'Content-Type: application/json' -d '{"query":"mutation { array { setState(input: {desiredState: STOP}) { state } } }"}' http://localhost/graphqlStart returns right away and the array comes up in the background, so check with the first command after a few seconds. The rest of the schema (disks, parity, Docker, notifications) is in the [API docs](https://docs.unraid.net/API/how-to-use-the-api/). Edited November 11Nov 11 by Samsonight
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.