Software end of support nearing-juniper-junos

Software end of support nearing-juniper-junos

Vendor: juniper

OS: junos

Description:
indeni will trigger an issue a significant time before the software running on a device reaches end of support.

Remediation Steps:
Upgrade the software to a more recent release.
|||1. Run “show version” command to review the current software version.
|2. Ensure the current software version is supported by Juniper.
|3. Review Juniper support site for full information regarding software end of life: <a target="_blank" href=“https://www.juniper.net/support/eol/#software”>End of Life Products & Milestones
|4. Contact Juniper Networks Technical Assistance Center (JTAC) if further assistance is required.

How does this work?
This script logs into the Juniper JUNOS-based device using SSH to retrieve the current software version and based on the software version and the Juniper provided information at: http://www.juniper.net/support/eol/junos.html the correct end of support date is used.

Why is this important?
Ensuring the software being used is always within the vendor’s list of supported versions is critical. Otherwise, during a critical issue, the vendor may decline to provide technical support. Juniper posts the list of supported software on their website: http://www.juniper.net/support/eol/junos.html

Without Indeni how would you find this?
Manual tracking by an administrator is usually the only method for knowing when a given device may be nearing its software end of support and is in need of upgrading.

junos-show-version

name: junos-show-version
description: Fetch the information for the end of support for hardware and software
type: monitoring
monitoring_interval: 5 minute
requires:
    vendor: juniper
    os.name: junos
    product: firewall
comments:
    model:
        why: |
            Capture the device model.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show version"
            command. The output includes the device's hardware and software related details.
        without-indeni: |
            An administrator would have to log into the device and manually issue commands to retrieve this information.
        can-with-snmp: true
        can-with-syslog: false
    vendor:
        why: |
            Capture the device vendor name.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show version"
            command. The output includes the device's hardware and software related details.
        without-indeni: |
            An administrator would have to log into the device and manually issue commands to retrieve this information.
        can-with-snmp: true
        can-with-syslog: false
    hostname:
        why: |
            Capture the host name of the device. This is used for inventory purposes.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show version"
            command. The output includes the device's hardware and software related details.
        without-indeni: |
            An administrator would have to log into the device and manually issue commands to retrieve this information.
        can-with-snmp: true
        can-with-syslog: false
    os-name:
        why: |
            Capture the device operating system name.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show version"
            command. The output includes the device's hardware and software related details.
        without-indeni: |
            An administrator would have to log into the device and manually issue commands to retrieve this information.
        can-with-snmp: true
        can-with-syslog: false
    os-version:
        why: |
            Capture the device operating system version. The version should be the same across all members of a cluster.
        how: |
            This script logs into the Juniper JUNOS-based device using SSH and retrieves the output of the "show version"
            command. The output includes the device's hardware and software related details.
        without-indeni: |
            An administrator would have to log into the device and manually issue commands to retrieve this information.
        can-with-snmp: true
        can-with-syslog: false
    software-eos-date:
        why: "Ensuring the software being used is always within the vendor's list\
            \ of supported versions is critical.\nOtherwise, during a critical issue,\
            \ the vendor may decline to provide technical support. Juniper posts the\
            \ list\nof supported software on their website: \nhttp://www.juniper.net/support/eol/junos.html\n"
        how: |
            This script logs into the Juniper JUNOS-based device using SSH to retrieve the current software version and
            based on the software version and the Juniper provided information at:
            http://www.juniper.net/support/eol/junos.html the correct end of support date is used.
        without-indeni: |
            Manual tracking by an administrator is usually the only method for knowing when a given device may be nearing
            its software end of support and is in need of upgrading.
        can-with-snmp: false
        can-with-syslog: false
    hardware-eos-date:
        why: "Ensuring the hardware being used is always within the vendor's list\
            \ of supported models is critical. Otherwise,\nduring a critical issue,\
            \ the vendor may decline to provide technical support. Juniper posts the\
            \ list of\nsupported hardware on their website: \nhttp://www.juniper.net/support/eol/srxseries_hw.html\n"
        how: |
            This script logs into the Juniper JUNOS-based device using SSH to retrieve the current model used and based on
            it and the Juniper provided information at http://www.juniper.net/support/eol/srxseries_hw.html the correct end
            of support date is used.
        without-indeni: |
            Manual tracking by an administrator is usually the only method for knowing when a given device may be nearing
            its end of support and is in need of replacement.
        can-with-snmp: false
        can-with-syslog: false
steps:
-   run:
        type: SSH
        file: show-version.remote.1.bash
    parse:
        type: AWK
        file: show-version.parser.1.awk

cross_vendor_software_eos

package com.indeni.server.rules.library.core
import com.indeni.apidata.time.TimeSpan
import com.indeni.apidata.time.TimeSpan.TimePeriod
import com.indeni.ruleengine.expressions.conditions.LesserThan
import com.indeni.ruleengine.expressions.core._
import com.indeni.ruleengine.expressions.data._
import com.indeni.ruleengine.expressions.math.PlusExpression
import com.indeni.ruleengine.expressions.utility.NowExpression
import com.indeni.server.common.data.conditions.True
import com.indeni.server.params.ParameterDefinition
import com.indeni.server.params.ParameterDefinition.UIType
import com.indeni.server.rules._
import com.indeni.server.rules.library.{ConditionalRemediationSteps, PerDeviceRule, RuleHelper}
import com.indeni.server.sensor.models.managementprocess.alerts.dto.AlertSeverity


case class SoftwareEosRule() extends PerDeviceRule with RuleHelper {

  private val highThresholdParameterName = "Ahead_Alerting_Threshold"
  private val highThresholdParameter = new ParameterDefinition(highThresholdParameterName,
                                                               "",
                                                               "Expiration Threshold",
                                                               "How long before end of support should Indeni alert.",
                                                               UIType.TIMESPAN,
                                                               TimeSpan.fromDays(90))

  override val metadata: RuleMetadata = RuleMetadata
    .builder(
      "cross_vendor_software_eos",
      "Software end of support nearing",
      "indeni will trigger an issue a significant time before the software running on a device reaches end of support.",
      AlertSeverity.ERROR,
      categories = Set(RuleCategory.OngoingMaintenance),
      deviceCategory = DeviceCategory.AllDevices
    )
    .configParameter(highThresholdParameter)
    .build()

  override def expressionTree(context: RuleContext): StatusTreeExpression = {
    val actualValue = TimeSeriesExpression[Double]("software-eos-date").last.toTimeSpan(TimePeriod.SECOND)

    StatusTreeExpression(
      // Which objects to pull (normally, devices)
      SelectTagsExpression(context.metaDao, Set(DeviceKey), True),
      // What constitutes an issue
      StatusTreeExpression(
        // The time-series we check the test condition against:
        SelectTimeSeriesExpression[Double](context.tsDao, Set("software-eos-date"), denseOnly = false),
        // The condition which, if true, we have an issue. Checked against the time-series we've collected
        LesserThan(actualValue,
                   PlusExpression[TimeSpan](NowExpression(), getParameterTimeSpanForTimeSeries(highThresholdParameter)))

        // The Alert Item to add for this specific item
      ).withRootInfo(
          getHeadline(),
          scopableStringFormatExpression("The end of support for the software on this device is on %s.",
                                         timeSpanToDateExpression(actualValue)),
          ConditionalRemediationSteps(
            "Upgrade the software to a more recent release.",
            RemediationStepCondition.VENDOR_CP -> "The full information on Check Point's software and hardware end of support is available at: <a target=\"_blank\" href=\"https://www.checkpoint.com/support-services/support-life-cycle-policy/\">Support Life Cycle Policy</a>",
            RemediationStepCondition.VENDOR_PANOS -> "Review Palo Alto Networks support site for full information regarding software end of life: <a target=\"_blank\" href=\"https://www.paloaltonetworks.com/services/support/end-of-life-announcements/end-of-life-summary\">End-of-Life Summary</a>",
            RemediationStepCondition.VENDOR_JUNIPER ->
              """|1. Run "show version"  command to review the current software version.
               |2. Ensure the current software version is supported by Juniper.
               |3. Review Juniper support site for full information regarding software end of life: <a target=\"_blank\" href=\"https://www.juniper.net/support/eol/#software\">End of Life Products & Milestones</a>
               |4. Contact Juniper Networks Technical Assistance Center (JTAC) if further assistance is required.""".stripMargin
          )
        )
        .asCondition()
    ).withoutInfo()
  }
}