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 thesettings.cfg
file . By default, Alignak-app will log also in this directory.ALIGNAKAPP_APP_DIR
: this folder is used by application for readimages.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 this 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 your Backend. ; Default is %(url)s:5000 backend = %(url)s:5000 ; Webui url ; ------------------------------------------------------------------------------------------ ; The url of your Webui ; Default is %(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 ; 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 by default. problems = no ; Requests interval ; ------------------------------------------------------------------------------------------ ; Define interval of App requests. App make regular requests ; Default is 30. Increase this settings can improve speed of App ; -!- Set this settings less than 5 is not recommended -!- requests_interval = 30 ; 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 30 spy_interval = 30 ; Update dock "Status" ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh of dock alignak status ; Default is 30 update_status = 30 ; Update dock "Buttons" ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh time of dock buttons ; Default is 20 update_buttons = 20 ; Update dock "Livestate" ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh time of Dock livestate ; Default is 30 update_livestate = 30 ; Update panel Dashboard ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh time of panel Dashboard ; Default is 30 update_dashboard = 30 ; Update panel Host ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh time of panel Host view ; Default is 20 update_host = 20 ; Update panel Service ; ------------------------------------------------------------------------------------------ ; Define in seconds the refresh time of panel Service view ; Default is 20 update_service = 20 [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