Cluster members' domain names mismatch-juniper-junos

error
high-availability
junos
juniper
Cluster members' domain names mismatch-juniper-junos
0

#1

Cluster members’ domain names mismatch-juniper-junos

Vendor: juniper

OS: junos

Description:
Indeni will identify when two devices are part of a cluster and alert if the domain setting is different.

Remediation Steps:
Review the settings of each device in the cluster and ensure they are the same.

How does this work?
This script logs into the Juniper JUNOS-based device using SSH and retrieves the relevant output of the “show configuration system domain-name” command.

Why is this important?
Capture the domain of the device. This is used for inventory purposes.

Without Indeni how would you find this?
It is possible to poll this data through SNMP.

junos-show-configuration-domain-name

#! META
name: junos-show-configuration-domain-name
description: Retrieve the domain-name in the configuration
type: monitoring
monitoring_interval: 60 minute
requires:
    vendor: juniper
    os.name: junos

#! COMMENTS
domain:
    why: |
       Capture the domain of the device. This is used for inventory purposes.
    how: |
       This script logs into the Juniper JUNOS-based device using SSH and retrieves the relevant output of the "show configuration system domain-name" command.
    without-indeni: |
       It is possible to poll this data through SNMP.
    can-with-snmp: true
    can-with-syslog: false

#! REMOTE::SSH
show configuration system domain-name 

#! PARSER::AWK
#domain-name gongya.net;
/^(domain-name \S+;)/ {
    domainName = $2
    sub(/;/, "", domainName)
    writeComplexMetricStringWithLiveConfig("domain", null, domainName, " Overview")
}

cross_vendor_compare_domain

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

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.ConditionalRemediationSteps
import com.indeni.server.rules.library.templates.SnapshotComparisonTemplateRule

/**
  *
  */
case class cross_vendor_compare_domain() extends SnapshotComparisonTemplateRule(
  ruleName = "cross_vendor_compare_domain",
  ruleFriendlyName = "Clustered Devices: Cluster members' domain names mismatch",
  ruleDescription = "Indeni will identify when two devices are part of a cluster and alert if the domain setting is different.",
  metricName = "domain",
  isArray = false,
  alertDescription = "The members of a cluster of devices must have the same domain settings.",
  baseRemediationText = "Review the settings of each device in the cluster and ensure they are the same.")(
  ConditionalRemediationSteps.OS_NXOS ->
    """|
      |1. Use the "ip domain-name" NX-OS command to configure the same domain name for the clustered devices
      |2. Use the vrf context command in case that is needed to enter to the VRF context mode to configure the domain  for a particular VRF.
      |3. For more information please review  the following CISCO Configuration guide:
      |https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus5000/sw/command/reference/sysmgmt/n5k-sysmgmt-cr/n5k-sm_cmds_i.html#pgfId-1659356
    """.stripMargin
)