Configuration

Environment Variables

During installation, Alignak-app creates some folders that contains all the files application need to run. Then she will keep them in environment variables.

The application will normally automatically detect the folders used by the application and use environment variables for this purpose.

  • ALIGNAKAPP_USR_DIR: this folder is used by application for read the settings.cfg file . By default, Alignak-app will log also in this directory.
  • ALIGNAKAPP_APP_DIR: this folder is used by application for read images.ini file, style.css and get images. This variable is normally equal to the ROOT folder described above. Be careful if you define this variable yourself!
  • ALIGNAKAPP_LOG_DIR: this folder is used to create the log file of Alignak-app.

During Windows installation, if you used Installer, these variables are automatically filled.

On Linux

Alignak-app will try to create ALIGNAKAPP_USR_DIR for later configurations. By default this folder should be:

/$HOME/.local/alignak_app/

The ALIGNAKAPP_APP_DIR should be under one of the following folders and is create by pip during installation:

/$HOME/.local/alignak_app/
/usr/local/alignak_app/

On Windows

On Windows, use Installer is recommended (see Alignak-app Installers) to respect Windows conventions. ALIGNAKAPP_USR_DIR and ALIGNAKAPP_APP_DIR variables are by default set to:

C:\Program Files\Alignak-app\

If you install by pip under Windows, you may need to define these variables yourself ! And ALIGNAKAPP_USR_DIR and ALIGNAKAPP_APP_DIR variables should be by default set to:

C:\Users\user\AppData\Roaming\Python\alignak_app\

Settings File

Before running application, you must configure it.

You will find a settings.cfg file located in the ALIGNAKAPP_USR_DIR folder cited above.

This file contains Sections who are introduced by a [section_name] header. Then, it contains name = value entries. All parameters are also explained in file. For the boolean parameters, you can use the following values: on/off, true/false or 1/0.

The most significant Section is [Alignak]. You’ll need set your backend url and ports. Otherwise, Alignak-app proposes to define your server Alignak and its port via the window login.

To Know: Without connection on Backend of Alignak, App won’t start !

Proxy Settings

If you have a proxy on your network, you can set it in settings.cfg file, as well as the name and password of the proxy.

In case you use the login window, you will have a button dedicated to the proxy settings.

You can also set proxy in environment variables. Alignak backend client will manage these variables alone when connecting to the backend.

  • For HTTP proxies, set HTTP_PROXY variable.
  • For HTTPS proxies, set HTTPS_PROXY variable.

For more informations, please read Requests documentation.

Connection to Backend

Alignak-app have a login form by default, who let you to connect with the username and password define in backend.

You can also set connection information in the settings.cfg file:

  • Recommended: leave empty “username” and “password”. Alignak-app will display a login Window.
  • Recommended: set your token in “username” field and leave “password” empty (See below).
  • Not recommended: set your “username” and your “password”. This method is less secure.

To obtain a token, open a python terminal and type the following commands:

import requests
backend_url = 'http://alignak.com:5000'
r = requests.post(
    backend_url + '/login',
     data={
        'username': 'admin',
        'password': 'admin'
     }
)
print(r.text)

You can also visit: Alignak-backend : Get Token

File Example

Here is the full settings.cfg file. This file contains comments for each setting.

[Alignak]
; Backend authentication
; ------------------------------------------------------------------------------------------
; Credentials for your backend.
; 1/ Recommended: leave "username" and "password" empty. App will display a login Window.
; 2/ Recommended: set your token in "username" option and leave "password" empty.
; 3/ Not recommended: set your "username" and your "password".
; Read the alignak-app docs for more details on token and authentication,
; Or visit http://docs.alignak.net/projects/alignak-backend/en/latest/api.html#get-the-authentication-token
; The default values are empty.
username =
password =

; Alignak Url
; ------------------------------------------------------------------------------------------
; Url of alignak server.
; Default is http://127.0.0.1
url = http://127.0.0.1

; Backend url
; ------------------------------------------------------------------------------------------
; The url of alignak Backend.
; Default is %(url)s:5000
backend = %(url)s:5000

; Webui url
; ------------------------------------------------------------------------------------------
; The url of alignak WebUI
; Default is %(url)s:80
webui = %(url)s:80

; Web service url
; ------------------------------------------------------------------------------------------
; The url of web service, usually set to port 8888
; Default is empty
webservice =

; Backend processes
; ------------------------------------------------------------------------------------------
; The number of processes for connection to backend
; -!- Windows users must leave this parameter at 1 -!-
; Default is 1
processes = 1

; Proxy address
; ------------------------------------------------------------------------------------------
; Define proxy address for requests
; Format is: http(s)://proxy_address:port
; Default is empty
proxy =

; Proxy user
; ------------------------------------------------------------------------------------------
; Define corresponding proxy user. Only needed if you have a proxy.
; Default is empty
proxy_user =

; Proxy password
; ------------------------------------------------------------------------------------------
; Define corresponding proxy password. Only needed if you have a proxy.
; If "proxy_user" is set, a proxy login window will be automatically displayed.
; ! Setting password is less secure !
; Default is empty
proxy_password =

[Alignak-app]
; Locale
; ------------------------------------------------------------------------------------------
; Define language of App. Currently only "fr_FR", "en_US" are available.
; If empty, "en_US" will be used as default.
; Default is "en_US"
locale = en_US

; Display at start
; ------------------------------------------------------------------------------------------
; Defines whether the application is displayed or not, in full screen or minimized
; Default is "min". Available options are "no", "max", "min".
display = min

; Problems at start
; ------------------------------------------------------------------------------------------
; Defines if "Problems" tab is displayed by default at start
; Default is no. Set to "yes" to display "Problems" tab by default.
problems = no

; Tab order
; ------------------------------------------------------------------------------------------
; Defines order of App tabs: problems, host synthesis and spy.
; p = problems, h = host synthesis, s = spy,
; Default is p,h,s
tab_order = p,h,s

; Requests interval
; ------------------------------------------------------------------------------------------
; Define interval of App requests. App make regular requests
; Default is 20. Increase this settings can improve speed of App
; -!- Set this settings less than 5 is not recommended -!-
requests_interval = 20

; Notifications elapsed
; ------------------------------------------------------------------------------------------
; Sets in minutes the time elapsed since notifications were triggered.
; Default is 20
notification_elapsed = 20

; Notifications duration
; ------------------------------------------------------------------------------------------
; Define duration of temporary notifications
; Default is 20
notification_duration = 30

; Daemon freshness
; ------------------------------------------------------------------------------------------
; Defines the refresh time (in minutes) that the alignak daemons should not exceed
; Default is 10
daemons_freshness = 10

; Spy checks interval
; ------------------------------------------------------------------------------------------
; Define checks interval in seconds for spied hosts to update spied events
; Default is 20
spy_interval = 20

; Update Status widget (Dock)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh of alignak daemon's status widget
; Default is 20
update_status = 20

; Update Livestate widget (Dock)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh of livestate widget
; Default is 20
update_livestate = 20

; Update Dashboard widget (Top Panel)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of dashboard widget
; Default is 20
update_dashboard = 20

; Update Host widget (Host Synthesis tab)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of host widget
; Default is 20
update_host = 20

; Update Service widget (Host Synthesis tab)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of service widget
; Default is 20
update_service = 20

; Update Problems widget (Problems tab)
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of problems widget
; Default is 20
update_problems = 30

[Log]
; Log filename
; ------------------------------------------------------------------------------------------
; Define name of file where logs of App will be stored.
filename = alignakapp

; Log location
; ------------------------------------------------------------------------------------------
; Set this value to define another directory. Path must be absolute !
; Default is empty and apply following default values:
; Linux  : $HOME/.local/alignak_app
; Windows: C:\ProgramData\Alignak-app
location =

; Application Debug Mode
; ------------------------------------------------------------------------------------------
; Activate Debug mode for Alignak-App to get more logs, when app unexpected stop
; Set to 'yes' or 'true' to activate "debug" mode
; Set to 'no' or 'false' to deactivate "debug" mode
; Default is 'no'
debug = no