Projects
Kolab:3.4
bonnie
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 28
View file
bonnie-0.1.1.tar.gz/bonnie/broker/brokers/zmq_broker/__init__.py -> bonnie-0.1.2.tar.gz/bonnie/broker/brokers/zmq_broker/__init__.py
Changed
@@ -25,6 +25,7 @@ import copy import random +import re import sys import time import zmq @@ -287,6 +288,7 @@ _client_id = _message[0] _notification = _message[1] _collector_id = _client_id.replace('Dealer', 'Collector') + _collector_id = re.sub(r'-[0-9]+$', '', _collector_id) self.worker_job_add(_notification, client_id=_client_id, collector_id=_collector_id) dealer_router.send_multipart([_message[0], b"ACK"])
View file
bonnie-0.1.1.tar.gz/bonnie/dealer/__init__.py -> bonnie-0.1.2.tar.gz/bonnie/dealer/__init__.py
Changed
@@ -44,12 +44,26 @@ user = parsed['user'] if parsed.has_key('user') else None # ignore globally excluded events - exclude_events = conf.get('dealer', 'input_exclude_events', '').split(',') + exclude_events = conf.get('dealer', 'input_exclude_events', None) + if not exclude_events == None: + exclude_events = exclude_events.split(',') + else: + exclude_events = [] + if event in exclude_events: return False - blacklist_events = conf.get('dealer', 'blacklist_events', '').split(',') - blacklist_users = conf.get('dealer', 'blacklist_users', '').split(',') + blacklist_events = conf.get('dealer', 'blacklist_events', None) + if not blacklist_events == None: + blacklist_events = blacklist_events.split(',') + else: + blacklist_events = [] + + blacklist_users = conf.get('dealer', 'blacklist_users', None) + if not blacklist_users == None: + blacklist_users = blacklist_users.split(',') + else: + blacklist_users = [] # ignore blacklisted events for blacklisted users if event in blacklist_events and user is not None and user in blacklist_users:
View file
bonnie-0.1.1.tar.gz/bonnie/dealer/outputs/__init__.py -> bonnie-0.1.2.tar.gz/bonnie/dealer/outputs/__init__.py
Changed
@@ -1,10 +1,13 @@ +from file_output import FileOutput from zmq_output import ZMQOutput __all__ = [ + 'FileOutput', 'ZMQOutput' ] def list_classes(): return [ + FileOutput, ZMQOutput ]
View file
bonnie-0.1.2.tar.gz/bonnie/dealer/outputs/file_output.py
Added
@@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2010-2014 Kolab Systems AG (http://www.kolabsys.com) +# +# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 or, at your option, any later +# version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# + +import os +import socket + +import bonnie +conf = bonnie.getConf() +log = bonnie.getLogger('bonnie.dealer.FileOutput') + +class FileOutput(object): + def __init__(self, *args, **kw): + self.file_output = conf.get("dealer", "file_path") + + def name(self): + return 'file_output' + + def register(self, *args, **kw): + return self.run + + def run(self, notification): + log.debug("Notification received: %r" % (notification), level=9) + if self.file_output == None: + return notification + + fp = open(self.file_output, 'a') + fp.write("%r\n" % (notification)) + fp.close()
View file
bonnie-0.1.1.tar.gz/bonnie/dealer/outputs/zmq_output.py -> bonnie-0.1.2.tar.gz/bonnie/dealer/outputs/zmq_output.py
Changed
@@ -38,7 +38,7 @@ zmq_broker_address = "tcp://localhost:5570" self.dealer = self.context.socket(zmq.DEALER) - self.dealer.identity = (u"Dealer-%s" % (socket.getfqdn())).encode('ascii') + self.dealer.identity = (u"Dealer-%s-%s" % (socket.getfqdn(), os.getpid())).encode('ascii') self.dealer.connect(zmq_broker_address) self.poller = zmq.Poller()
View file
bonnie-0.1.1.tar.gz/bonnie/worker/__init__.py -> bonnie-0.1.2.tar.gz/bonnie/worker/__init__.py
Changed
@@ -118,6 +118,7 @@ storage_modules = {} output_modules = {} + output_exclude_events = [] def __init__(self, as_child=False, *args, **kw): if as_child: signal.signal(signal.SIGTERM, self.terminate) @@ -147,7 +148,9 @@ self.storage_modules[_class] = _storage self.storage = _storage - self.output_exclude_events = conf.get('worker', 'output_exclude_events', '').split(',') + output_exclude_events = conf.get('worker', 'output_exclude_events', None) + if not output_exclude_events == None: + self.output_exclude_events = output_exclude_events.split(',') def event_notification(self, notification): """ @@ -273,4 +276,4 @@ if hasattr(_input, 'terminate'): _input.terminate() else: - _input.running = False \ No newline at end of file + _input.running = False
View file
bonnie-0.1.1.tar.gz/bonnie/worker/outputs/elasticsearch_output.py -> bonnie-0.1.2.tar.gz/bonnie/worker/outputs/elasticsearch_output.py
Changed
@@ -77,7 +77,7 @@ timestamp = datetime.datetime.now(tzutc()) notification['@timestamp'] = datetime.datetime.strftime(timestamp, "%Y-%m-%dT%H:%M:%S.%fZ") - index = 'logstash-%s' % (datetime.datetime.strftime(timestamp, "%Y-%m-%d")) + index = 'logstash-%s' % (datetime.datetime.strftime(timestamp, "%Y.%m.%d")) # for notifications concerning multiple messages, create entries for each message if notification.has_key('messageHeaders') and isinstance(notification['messageHeaders'], dict) and len(notification['messageHeaders']) > 0:
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-collector.sysvinit -> bonnie-0.1.2.tar.gz/contrib/bonnie-collector.sysvinit
Changed
@@ -1,19 +1,19 @@ #! /bin/bash # -# bonnie-broker Start/Stop the Bonnie Broker daemon +# bonnie-collector Start/Stop the Bonnie Broker daemon # # chkconfig: - 65 10 -# description: The Bonnie Broker daemon is a message broker. -# processname: bonnie-broker +# description: The Bonnie Broker daemon is a message collector. +# processname: bonnie-collector ### BEGIN INIT INFO -# Provides: bonnie-brokerd +# Provides: bonnie-collectord # Default-Start: - # Default-Stop: 0 1 2 6 # Required-Start: $remote_fs $local_fs $network # Required-Stop: $remote_fs $local_fs $network # Short-Description: Start/Stop the Bonnie Broker daemon -# Description: The Bonnie Broker daemon is a message broker. +# Description: The Bonnie Broker daemon is a message collector. ### END INIT INFO # Source function library. @@ -26,22 +26,22 @@ USER="bonnie" GROUP="bonnie" -if [ -f /etc/sysconfig/bonnie-broker ] ; then - . /etc/sysconfig/bonnie-broker +if [ -f /etc/sysconfig/bonnie-collector ] ; then + . /etc/sysconfig/bonnie-collector fi -if [ -f /etc/default/bonnie-broker ]; then - . /etc/default/bonnie-broker +if [ -f /etc/default/bonnie-collector ]; then + . /etc/default/bonnie-collector fi RETVAL=0 # Set up some common variables before we launch into what might be # considered boilerplate by now. -prog=bonnie-broker -path=/usr/sbin/bonnie-broker +prog=bonnie-collector +path=/usr/sbin/bonnie-collector lockfile=/var/lock/subsys/$prog -pidfile=/var/run/bonnie/bonnie-broker.pid +pidfile=/var/run/bonnie/bonnie-collector.pid [ ! -d "$(dirname ${pidfile})" ] && mkdir -p $(dirname ${pidfile}) chown ${USER}:${GROUP} $(dirname ${pidfile})
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.