Timezone mismatch across cluster members-checkpoint-gaia,ipso

Timezone mismatch across cluster members-checkpoint-gaia,ipso
0

Timezone mismatch across cluster members-checkpoint-gaia,ipso

Vendor: checkpoint

OS: gaia,ipso

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

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

How does this work?
Parse the Gaia/IPSO configuration database in /config/active and retreive the currently configured time zone. It is also possible to list it using clish, but that generates a large amount of logs in /var/log/messages when done repeatedly.

Why is this important?
A correct time and time zone is very important for many reasons. An incorrectly configured time zone could mean that timestamps on logs are incorrect.

Without Indeni how would you find this?
An administrator could login and manually run the command.

chkp-clish-show-timezone

#! META
name: chkp-clish-show-timezone
description: records the timezone for the device
type: monitoring
monitoring_interval: 60 minutes
requires:
    vendor: checkpoint
    or:
        -
            os.name: gaia
        -
            os.name: ipso

#! COMMENTS
timezone:
    why: |
        A correct time and time zone is very important for many reasons. An incorrectly configured time zone could mean that timestamps on logs are incorrect.
    how: |
        Parse the Gaia/IPSO configuration database in /config/active and retreive the currently configured time zone. It is also possible to list it using clish, but that generates a large amount of logs in /var/log/messages when done repeatedly.
    without-indeni: |
        An administrator could login and manually run the command.
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        Listing the time zone only available from the command line interface and WebUI.

#! REMOTE::SSH
${nice-path} -n 15 grep "timezone" /config/active

#! PARSER::AWK

############
# Why: Get which timezone are configured, to make sure they are the same across sites or devices.
# How: Parse the gaia configuration file to get the information.
# Caveats: We avoid running clish commands due to the excessive logs in /var/log/messages that creates.
###########

# timezone Etc/GMT-12
/timezone/ {
	timezone=$2
}

END {
	if (timezone) {
		writeComplexMetricStringWithLiveConfig("timezone", null, timezone, "Timezone")
	}
}

cross_vendor_compare_timezone

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_timezone() extends SnapshotComparisonTemplateRule(
  ruleName = "cross_vendor_compare_timezone",
  ruleFriendlyName = "Clustered Devices: Timezone mismatch across cluster members",
  ruleDescription = "Indeni will identify when two devices are part of a cluster and alert if the timezone setting is different.",
  metricName = "timezone",
  isArray = false,
  alertDescription = "The members of a cluster of devices must have the same timezone settings.",
  baseRemediationText = """Review the settings of each device in the cluster and ensure they are the same.""")(
  ConditionalRemediationSteps.OS_NXOS ->
    """|
      |1. Execute the show clock command to check the system time for both peer switches
      |2. Review the time-zone setting of each device in the cluster and ensure they are the same.
      |3. For more information about  NX-OS timezone configuration review the next link:
      |https://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/4_0/nx-os/fundamentals/configuration/guide2/fun_nx-os_book/fun_5sys_mgmt.html""".stripMargin
)