Alignak-app Main Folder

During installation, Alignak-app creates a root folder that contains all the files application need to run.

On Linux

The ROOT folder of the application should be under:

/home/$USER/.local/alignak_app/

On Windows

  1. If you install from Pip or with Sources:

The ROOT folder of the application should be under:

C:\Users\user\AppData\Roaming\Python\alignak_app\
  1. If you use Installer (see Install Alignak-app):

The ROOT folder will be located under:

C:\Program Files\Alignak-app\

This is to facilitate access to the configuration and respect Windows conventions.

Alignak-app Workdir

This folder is defined by the app_workdir.ini file located in the main application folder cited above.

The goal of this file is to define a directory where Alignak-app can write/read without problems to get settings and create log files. So make sure that you have the right to write and read.

You must set an absolute path for this settings.

Then only put/copy the settings.cfg in the folder you have defined.

Note: If you have not set this option, application use the same directory than cited above. If you have no rights, application will crash.

Configuration Parameters

Before running application, you must configure it.

You will find a file named settings.cfg located in the “ROOT” folder cited above. Otherwise, Alignak-app proposes to define your server Alignak and its port via the window login.

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 [Backend]. You need set your backend url, ports and credentials.

[ToKnow]” Without connection on Backend of Alignak, App won’t start ! “

Settings file

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://alignak-backend.readthedocs.io/en/latest/api.html#get-the-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 your Backend.
; Default is %(alignak_url)s:5000
backend = %(url)s:5000

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

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

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

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

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

; Spy checks interval
; ------------------------------------------------------------------------------------------
; Define checks interval in seconds for spied hosts. One host check by interval.
; Default is 60
spy_interval = 60

; Locales
; ------------------------------------------------------------------------------------------
; 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

; Update dock "Status"
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh of dock alignak status
; Default is 15
update_status = 15

; Update dock "Buttons"
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of dock buttons
; Default is 15
update_buttons = 15

; Update dock "Livestate"
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of Dock livestate
; Default is 15
update_livestate = 15

; Update panel Dashboard
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of panel Dashboard
; Default is 15
update_dashboard = 15

; Update panel Host
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of panel Host view
; Default is 15
update_host = 15

; Update panel Service
; ------------------------------------------------------------------------------------------
; Define in seconds the refresh time of panel Service view
; Default is 15
update_service = 15

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

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

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

[Folders]
; Root Application Path
; ------------------------------------------------------------------------------------------
; This is the config path of the application. Change this setting is not recommended !
path = /alignak_app

; Images Path
; ------------------------------------------------------------------------------------------
; Path of images. Must have a 'slash' before. This path is relative of the [path] value.
img = /images

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 settings 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)