SNMP contact information does not match across cluster members-juniper-junos

SNMP contact information does not match across cluster members-juniper-junos

Vendor: juniper

OS: junos

Description:
Indeni will identify when two devices are part of a cluster and alert if the SNMP settings do not match.

Remediation Steps:
Ensure all of the SNMP settings are configured correctly on all cluster members.

junos-show-configuration-snmp

name: junos-show-configuration-snmp
description: JUNOS SRX retrieving snmp configuration information
type: monitoring
monitoring_interval: 60 minute
requires:
    vendor: juniper
    os.name: junos
    product: firewall
comments:
    snmp-enabled:
        skip-documentation: true
    snmp-version:
        skip-documentation: true
    snmp-location:
        skip-documentation: true
    snmp-communities:
        skip-documentation: true
    snmp-traps-status:
        skip-documentation: true
    snmp-traps-receiver:
        skip-documentation: true
    snmp-users:
        skip-documentation: true
    unencrypted-snmp-configured:
        skip-documentation: true
        why: |
            The SRX device can be configured to allow snmp query or set, and also send traps to trap receivers.
        how: |
            This script retrieves how the snmp is configured on the SRX device by running the command "show configuration snmp" via SSH connection to a device.
        without-indeni: |
            An administrator could log on to the device to run the command "show configuration snmp" to collect the same information.
        can-with-snmp: true
        can-with-syslog: false
        vendor-provided-management: The commamnd line is available to retrieve this
            information
steps:
-   run:
        type: SSH
        command: show configuration snmp | display set
    parse:
        type: AWK
        file: show-configuration-snmp.parser.1.awk

cross_vendor_snmp_contact_comparison

// 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.SnapshotComparisonTemplateRule
import com.indeni.server.rules.RemediationStepCondition

/**
  *
  */
case class cross_vendor_snmp_contact_comparison() extends SnapshotComparisonTemplateRule(
  ruleName = "cross_vendor_snmp_contact_comparison",
  ruleFriendlyName = "Clustered Devices: SNMP contact information does not match across cluster members",
  ruleDescription = "Indeni will identify when two devices are part of a cluster and alert if the SNMP settings do not match.",
  metricName = "snmp-contact",
  isArray = false,
  alertDescription = "Devices that are part of a cluster should have the same SNMP configuration. Review the differences below.",
  baseRemediationText = "Ensure all of the SNMP settings are configured correctly on all cluster members.")(
  RemediationStepCondition.VENDOR_CISCO ->
    """|
      |1. Ensure all of the SNMP settings are configured correctly on vPC peers.
      |2. Run  the "show snmp" NX-OS command to check the SNMP contact which should be the same across the peer switches.
      |3. Configure the same snmp contacts by using the next "snmp contact" NX-OS command.""".stripMargin
)