1
2
3
4
5
6
7
8
9 """
10 Singleton contenant les données globales de configuration.
11
12 Usage :
13 from zephir.monitor.agentmanager import config as cfg
14 cfg.whatever_you_need
15 """
16
17 try: _
18 except NameError: _ = str
19
20 import os
21 from datetime import datetime
22 try:
23 from zephir.zephir_conf.zephir_conf import id_serveur
24 except:
25 id_serveur=0
26
27
28
29 distrib_version = 4
30
31 DEFAULT_CONFIG = {
32 'host_ref': str(id_serveur),
33
34 'webserver_port': 8090,
35 'static_web_dir': os.path.join(os.path.curdir, 'static'),
36 'static_base_url': '/static',
37
38 'tmp_data_dir': os.path.join(os.path.curdir, 'data'),
39 'config_dir': os.path.join(os.path.curdir, 'configs'),
40 'state_dir': os.path.join(os.path.curdir, 'stats'),
41 'uucp_dir': os.path.join(os.path.curdir, 'uucp'),
42 'action_dir': os.path.join(os.path.curdir, 'actions'),
43
44 'upload_period': 600,
45 }
46
47
48
49 if os.path.isfile('/etc/init.d/zephir'):
50 DEFAULT_CONFIG['host_ref'] = "0"
51
52
54 return os.path.join(config['state_dir'],
55 client_name)
56
57
61
62
66
67
68
69 RRD_TIME_ORIGIN = datetime(1970,1,1)
70