Correlation Events

An Event contains minimal information about an individual SNMP trap: time, state, and any specific information necessary to construct a relevant alarm description.

Base Class

class dashboard.correlation.db.events.EndpointEvent(trap=None, cached_params=None)

An EndpointEvent contains minimal information about an individual SNMP trap: time, state, and any specific information necessary to construct a relevant alarm description.

The constructor extracts the standard params from a trap for use with event/flap processing via self.event_history, or loads based on the values in cached_params

Note that in python, abstract methods can have a body. Child classes should add type sanity checking.

Parameters:
  • trap – a normal trap dict

  • cached_params – dict loaded from cache

TYPE_FAMILY = {}

for sanity checking (cf. FlapBucket constructor)

baseline_fake_trap()

Constructs a trap used create a placeholder event.

Returns:

a basic snmp trap dict with timestamps based on the current time

dumpd()

Create a json-serializable dict that can be used with to re-create this object. :return: a json-serializable dict

classmethod from_cache(trap_or_cached_params)
classmethod from_trap(trap_or_cached_params)
abstractmethod load_flap_record(session)

Load the database record from the correct technology-specific table. :param session: :return: a db row record

abstractmethod new_flap_record(endpoint, dashboard_alarm)

Construct a new database record object for the particular technology. :param endpoint: :param dashboard_alarm: :return:

abstractmethod update_flap_record(bucket, alarm)

Update the database record with bucket changes.

note: this could be static, but is different per subclass and the type checking would get messy

Parameters:
  • bucket

  • alarm

Returns:

Juniper BGP Events

class dashboard.correlation.db.events.BGPEndpointEvent(trap=None, cached_params=None)

Bases: EndpointEvent

Construct a Juniper BGP up/down event.

Parameters:
  • trap – a normal trap dict

  • cached_params – dict loaded from cache

TYPE_FAMILY = {'BGPEndpointEvent', 'BGPEndpointPlaceholderEvent'}

for sanity checking (cf. FlapBucket constructor)

dumpd()

Create a json-serializable dict that can be used to re-create this object. :return: a json-serializable dict

load_flap_record(session)

TODO: add re-saving with a new id whenever there’s a load error :param session: :param event: :return:

new_flap_record(endpoint, dashboard_alarm)

Construct a new database record object for the particular technology. :param endpoint: :param dashboard_alarm: :return:

update_flap_record(bucket, juniper_alarm)

Update the database record with bucket changes.

note: this could be static, but is different per subclass and the type checking would get messy

Parameters:
  • bucket

  • alarm

Returns:

class dashboard.correlation.db.events.BGPEndpointPlaceholderEvent(down, ref_event)

Bases: BGPEndpointEvent

Workaround for adding a bogus event that is used to represent a missed trap.

Parameters:
  • self

  • down – the state of the trap we believe was missed

  • ref_event – a previous related bgp endpoint event

Coriant Events

class dashboard.correlation.db.events.CoriantEndpointEvent(trap=None, cached_params=None)

Bases: EndpointEvent

Construct a Coriant up/down event

There’s no additional information added to the event than is already computed in the base class … here we just do a sanity check on the trap type.

Parameters:
  • trap – a normal trap dict

  • cached_params – dict loaded from cache

TYPE_FAMILY = {'CoriantEndpointEvent', 'CoriantEndpointPlaceholderEvent'}

for sanity checking (cf. FlapBucket constructor)

load_flap_record(session)

TODO: add re-saving with a new id whenever there’s a load error :param session: :param event: :return:

new_flap_record(endpoint, dashboard_alarm)

Construct a new database record object for the particular technology. :param endpoint: :param dashboard_alarm: :return:

update_flap_record(bucket, coriant_alarm)

Update the database record with bucket changes.

note: this could be static, but is different per subclass and the type checking would get messy

Parameters:
  • bucket

  • alarm

Returns:

class dashboard.correlation.db.events.CoriantEndpointPlaceholderEvent(down, ref_event)

Bases: CoriantEndpointEvent

workaround for adding a bogus event that is used to represent a missed trap

Parameters:
  • self

  • down – the state of the trap we believe was missed

  • ref_event – a previous related coriant endpoint event

Infinera Events

class dashboard.correlation.db.events.InfineraEndpointEvent(trap=None, cached_params=None)

Bases: EndpointEvent

Construct an Infinera up/down event.

This class is also used for FIBERLINK traps.

Parameters:
  • trap – a normal trap dict

  • cached_params – dict loaded from cache

TYPE_FAMILY = {'InfineraEndpointEvent', 'InfineraEndpointPlaceholderEvent'}

for sanity checking (cf. FlapBucket constructor)

dumpd()

Create a json-serializable dict that can be used with loadd to re-create this object. :return: a json-serializable dict

load_flap_record(session)

TODO: add re-saving with a new id whenever there’s a load error :param session: :param event: :return:

new_flap_record(endpoint, dashboard_alarm)

Construct a new database record object for the particular technology. :param endpoint: :param dashboard_alarm: :return:

update_flap_record(bucket, infinera_alarm)

Update the database record with bucket changes.

note: this could be static, but is different per subclass and the type checking would get messy

Parameters:
  • bucket

  • alarm

Returns:

class dashboard.correlation.db.events.InfineraEndpointPlaceholderEvent(down, ref_event)

Bases: InfineraEndpointEvent

Workaround for adding a bogus event that is used to represent a missed trap.

Parameters:
  • down – the state of the trap we believe was missed

  • ref_event – a previous related infinera endpoint event