Skip to content

Watcher Database Management Tool

This section describes the tool for performing certain actions on the Watcher database and shows usage examples.

Use --help to get the list of commands:

export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher --help

Use the command name and --help to get help on the usage of this command:

export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher db --help

DB environment variable

Before you use the Watcher database management tool you need to set the DB environment variable. The way to set the DB variable with the default database path is shown in all above and below examples of using the tool:

export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'

You need to run this command just once in a session but it will do no harm if you call it every time you use the Watcher database management tool.

If you have set another database parameters at the installation, use it instead. You can check your database path on the IP cameras tab in the Flussonic's administrative web UI at http://FLUSSONIC-IP:80/admin or use the following command in the terminal:

grep postgres /etc/flussonic/flussonic.conf

Actions that you can perform

With the tool /opt/flussonic/contrib/watcher you can:

  • migrate the database
export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher db --help
  • restart Watcher
export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher restart --help
  • add and modify users
export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher adduser --help
  • change the password for a user
export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher reset_pass --help
  • get database revision
export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher check --help

See usage examples later on this page.

Adding a user

export DB='postgresql://vsaas:vsaas@localhost/vsaas_production'
/opt/flussonic/contrib/watcher adduser USER_NAME -a 1 -e 1 -p PASSWORD

Here:

  • USER_NAME — user login
  • -a — whether the user is administrator (1) or not (0)
  • -e — whether the user is enabled (1) or not (0)
  • -p — the user's password.