License usage limit approaching-juniper-junos

License usage limit approaching-juniper-junos
0

License usage limit approaching-juniper-junos

Vendor: juniper

OS: junos

Description:
Some licenses are limited to a certain number of elements (such as maximum users). If any of the licenses is nearing its limit, an alert will be issued.

Remediation Steps:
Consider purchasing additional licenses.

junos-show-system-license

name: junos-show-system-license
description: JUNOS get licenses
type: monitoring
monitoring_interval: 60 minute
requires:
    vendor: juniper
    os.name: junos
comments:
    license-elements-limit:
        why: |
            Tracking the utilization of licenses is important to ensure smooth operation of critical functions. If a license is limited by count (such as by number of users) and the limit is reached, service disruption may follow.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show system license" command. The output includes the device's installed licenses.
        without-indeni: |
            The Juniper device can be set to send an SNMP trap when a license nears expiration (or expires), or is nearing its capacity.
        can-with-snmp: true
        can-with-syslog: false
    license-elements-used:
        skip-documentation: true
    features-enabled:
        why: |
            SRX devices have many features which can be enable based on the licenses installed on the devices.
        how: |
            The script runs "show system license" command via SSH connection to the device to list the features enabled on the device.
        without-indeni: |
            An administrator could log on to the device to manually run this command to display which features are enabled on the device.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: |
            The enabled features can be retrieved from the command line and GUI.
    license-expiration:
        why: |
            Most of the features on SRX devices need licenses.
        how: |
            The script runs "show system license" command via SSH connnection to the device to retrieve the license expiration information.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: The license expiration information can be retrieved
            from the command line and GUI.
steps:
-   run:
        type: SSH
        command: show system license | display xml
    parse:
        type: XML
        file: show-system-license.parser.1.xml.yaml

junos-show-system-license

name: junos-show-system-license
description: JUNOS get licenses
type: monitoring
monitoring_interval: 60 minute
requires:
    vendor: juniper
    os.name: junos
comments:
    license-elements-limit:
        why: |
            Tracking the utilization of licenses is important to ensure smooth operation of critical functions. If a license is limited by count (such as by number of users) and the limit is reached, service disruption may follow.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show system license" command. The output includes the device's installed licenses.
        without-indeni: |
            The Juniper device can be set to send an SNMP trap when a license nears expiration (or expires), or is nearing its capacity.
        can-with-snmp: true
        can-with-syslog: false
    license-elements-used:
        skip-documentation: true
    features-enabled:
        why: |
            SRX devices have many features which can be enable based on the licenses installed on the devices.
        how: |
            The script runs "show system license" command via SSH connection to the device to list the features enabled on the device.
        without-indeni: |
            An administrator could log on to the device to manually run this command to display which features are enabled on the device.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: |
            The enabled features can be retrieved from the command line and GUI.
    license-expiration:
        why: |
            Most of the features on SRX devices need licenses.
        how: |
            The script runs "show system license" command via SSH connnection to the device to retrieve the license expiration information.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: The license expiration information can be retrieved
            from the command line and GUI.
steps:
-   run:
        type: SSH
        command: show system license | display xml
    parse:
        type: XML
        file: show-system-license.parser.1.xml.yaml

license_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 license_usage_limit() extends NearingCapacityWithItemsTemplateRule(
  ruleName = "license_usage_limit",
  ruleFriendlyName = "All Devices: License usage limit approaching",
  ruleDescription = "Some licenses are limited to a certain number of elements (such as maximum users). If any of the licenses is nearing its limit, an alert will be issued.",
  usageMetricName = "license-elements-used",
  limitMetricName = "license-elements-limit",
  applicableMetricTag = "name",
  threshold = 80.0,
  minimumValueToAlert = 2.0, // We don't want to alert if the license capacity is 1 and we're using one item, this is a common occurence and isn't an issue
  alertDescription = "Some licenses are nearing their limit. Review the list below.",
  alertItemDescriptionFormat = "The number of elements in use is %.0f where the limit is %.0f.",
  baseRemediationText = "Consider purchasing additional licenses.",
  alertItemsHeader = "Affected Licenses")(
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Run the "show license usage" NX-OS command to display information about the current license usage and the expire date.
      |2. Run the "show license" NX-OS command to view the installed licenses.
      |3. Run the "show license usage XXX" NX-OS command e.g." sh license usage ENHANCED_LAYER2_PKG" to display information about the activated features which utilize this license.
      |4. Consider activate the grace-period for the license.
      |5. Order new license from the CISCO.
      |6. For more information please review the next Cisco guide:
      |https://www.cisco.com/c/m/en_us/techdoc/dc/reference/cli/nxos/commands/fund/show-license-usage.html
    """.stripMargin
)