vigiboard / vigiboard / config / app_cfg.py @ 5dbfa80d
History | View | Annotate | Download (3.5 KB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
# vim: set fileencoding=utf-8 sw=4 ts=4 et :
|
3 |
"""
|
4 |
Global configuration file for TG2-specific settings in vigiboard.
|
5 |
|
6 |
This file complements development/deployment.ini.
|
7 |
|
8 |
Please note that **all the argument values are strings**. If you want to
|
9 |
convert them into boolean, for example, you should use the
|
10 |
:func:`paste.deploy.converters.asbool` function, as in::
|
11 |
|
12 |
from paste.deploy.converters import asbool
|
13 |
setting = asbool(global_conf.get('the_setting'))
|
14 |
|
15 |
"""
|
16 |
|
17 |
from vigilo import models |
18 |
|
19 |
from vigilo.turbogears import VigiloAppConfig |
20 |
from pylons.i18n import lazy_ugettext as l_ |
21 |
|
22 |
import vigiboard |
23 |
from vigiboard.lib import app_globals, helpers |
24 |
|
25 |
|
26 |
base_config = VigiloAppConfig('vigiboard')
|
27 |
|
28 |
base_config.renderers = [] |
29 |
|
30 |
base_config.package = vigiboard |
31 |
|
32 |
#Set the default renderer
|
33 |
base_config.default_renderer = 'genshi'
|
34 |
base_config.renderers.append('genshi')
|
35 |
|
36 |
#Configure the base SQLALchemy Setup
|
37 |
base_config.use_sqlalchemy = True
|
38 |
base_config.model = models |
39 |
|
40 |
#from vigilo.models import configure
|
41 |
|
42 |
#base_config.DBSession = configure.DBSession
|
43 |
|
44 |
# Configure the authentication backend
|
45 |
base_config.auth_backend = 'sqlalchemy'
|
46 |
#base_config.sa_auth.dbsession = configure.DBSession
|
47 |
# what is the class you want to use to search for users in the database
|
48 |
base_config.sa_auth.user_class = models.User |
49 |
# what is the class you want to use to search for groups in the database
|
50 |
base_config.sa_auth.group_class = models.UserGroup |
51 |
# what is the class you want to use to search for permissions in the database
|
52 |
base_config.sa_auth.permission_class = models.Permission |
53 |
# The name "groups" is already used for groups of hosts.
|
54 |
# We use "usergroups" when referering to users to avoid confusion.
|
55 |
base_config.sa_auth.translations.groups = 'usergroups'
|
56 |
|
57 |
# override this if you would like to provide a different who plugin for
|
58 |
# managing login and logout of your application
|
59 |
base_config.sa_auth.form_plugin = None
|
60 |
|
61 |
# You may optionally define a page where you want users to be redirected to
|
62 |
# on login:
|
63 |
base_config.sa_auth.post_login_url = '/post_login'
|
64 |
|
65 |
# You may optionally define a page where you want users to be redirected to
|
66 |
# on logout:
|
67 |
base_config.sa_auth.post_logout_url = '/post_logout'
|
68 |
|
69 |
|
70 |
##################################
|
71 |
# Settings specific to Vigiboard #
|
72 |
##################################
|
73 |
|
74 |
# Vigiboard version
|
75 |
base_config['vigilo_version'] = u'2.0-pre0.1' |
76 |
|
77 |
# Configuration des liens
|
78 |
# Les elements suivants peuvent etre utilises dans la chaine de formatage :
|
79 |
# - idcorrevent : identifiant de l'aggregat (alerte correlee)
|
80 |
# - host : le nom de l'hote concerne par l'alerte
|
81 |
# - service : le nom du service concerne par l'alerte
|
82 |
# - message : le message transmis par Nagios dans l'alerte
|
83 |
base_config['vigiboard_links.eventdetails'] = {
|
84 |
'nagios': ['Nagios host details', 'http://example1.com/%(idcorrevent)d'], |
85 |
'metrology': ['Metrology details', 'http://example2.com/%(idcorrevent)d'], |
86 |
'security': ['Security details', 'http://example3.com/%(idcorrevent)d'], |
87 |
'servicetype': ['Service Type', 'http://example4.com/%(idcorrevent)d'], |
88 |
'documentation': ['Documentation', 'http://doc.example.com/?q=%(message)s'], |
89 |
} |
90 |
|
91 |
# URL des tickets, possibilités:
|
92 |
# - %(idaggregate)s
|
93 |
# - %(host)s
|
94 |
# - %(service)s
|
95 |
# - %(tt)s
|
96 |
base_config['vigiboard_links.tt'] = 'http://example4.com/%(idcorrevent)d/%(tt)s' |
97 |
|
98 |
# Plugins to use
|
99 |
base_config['vigiboard_plugins'] = [
|
100 |
['shn', 'PluginSHN'], |
101 |
] |
102 |
|
103 |
base_config['vigiboard_refresh_times'] = (
|
104 |
(0, l_('Never')), |
105 |
(30, l_('30 seconds')), |
106 |
(60, l_('1 minute')), |
107 |
(300, l_('5 minutes')), |
108 |
(600, l_('10 minutes')), |
109 |
) |
110 |
|