Critical process(es) down (per VS)-juniper-junos

Critical process(es) down (per VS)-juniper-junos

Vendor: juniper

OS: junos

Description:
Many devices have critical processes, usually daemons, that must be up for certain functions to work. indeni will alert if any of these goes down.

Remediation Steps:
Review the cause for the processes being down.

How does this work?
This script monitors those critical processes and identifies the states for those processes by running the “show system processes extensive” command via SSH connection.

Why is this important?
Many processes are critical to the device functionality and health. It is important to monitor these processes to make sure they are running in normal states.

Without Indeni how would you find this?
An administrator could login and manually run the command “show system processes extensive” to get the same information.

junos-show-system-processes-extensive-cluster

name: junos-show-system-processes-extensive-cluster
description: Retrieve system process information
type: monitoring
monitoring_interval: 10 minute
requires:
    vendor: juniper
    os.name: junos
    product: firewall
    high-availability: true
comments:
    process-state:
        why: |
            Many processes are critical to the device functionality and health. It is important to monitor these processes to make sure they are running in normal states.
        how: |
            This script monitors those critical processes and identifies the states for those processes by running the "show system processes extensive" command via SSH connection.
        without-indeni: "An administrator could login and manually run the command\
            \ \"show system processes extensive\" to get the same information. \n"
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: |
            This is only accessible from the command line interface.
    process-cpu:
        why: "Each process should have adequate CPU resource allocated. \n"
        how: |
            List the CPU usage for all processes by running the "show system proccesses extensive" command via SSH connection.
        without-indeni: |
            An administrator would need to log in manually when the issue is occurring in order to deduce a root cause.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: |
            This is only accessible from the command line interface.
    process-memory:
        why: |
            Each process should have adequate memory resource allocated.
        how: |
            List the memory usage for all processes by running the "show system proccesses extensive" command via SSH connection.
        without-indeni: |
            An administrator would need to log in manually when the issue is occurring in order to deduce a root cause.
        can-with-snmp: false
        can-with-syslog: false
        vendor-provided-management: This is only accessible from the command line
            interface.
steps:
-   run:
        type: SSH
        command: show chassis hardware node local | match node
    parse:
        type: AWK
        file: show-system-processes-extensive-cluster.parser.1.awk
-   run:
        type: SSH
        command: show system processes extensive node ${node}
    parse:
        type: AWK
        file: show-system-processes-extensive-cluster.parser.2.awk

cross_vendor_critical_process_down_vsx

// 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.apidata.time.TimeSpan
import com.indeni.server.rules.library.templates.StateDownTemplateRule
import com.indeni.server.rules.RemediationStepCondition

/**
  *
  */
case class cross_vendor_critical_process_down_vsx() extends StateDownTemplateRule(
  ruleName = "cross_vendor_critical_process_down_vsx",
  ruleFriendlyName = "All Devices: Critical process(es) down (per VS)",
  ruleDescription = "Many devices have critical processes, usually daemons, that must be up for certain functions to work. indeni will alert if any of these goes down.",
  metricName = "process-state",
  applicableMetricTag = "process-name",
  descriptionMetricTag = "vs.name",
  alertItemsHeader = "Processes Affected",
  alertDescription = "One or more processes which are critical to the operation of this device, are down.",
  baseRemediationText = "Review the cause for the processes being down.")(
  RemediationStepCondition.VENDOR_CP -> "Check if \"cpstop\" was run.If MDS check if \"mdsstop\" was run",
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Use the "show processes cpu" NX-OS command in order to show the CPU usage at the process level.
      |2. Use the "show process cpu detail <pid>" NX-OS command to find out the CPU usage for all threads that belong to a specific process ID (PID).
      |3. Use the "show system internal sysmgr service pid <pid>" NX-OS command in order to display additional details, such as restart time, crash status, and current state, on the process/service by PID.
      |4. Run the "show system internal processes cpu" NX-OS command which is equivalent to the top command in Linux and provides an ongoing look at processor activity in real time.""".stripMargin
)