Example #1
0
# Interface Monitoring Interval in seconds
PLUGIN_AUDIT_INTERVAL = 60

# Sample Data 'type' and 'instance' database field values.
PLUGIN_TYPE = 'absolute'
PLUGIN_TYPE_INSTANCE = 'reachable'

# Remote Logging Connectivity Alarm ID
PLUGIN_ALARMID = '100.118'

# The file where this plugin learns if remote logging is enabled
SYSLOG_CONF_FILE = '/etc/syslog-ng/syslog-ng.conf'

# Plugin Control Object
obj = pc.PluginObject(PLUGIN, "")


# Raise Remote Logging Server Alarm
def raise_alarm():
    """Raise Remote Logging Server Alarm"""

    repair = 'Ensure Remote Log Server IP is reachable from '
    repair += 'Controller through OAM interface; otherwise '
    repair += 'contact next level of support.'

    reason = 'Controller cannot establish connection with '
    reason += 'remote logging server.'

    try:
        fault = fm_api.Fault(
Example #2
0
        elif self.link_one.state == LINK_UP and self.link_two.state == LINK_UP:
            if self.severity != fm_constants.FM_ALARM_SEVERITY_CLEAR:
                self.clear_iface_alarm()

        elif self.link_one.state == LINK_DOWN and \
                self.link_two.state == LINK_DOWN:
            if self.severity != fm_constants.FM_ALARM_SEVERITY_CRITICAL:
                if self.link_one.timestamp > self.link_two.timestamp:
                    self.timestamp = self.link_one.timestamp
                else:
                    self.timestamp = self.link_two.timestamp
                self.raise_iface_alarm(fm_constants.FM_ALARM_SEVERITY_CRITICAL)


# Plugin Control Object
obj = pc.PluginObject(PLUGIN, PLUGIN_HTTP_URL_PREFIX)

# Network Object List - Primary Network/Link Control Object
NETWORKS = [
    NetworkObject(NETWORK_MGMT),
    NetworkObject(NETWORK_OAM),
    NetworkObject(NETWORK_CLSTR)
]


##########################################################################
#
# Name      : get_timestamp
#
# Purpose   : Convert the long long int microsecond time as string
#             that accompany link info from the Link Monitor (lmond)