~shinken-dev/shinken/trunk

« back to all changes in this revision

Viewing changes to modules/logstore_null/module.py

  • Committer: naparuba
  • Date: 2013-07-17 15:03:35 UTC
  • Revision ID: git-v1:8bffb4fe67305a0be4ce50d1feab2416f950f95d
Enh: remove the Logstore modules from the core repo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
# -*- coding: utf-8 -*-
4
 
 
5
 
# Copyright (C) 2009-2012:
6
 
#    Gabes Jean, naparuba@gmail.com
7
 
#    Gerhard Lausser, Gerhard.Lausser@consol.de
8
 
#    Gregory Starck, g.starck@gmail.com
9
 
#    Hartmut Goebel, h.goebel@goebel-consult.de
10
 
#
11
 
# This file is part of Shinken.
12
 
#
13
 
# Shinken is free software: you can redistribute it and/or modify
14
 
# it under the terms of the GNU Affero General Public License as published by
15
 
# the Free Software Foundation, either version 3 of the License, or
16
 
# (at your option) any later version.
17
 
#
18
 
# Shinken is distributed in the hope that it will be useful,
19
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 
# GNU Affero General Public License for more details.
22
 
#
23
 
# You should have received a copy of the GNU Affero General Public License
24
 
# along with Shinken.  If not, see <http://www.gnu.org/licenses/>.
25
 
 
26
 
"""
27
 
This class store log broks in a black hole
28
 
It is one possibility (!) for an exchangeable storage for log broks
29
 
"""
30
 
 
31
 
from shinken.log import logger
32
 
from shinken.basemodule import BaseModule
33
 
 
34
 
properties = {
35
 
    'daemons': ['livestatus'],
36
 
    'type': 'logstore_null',
37
 
    'external': False,
38
 
    'phases': ['running'],
39
 
    }
40
 
 
41
 
 
42
 
# called by the plugin manager
43
 
def get_instance(plugin):
44
 
    logger.info("[Logstore Null] Get an LogStore Null module for plugin %s" % plugin.get_name())
45
 
    instance = LiveStatusLogStoreNull(plugin)
46
 
    return instance
47
 
 
48
 
 
49
 
class LiveStatusLogStoreNull(BaseModule):
50
 
 
51
 
    def __init__(self, modconf):
52
 
        BaseModule.__init__(self, modconf)
53
 
        self.plugins = []
54
 
 
55
 
    def load(self, app):
56
 
        self.app = app
57
 
 
58
 
    def init(self):
59
 
        pass
60
 
 
61
 
    def open(self):
62
 
        logger.info("[Logstore Null] Open LiveStatusLogStoreNull ok")
63
 
 
64
 
    def close(self):
65
 
        pass
66
 
 
67
 
    def commit(self):
68
 
        pass
69
 
 
70
 
    def commit_and_rotate_log_db(self):
71
 
        pass
72
 
 
73
 
    def manage_log_brok(self, b):
74
 
        # log brok successfully stored in the black hole
75
 
        pass
76
 
 
77
 
    def add_filter(self, operator, attribute, reference):
78
 
        pass
79
 
 
80
 
    def add_filter_and(self, andnum):
81
 
        pass
82
 
 
83
 
    def add_filter_or(self, ornum):
84
 
        pass
85
 
 
86
 
    def add_filter_not(self):
87
 
        pass
88
 
 
89
 
    def get_live_data_log(self):
90
 
        """Like get_live_data, but for log objects"""
91
 
        result = []
92
 
        return result