Device uptime too high-radware-alteon-os

error
ongoing-maintenance
alteon-os
radware
Device uptime too high-radware-alteon-os
0

#1

Device uptime too high-radware-alteon-os

Vendor: radware

OS: alteon-os

Description:
Indeni will alert when a device’s uptime is too high

Remediation Steps:
Upgrade the device. You may also change the alert’s threshold, or disable the alert completely, if not needed.

How does this work?
This script uses the REST API to retrieve the uptime of the device.

Why is this important?
Capture the uptime of the device. If the uptime is lower than the previous sample, the device must have reloaded.

Without Indeni how would you find this?
An administrator could manually get this information by issuing the command “/cfg/sys/cur”.

radware-api-config-sysUpTime

#! META
name: radware-api-config-sysUpTime
description: Get the system uptime
type: monitoring
monitoring_interval: 1 minute 
requires:
    os.name: "alteon-os"
    vendor: "radware"

#! REMOTE::HTTP
url: /config/sysUpTime
protocol: HTTPS

#! COMMENTS
uptime-milliseconds:
    why: |
        Capture the uptime of the device. If the uptime is lower than the previous sample, the device must have reloaded. 
    how: |
        This script uses the REST API to retrieve the uptime of the device.
    without-indeni: |
        An administrator could manually get this information by issuing the command "/cfg/sys/cur".
    can-with-snmp: true

#! PARSER::JSON
_metrics:
    -
        _tags:
            "im.name":
                _constant: "uptime-milliseconds"
            "live-config":
               _constant: "true"
            "display-name":
                _constant: "Uptime"
            "im.dstype.displayType":
                _constant: "duration"
        _temp:
            sysUpTime:
                _value: sysUpTime
        _transform:
            _value.double: |
                {
                	print temp("sysUpTime") * 10
                }

cross_vendor_uptime_high

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

import com.indeni.apidata.time.TimeSpan
import com.indeni.apidata.time.TimeSpan.TimePeriod
import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.templates.TimeIntervalThresholdOnDoubleMetricTemplateRule
import com.indeni.server.rules.library.{ConditionalRemediationSteps, ThresholdDirection}
import com.indeni.server.sensor.models.managementprocess.alerts.dto.AlertSeverity

/**
  *
  */
case class cross_vendor_uptime_high() extends TimeIntervalThresholdOnDoubleMetricTemplateRule(
  ruleName = "cross_vendor_uptime_high",
  ruleFriendlyName = "All Devices: Device uptime too high",
  ruleDescription = "Indeni will alert when a device's uptime is too high",
  severity = AlertSeverity.ERROR,
  metricName = "uptime-milliseconds",
  metricUnits = TimePeriod.MILLISECOND,
  threshold = TimeSpan.fromDays(365 * 10),
  thresholdDirection = ThresholdDirection.ABOVE,
  alertDescriptionFormat = "The current uptime is %.0f seconds. This alert identifies when a device has been up for a very long time and may need an upgrade.",
  alertDescriptionValueUnits = TimePeriod.SECOND,
  baseRemediationText = "Upgrade the device. You may also change the alert's threshold, or disable the alert completely, if not needed.")(
  ConditionalRemediationSteps.OS_NXOS ->
    """|
       |1. Use the "show version" NX-OS command to display the current system uptime.
       |2. Run the "show system reset-reason" to check the reason for the last reboot of the device.
       |3. Check if the installed NX-OS version is supported and review it for software bugs.""".stripMargin
)