Skip to content

Commit

Permalink
Merge pull request #4564 from zenoss/bugfix/ZEN-35073.6x
Browse files Browse the repository at this point in the history
ZEN-35073 Make sure trap filters are working
  • Loading branch information
jpeacock-zenoss authored Sep 27, 2024
2 parents b921122 + 08a03e7 commit 89d7bee
Show file tree
Hide file tree
Showing 21 changed files with 725 additions and 486 deletions.
2 changes: 1 addition & 1 deletion Products/DataCollector/SnmpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from twisted.internet.error import TimeoutError
from pynetsnmp.twistedsnmp import snmpprotocol, Snmpv3Error

from Products.ZenCollector.interfaces import IEventService
from Products.ZenEvents import Event
from Products.ZenEvents.ZenEventClasses import Status_Snmp
from Products.ZenHub.interfaces import IEventService
from Products.ZenUtils.Driver import drive
from Products.ZenUtils.snmp import (
SnmpAgentDiscoverer,
Expand Down
2 changes: 1 addition & 1 deletion Products/DataCollector/SshClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

from Products.DataCollector import CollectorClient
from Products.DataCollector.Exceptions import LoginFailed
from Products.ZenCollector.interfaces import IEventService
from Products.ZenEvents import Event
from Products.ZenHub.interfaces import IEventService
from Products.ZenUtils.IpUtil import getHostByName
from Products.ZenUtils.Utils import getExitMessage

Expand Down
2 changes: 1 addition & 1 deletion Products/DataCollector/zenmodeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
)
from Products.ZenCollector.cyberark import get_cyberark
from Products.ZenCollector.daemon import parseWorkerOptions, addWorkerOptions
from Products.ZenCollector.interfaces import IEventService
from Products.ZenEvents.ZenEventClasses import Heartbeat, Error
from Products.ZenHub.interfaces import IEventService
from Products.ZenHub.PBDaemon import FakeRemote, PBDaemon, HubDown
from Products.ZenUtils.Driver import drive, driveLater
from Products.ZenUtils.Utils import unused, zenPath, wait
Expand Down
2 changes: 1 addition & 1 deletion Products/ZenCollector/cyberark.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from zope.component import queryUtility

from Products.ZenEvents import Event
from Products.ZenHub.interfaces import IEventService
from Products.ZenUtils.GlobalConfig import getGlobalConfiguration

from .interfaces import IEventService
from .ExpiringCache import ExpiringCache

_CFG_URL = "cyberark-url"
Expand Down
5 changes: 1 addition & 4 deletions Products/ZenCollector/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
IConfigurationDispatchingFilter,
IConfigurationListener,
IDataService,
IEventService,
IFrameworkFactory,
IStatisticsService,
ITaskSplitter,
Expand All @@ -56,7 +55,7 @@
from .utils.maintenance import MaintenanceCycle, ZenHubHeartbeatSender


@implementer(ICollector, IDataService, IEventService)
@implementer(ICollector, IDataService)
class CollectorDaemon(RRDDaemon):
"""The daemon class for the entire ZenCollector framework."""

Expand Down Expand Up @@ -110,7 +109,6 @@ def __init__(
# that collector implementors can easily retrieve a reference back here
# if needed
provideUtility(self, ICollector)
provideUtility(self, IEventService)
provideUtility(self, IDataService)

# Register the collector's own preferences object so it may be easily
Expand Down Expand Up @@ -394,7 +392,6 @@ def _startMaintenance(self):
self.options.monitor,
self.name,
self.options.heartbeatTimeout,
self._eventqueue,
)
else:
heartbeatSender = None
Expand Down
11 changes: 2 additions & 9 deletions Products/ZenCollector/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import zope.interface

# IEventService imported here for ZenPack compability
from Products.ZenHub.interfaces import IEventService # noqa: F401
from Products.ZenUtils.observable import IObservable


Expand Down Expand Up @@ -549,15 +551,6 @@ def writeRRD(
"""


class IEventService(zope.interface.Interface):
"""
A service that allows the sending of an event.
"""

def sendEvent(event, **kw):
pass


class IFrameworkFactory(zope.interface.Interface):
"""
An abstract factory object that allows the collector framework to be
Expand Down
6 changes: 3 additions & 3 deletions Products/ZenCollector/utils/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from zope.component import getUtility

from Products.ZenEvents.ZenEventClasses import Heartbeat
from Products.ZenHub.interfaces import IEventService
from Products.ZenMessaging.queuemessaging.interfaces import IQueuePublisher

log = logging.getLogger("zen.maintenance")
Expand Down Expand Up @@ -65,17 +66,16 @@ class ZenHubHeartbeatSender(object):
Default heartbeat sender for CollectorDaemon.
"""

def __init__(self, monitor, daemon, timeout, queue):
def __init__(self, monitor, daemon, timeout):
self.__event = {
"eventClass": Heartbeat,
"device": monitor,
"component": daemon,
"timeout": timeout
}
self.__queue = queue

def heartbeat(self):
self.__queue.addHeartbeatEvent(self.__event)
getUtility(IEventService).sendHeartbeat(self.__event)


class MaintenanceCycle(object):
Expand Down
3 changes: 2 additions & 1 deletion Products/ZenEvents/SyslogMsgFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

from zope.interface import implements

from Products.ZenCollector.interfaces import ICollector, IEventService
from Products.ZenCollector.interfaces import ICollector
from Products.ZenHub.interfaces import ICollectorEventTransformer, \
IEventService, \
TRANSFORM_CONTINUE, \
TRANSFORM_DROP
from Products.ZenUtils.Utils import unused, zenPath
Expand Down
Loading

0 comments on commit 89d7bee

Please sign in to comment.