BGP peer(s) down-juniper-junos

BGP peer(s) down-juniper-junos

Vendor: juniper

OS: junos

Description:
Indeni will alert one or more BGP peers isn’t communicating well.

Remediation Steps:
Review the cause for the peers being down.

How does this work?
This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the “show bgp neighbor” command. The output includes the status of active/established/inactive BGP neighbors.

Why is this important?
Due to the dynamic nature of BGP, it should be closely monitored to verify that it is working correctly. Since routing is a vital part of any network, a failure or issues in dynamic routing can cause large disruptions.

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

junos-show-bgp-neighbor

name: junos-show-bgp-neighbor
description: Retrieve BGP neighbor information
type: monitoring
monitoring_interval: 1 minute
requires:
    vendor: juniper
    os.name: junos
comments:
    bgp-received-routes:
        skip-documentation: true
    bgp-state:
        why: |
            Due to the dynamic nature of BGP, it should be closely monitored to verify that it is working correctly. Since routing is a vital part of any network, a failure or issues in dynamic routing can cause large disruptions.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show bgp neighbor" command. The output includes the status of active/established/inactive BGP neighbors.
        without-indeni: "An administrator could login and manually run the command.\
            \ \n"
        can-with-snmp: false
        can-with-syslog: true
        vendor-provided-management: Listing BGP neighbors is only available from the
            command line.
steps:
-   run:
        type: SSH
        command: show bgp summary
    parse:
        type: AWK
        file: show-bgp-neighbor.parser.1.awk

cross_vendor_bgp_peer_down

// Deprecation warning : Scala template-based rules are deprecated. Please use YAML format rules instead.

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

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.templates.StateDownTemplateRule
import com.indeni.server.rules.RemediationStepCondition

/**
  *
  */
case class cross_vendor_bgp_peer_down() extends StateDownTemplateRule(
  ruleName = "cross_vendor_bgp_peer_down",
  ruleFriendlyName = "All Devices: BGP peer(s) down",
  ruleDescription = "Indeni will alert one or more BGP peers isn't communicating well.",
  metricName = "bgp-state",
  applicableMetricTag = "name",
  alertItemsHeader = "Peers Affected",
  alertDescription = "One or more BGP peers are down.",
  baseRemediationText = "Review the cause for the peers being down.")(
  RemediationStepCondition.VENDOR_CP -> "Consider reading Tobias Lachmann's blog on BGP: https://blog.lachmann.org/?p=1771",
  RemediationStepCondition.VENDOR_PANOS -> "Consider starting at https://live.paloaltonetworks.com/t5/Configuration-Articles/BGP-Routes-are-not-Injected-into-the-Routing-Table/ta-p/54938 . You can also log into the device over SSH and run \"less mp-log routed.log\".",
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Get information for all BGP neighbors by running the "show bgp vrf all sessions" NX-OS command
      |2. Get a summary list of BGP neighbors and statistics by executing the "show ip bgp vrf all summary" NX-OS command
      |3. Get detailed information from a BGP neighbor by running the "show ip bgp neighbors X.X.X.X" NX-OS command
      |4. Check global BGP process information with the "show bgp process" NX-OS command
      |5. Review the logs for relevant findings
      |6. For more information please review  following CISCO BGP troubleshooting flow chart:
      |https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/22166-bgp-trouble-main.html#anc6""".stripMargin
)
{
  override def deviceCondition(context: RuleContext) = generateDevicePassiveAndPassiveLinkStateCondition(context.tsDao)
}