Virtual systems restarted (uptime low)-radware-alteon-os

health-checks
critical
alteon-os
radware
Virtual systems restarted (uptime low)-radware-alteon-os
0

#1

Virtual systems restarted (uptime low)-radware-alteon-os

Vendor: radware

OS: alteon-os

Description:
Indeni will alert when a virtual system has restarted.

Remediation Steps:
Determine why the virtual system(s) was restarted.

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_low_vsx

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.{ConditionalRemediationSteps, ThresholdDirection, TimeThresholdOnDoubleMetricWithItemsTemplateRule}
import com.indeni.server.sensor.models.managementprocess.alerts.dto.AlertSeverity

/**
  *
  */
case class cross_vendor_uptime_low_vsx() extends TimeThresholdOnDoubleMetricWithItemsTemplateRule(
      ruleName = "cross_vendor_uptime_low_vsx",
      ruleFriendlyName = "All Devices (VSX): Virtual systems restarted (uptime low)",
      ruleDescription = "Indeni will alert when a virtual system has restarted.",
      severity = AlertSeverity.CRITICAL,
      metricName = "uptime-milliseconds",
      threshold = TimeSpan.fromMinutes(60),
      metricUnits = TimePeriod.MILLISECOND,
      thresholdDirection = ThresholdDirection.BELOW,
      applicableMetricTag = "vs.name",
      alertItemsHeader = "Affected Virtual Systems",
      alertItemDescriptionFormat = "The current uptime is %.0f seconds which seems to indicate the virtual system has restarted.",
      alertItemDescriptionUnits = TimePeriod.SECOND,
      alertDescription = "Some virtual systems on this device have restarted recently. Review the list below.",
      baseRemediationText = "Determine why the virtual system(s) was restarted."
    )(
      ConditionalRemediationSteps.OS_NXOS ->
        """|
       |1. Use the "show version" or "show system reset-reason" NX-OS commands to display the reason for the reload
       |2. Use the "show cores" command to determine if a core file was recorded during the unexpected reboot
       |3.  Run the "show process log" command to display the processes and if a core was created.
       |4.  With the show logging command, review the events that happened close to the time of reboot
    """.stripMargin
    )


#2