Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / config / app_cfg.py @ e6029893

History | View | Annotate | Download (3.36 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
base_config = VigiloAppConfig('vigiboard')
26
base_config.renderers = []
27

    
28
base_config.package = vigiboard
29

    
30
#Set the default renderer
31
base_config.default_renderer = 'genshi'
32
base_config.renderers.append('genshi')
33

    
34
#Configure the base SQLALchemy Setup
35
base_config.use_sqlalchemy = True
36
base_config.model = models
37

    
38
# Configure the authentication backend
39
base_config.auth_backend = 'sqlalchemy'
40

    
41
# what is the class you want to use to search for users in the database
42
base_config.sa_auth.user_class = models.User
43
# what is the class you want to use to search for groups in the database
44
base_config.sa_auth.group_class = models.UserGroup
45
# what is the class you want to use to search for permissions in the database
46
base_config.sa_auth.permission_class = models.Permission
47
# The name "groups" is already used for groups of hosts.
48
# We use "usergroups" when referering to users to avoid confusion.
49
base_config.sa_auth.translations.groups = 'usergroups'
50

    
51
# override this if you would like to provide a different who plugin for
52
# managing login and logout of your application
53
base_config.sa_auth.form_plugin = None
54

    
55
# You may optionally define a page where you want users to be redirected to
56
# on login:
57
base_config.sa_auth.post_login_url = '/post_login'
58

    
59
# You may optionally define a page where you want users to be redirected to
60
# on logout:
61
base_config.sa_auth.post_logout_url = '/post_logout'
62

    
63

    
64
##################################
65
# Settings specific to Vigiboard #
66
##################################
67

    
68
# Vigiboard version
69
base_config['vigilo_version'] = u'2.0-pre0.1'
70

    
71
# Configuration des liens
72
# Les elements suivants peuvent etre utilises dans la chaine de formatage :
73
# - idcorrevent : identifiant de l'aggregat (alerte correlee)
74
# - host : le nom de l'hote concerne par l'alerte
75
# - service : le nom du service concerne par l'alerte
76
# - message : le message transmis par Nagios dans l'alerte
77
base_config['vigiboard_links.eventdetails'] = {
78
    'nagios': ['Nagios host details', 'http://example1.com/%(idcorrevent)d'],
79
    'metrology': ['Metrology details', 'http://example2.com/%(idcorrevent)d'],
80
    'security': ['Security details', 'http://example3.com/%(idcorrevent)d'],
81
    'servicetype': ['Service Type', 'http://example4.com/%(idcorrevent)d'],
82
    'documentation': ['Documentation', 'http://doc.example.com/?q=%(message)s'],
83
}
84

    
85
# URL des tickets, possibilités:
86
# - %(idaggregate)s
87
# - %(host)s
88
# - %(service)s
89
# - %(tt)s
90
base_config['vigiboard_links.tt'] = 'http://example4.com/%(idcorrevent)d/%(tt)s'
91

    
92
# Plugins to use
93
base_config['vigiboard_plugins'] = [
94
    ['shn', 'PluginSHN'],
95
]
96

    
97
base_config['vigiboard_refresh_times'] = (
98
    (0, l_('Never')),
99
    (30, l_('30 seconds')),
100
    (60, l_('1 minute')),
101
    (300, l_('5 minutes')),
102
    (600, l_('10 minutes')),
103
)
104