System resource usage high-cisco-nxos

System resource usage high-cisco-nxos

Vendor: cisco

OS: nxos

Description:
Some devices have a number of different resource limitations (such as maximum number of interfaces, routes, etc.). Indeni will track the actual usage of these resources and alert if the limit is nearing or reached.

Remediation Steps:
Depending on the system resource nearing capacity, review any configuration changes required.
|
|1. Execute the “show resource” command to review the resource utilization of the switch.
|2. Consider of upgrade in case that the resources are close to the upper limits.

How does this work?
This script logs into the Cisco Nexus switch using SSH and retrieves the resource utilization data using the “show resource” command. The output includes a complete report of the resource utilization and the minimum and maximum threshold for each one of the resources.

Why is this important?
Collect system level resource information to monitor for resource exhaustion. An alert will be generated when the resource utilization gets close to the maximum threshold. The following resources are monitored: Number of VLANs, VRFs, Port-Channels, IPv4 and IPv4 unicast and multicast routes and Monitor (SPAN) sessions.

Without Indeni how would you find this?
It is not possible to poll this data through SNMP. When certain resources are exhaused a syslog message will be generated. At this stage there could be some impact to the system capability to forward traffic.

nexus-show-resource

name: nexus-show-resource
description: Nexus Resources
type: monitoring
monitoring_interval: 5 minutes
requires:
    vendor: cisco
    os.name: nxos
comments:
    system-resource-usage:
        why: |
            Collect system level resource information to monitor for resource exhaustion. An alert will be generated when the resource utilization gets close to the maximum threshold. The following resources are monitored: Number of VLANs, VRFs, Port-Channels, IPv4 and IPv4 unicast and multicast routes and Monitor (SPAN) sessions.
        how: |
            This script logs into the Cisco Nexus switch using SSH and retrieves the resource utilization data using the "show resource" command. The output includes a complete report of the resource utilization and the minimum and maximum threshold for each one of the resources.
        without-indeni: |
            It is not possible to poll this data through SNMP. When certain resources are exhaused a syslog message will be generated. At this stage there could be some impact to the system capability to forward traffic.
        can-with-snmp: false
        can-with-syslog: true
    system-resource-limit:
        skip-documentation: true
steps:
-   run:
        type: SSH
        command: show resource | xml
    parse:
        type: XML
        file: show_resource.parser.1.xml.yaml

nexus-show-resource

name: nexus-show-resource
description: Nexus Resources
type: monitoring
monitoring_interval: 5 minutes
requires:
    vendor: cisco
    os.name: nxos
comments:
    system-resource-usage:
        why: |
            Collect system level resource information to monitor for resource exhaustion. An alert will be generated when the resource utilization gets close to the maximum threshold. The following resources are monitored: Number of VLANs, VRFs, Port-Channels, IPv4 and IPv4 unicast and multicast routes and Monitor (SPAN) sessions.
        how: |
            This script logs into the Cisco Nexus switch using SSH and retrieves the resource utilization data using the "show resource" command. The output includes a complete report of the resource utilization and the minimum and maximum threshold for each one of the resources.
        without-indeni: |
            It is not possible to poll this data through SNMP. When certain resources are exhaused a syslog message will be generated. At this stage there could be some impact to the system capability to forward traffic.
        can-with-snmp: false
        can-with-syslog: true
    system-resource-limit:
        skip-documentation: true
steps:
-   run:
        type: SSH
        command: show resource | xml
    parse:
        type: XML
        file: show_resource.parser.1.xml.yaml

system_resource_usage_limit

// 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.NearingCapacityWithItemsTemplateRule
import com.indeni.server.rules.RemediationStepCondition

/**
  *
  */
case class system_resource_usage_limit() extends NearingCapacityWithItemsTemplateRule(
  ruleName = "system_resource_usage_limit",
  ruleFriendlyName = "All Devices: System resource usage high",
  ruleDescription = "Some devices have a number of different resource limitations (such as maximum number of interfaces, routes, etc.). Indeni will track the actual usage of these resources and alert if the limit is nearing or reached.",
  usageMetricName = "system-resource-usage",
  limitMetricName = "system-resource-limit",
  applicableMetricTag = "name",
  threshold = 80.0,
  alertDescription = "Some system resources are nearing their limit. Review the list below.",
  alertItemDescriptionFormat = "The number of items in use is %.0f where the limit is %.0f.",
  baseRemediationText = "Depending on the system resource nearing capacity, review any configuration changes required.",
  alertItemsHeader = "Affected Resources")(
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Execute the "show resource" command to review the resource utilization of the switch.
      |2. Consider of upgrade in case that the resources are close to the upper limits.
    """.stripMargin
)