UNMS - CLI


Overview


In this article we introduce some basic console commands that can be useful for solving UNMS related issues.


Table of Contents


  1. Introduction
  2. Restart UNMS
  3. Stop UNMS
  4. Start UNMS
  5. Password recovery
  6. Refresh Let's Encrypt certificate
  7. Fix redis aof file
  8. Rewrite redis aof file
  9. Device update frequency
  10. Related Articles

Introduction


Back to Top

NOTE: This command will not remove your settings or data, but will log all users out of UNMS.

Below you will find some useful console commands for UNMS. If you need to reset the application or find out forgotten password you will find the right tool here.


Restart (0.10.0+)


Back to Top

Use the following command to rebuild all UNMS docker containers. Run as a user with sudo enabled.

sudo ~unms/app/unms-cli restart

Stop (0.10.0+)


Back to Top

This command stops UNMS containers. Run as a user with sudo enabled.

sudo ~unms/app/unms-cli stop

Start (0.10.0+)


Back to Top

This command start UNMS containers. Run as a user with sudo enabled.

sudo ~unms/app/unms-cli start

Password recovery (0.10.0+)


Back to Top

NOTE: Changing the password this way turns off two-factor authentication. You can turn it on again after logging in.

UNMS includes a script that can be used to change an existing user's password in case of password recovery be e-mail is unavailable. To see the list of existing users in UNMS, run the following command on the UNMS host machine:

sudo docker exec -ti unms ./setpwd.sh

To change a user's password, specify the username as a parameter and enter a new password when asked:

sudo docker exec -ti unms ./setpwd.sh <username>

Refresh Let's Encrypt certificate (0.12.0+)


Back to Top

This command refresh Let's Encrypt certificate. Run as a user with sudo enabled.

sudo ~unms/app/unms-cli refresh-certificate

Fix redis aof file (0.12.0+)


Back to Top

This command fixes corrupted redis aof file, which can be located here /home/unms/data/redis/appendonly.aof. Run as a user with sudo enabled.

sudo ~unms/app/unms-cli stop
sudo ~unms/app/unms-cli fix-redis-aof
sudo ~unms/app/unms-cli start

Rewrite redis aof file (0.12.0+)


Back to Top

This command forces redis aof file to recalculate. Useful when the file is too big, you can check the size of this file here /home/unms/data/redis/appendonly.aof. Run as a user with sudo enabled. UNMS has to be running in order for this command to work. Also, please note that you will need a lot of free space on your disc to complete this process. We recommend you to delete some older logs to create enough space. 

sudo ~unms/app/unms-cli rewrite-redis-aof

Reduce device update frequency (0.12.1-rc.2+)


Back to Top

This command reduce UNMS device update frequency. It's helpful when UNMS is overloaded and it's not possible login to UNMS UI.

sudo ~unms/app/unms-cli reduce-device-update-frequency

Related Articles


Back to Top

UNMS - How to restart UNMS