Bond/LACP interface down-checkpoint-gaia,secureplatform

error
high-availability
checkpoint
gaiasecureplatform
Bond/LACP interface down-checkpoint-gaia,secureplatform
0

#1

Bond/LACP interface down-checkpoint-gaia,secureplatform

Vendor: checkpoint

OS: gaia,secureplatform

Description:
indeni will alert if a bond interface is down.

Remediation Steps:
Review the cause for the interfaces being down.
Use the “cphaconf show_bond” command to get additional information.

How does this work?
Use the built-in “cphaconf show_bond” command to retreive the detailed bond state.

Why is this important?
An interface in a bond could be down, and the device would still deem the link as up. This is because the default setting is often to consider one link failure as non-critical if there is another link in the bond. This does however mean a loss of redundancy and capacity which might not be noticed.

Without Indeni how would you find this?
An administrator could login and manually run the command.

chkp-os-cphaconf_show_bond

#! META
name: chkp-os-cphaconf_show_bond
description: run "cphaprob show_bond" to determine bond health
type: monitoring
monitoring_interval: 5 minutes
requires:
    vendor: checkpoint
    high-availability: true
    or:
        -
            os.name: gaia
        -
            os.name: secureplatform

#! COMMENTS
bond-state:
    why: |
        An interface in a bond could be down, and the device would still deem the link as up. This is because the default setting is often to consider one link failure as non-critical if there is another link in the bond. This does however mean a loss of redundancy and capacity which might not be noticed.
    how: |
        Use the built-in "cphaconf show_bond" command to retreive the detailed bond state.
    without-indeni: |
        An administrator could login and manually run the command.
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        Listing bond status is only available from the command line interface.

bond-slaves-in-use:
    why: |
        Tracking the bond slaves in use versus the total required is a good indicator of potential issues.
    how: |
        Use the built-in "cphaconf show_bond" command to retreive the detailed bond state.
    without-indeni: |
        An administrator could login and manually run the command.
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        Listing bond status is only available from the command line interface.

bond-slaves-required:
    why: |
        Tracking the bond slaves in use versus the total required is a good indicator of potential issues.
    how: |
        Use the built-in "cphaconf show_bond" command to retreive the detailed bond state.
    without-indeni: |
        An administrator could login and manually run the command.
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        Listing bond status is only available from the command line interface.

bond-slave-state:
    skip-documentation: true

#! REMOTE::SSH

${nice-path} -n 15 ifconfig | grep "bond" |awk '{gsub(/\..+/,"",$1); print $1}'| sort | uniq |while read bonds; do ${nice-path} -n 15 cphaconf show_bond $bonds; done

#! PARSER::AWK

############
# Script explanation: The command uses "cphaconf" which is only available when in a cluster.
###########

# Bond name:      bond0
/Bond name/ {
    bondname = $NF
}

# Bond status:    UP
/Bond status/ {
    bondstatus = $NF
    isup = 0
    if (bondstatus == "UP") {
        isup = 1
    }
    bondstatustags["name"] = bondname
    writeDoubleMetricWithLiveConfig("bond-state", bondstatustags, "gauge", "60", isup, "Bond Interfaces", "state", "name")
}

# Configured slave interfaces: 2
/Configured slave interfaces/ {
    writeDoubleMetric("configured-slaves", bondstatustags, "gauge", "60", $NF)
}

# In use slave interfaces:     1
/In use slave interfaces/ {
    writeDoubleMetric("bond-slaves-in-use", bondstatustags, "gauge", "60", $NF)
}

# Required slave interfaces:   1
/Required slave interfaces/ {
    writeDoubleMetric("bond-slaves-required", bondstatustags, "gauge", "60", $NF)
}

# Lines should end with status Yes/No, like:
# eth3            | Active          | Yes
/(Yes|No)$/ {
    t["name"] = $1
    state_desc = $(NF-2)
#    t["state-description"] = state_desc
    t["bond-name"] = bondname

    up = 0
    if (match(state_desc, "Active")) {
        up = 1
    }
    writeDoubleMetricWithLiveConfig("bond-slave-state", t, "gauge", "60", up, "Bond Slave Interfaces", "state", "name|bond-name")
}

cross_vendor_bond_down

package com.indeni.server.rules.library.templatebased.crossvendor

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.{ConditionalRemediationSteps, StateDownTemplateRule}

/**
  *
  */
case class cross_vendor_bond_down() extends StateDownTemplateRule(
  ruleName = "cross_vendor_bond_down",
  ruleFriendlyName = "All Devices: Bond/LACP interface down",
  ruleDescription = "indeni will alert if a bond interface is down.",
  metricName = "bond-state",
  applicableMetricTag = "name",
  alertItemsHeader = "Interfaces Affected",
  descriptionStringFormat = "",
  alertDescription = "One or more bond interfaces are down.",
  baseRemediationText = "Review the cause for the interfaces being down.")(
  ConditionalRemediationSteps.VENDOR_CP -> "Use the \"cphaconf show_bond\" command to get additional information.",
  ConditionalRemediationSteps.VENDOR_PANOS -> "Use the \"show lacp\" command to get additional information."
)