NTP servers used do not match across cluster members-f5-False

warn
high-availability
false
f5
NTP servers used do not match across cluster members-f5-False
0

#1

NTP servers used do not match across cluster members-f5-False

Vendor: f5

OS: False

Description:
Indeni will identify when two devices are part of a cluster and alert if the NTP servers they are using are different.

Remediation Steps:
Review the NTP configuration on each device to ensure they match.

How does this work?
Indeni logs in over SSH and executes “tmsh -q list sys ntp”. The output is then parsed for any ntp server configuration.

Why is this important?
Not having an NTP server configured could make the clock slowly drift, which makes log entries and other information harder to summarize between devices. If the clock drifts very far out, there could also be issues with validating certificates.

Without Indeni how would you find this?
An administrator could login to the unit through SSH, enter TMSH and issue the command “list sys ntp” to see the configured NTP servers. This information is also availble through the Web Interface by navigating to “System” -> “Configuration” -> “Device” -> “NTP”.

f5-tmsh-list-sys-ntp

#! META
name: f5-tmsh-list-sys-ntp
description: Get the configured NTP servers and timezone
type: monitoring
monitoring_interval: 60 minutes
requires:
    vendor: "f5"
    product: "load-balancer"
    linux-based: "true"
    shell: "bash"

#! COMMENTS
ntp-servers:
    why: |
        Not having an NTP server configured could make the clock slowly drift, which makes log entries and other information harder to summarize between devices. If the clock drifts very far out, there could also be issues with validating certificates.
    how: |
        Indeni logs in over SSH and executes "tmsh -q list sys ntp". The output is then parsed for any ntp server configuration.
    without-indeni: |
        An administrator could login to the unit through SSH, enter TMSH and issue the command "list sys ntp" to see the configured NTP servers. This information is also availble through the Web Interface by navigating to "System" -> "Configuration" -> "Device" -> "NTP".
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        This information is available via both TMSH and the Web Interface.
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. Indeni will identify when two devices are part of a cluster and alert if the timezone setting is different.
    how: |
        Indeni logs in over SSH and executes "tmsh -q list sys ntp". The output is then parsed for the configured timezone.
    without-indeni: |
        An administrator could login to the unit through SSH, enter TMSH and issue the command "list sys ntp" to see the configured timezone. This information is also availble through the Web Interface by navigating to "System" -> "Platform".
    can-with-snmp: false
    can-with-syslog: false
    vendor-provided-management: |
        This information is available via both TMSH and the Web Interface.  

#! REMOTE::SSH
tmsh -q list sys ntp

#! PARSER::AWK

BEGIN {
    timeZone = ""
}

#    servers { 192.168.70.1 pool.ntp.org }
/^\s+servers/ {

    configurationLine = $0

    #    servers { 192.168.70.1 pool.ntp.org }
    sub(/^\s+servers\s\{\s/, "", configurationLine )
    
    #192.168.70.1 pool.ntp.org }
    sub(/\s\}/, "", configurationLine)
    
    #192.168.70.1 pool.ntp.org
    split(configurationLine, ntpServerArr, /\s/)

    #["192.168.70.1", "pool.ntp.org"]
    for (iNTP in ntpServerArr) {
        ntpServers[iNTP, "ipaddress"] = ntpServerArr[iNTP]
        ntpServers[iNTP, "version"] = 4
        ntpServers[iNTP, "type"] = "N/A"
    }

}

#    timezone Europe/Stockholm
/^\s+timezone/ {

    timeZone = $2

}

END {

    #If America/Los Angeles is specified as time zone the tmsh command would not list any timezone.
    #Thus we need to set this manually if the timeZone variable is empty.
    if (timeZone == "") {
        timeZone = "America/Los Angeles"
    }
    
    writeComplexMetricStringWithLiveConfig("timezone", null, timeZone, "Timezone")
    writeComplexMetricObjectArrayWithLiveConfig("ntp-servers", null, ntpServers, "NTP Servers Defined")
    
}

cross_vendor_ntp_servers_comparison

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

import com.indeni.server.rules.RuleContext
import com.indeni.server.rules.library.SnapshotComparisonTemplateRule
import com.indeni.server.sensor.models.managementprocess.alerts.dto.AlertSeverity

/**
  *
  */
case class cross_vendor_ntp_servers_comparison(context: RuleContext) extends SnapshotComparisonTemplateRule(context,
  ruleName = "cross_vendor_ntp_servers_comparison",
  ruleFriendlyName = "Clustered Devices: NTP servers used do not match across cluster members",
  ruleDescription = "Indeni will identify when two devices are part of a cluster and alert if the NTP servers they are using are different.",
  severity = AlertSeverity.WARN,
  metricName = "ntp-servers",
  isArray = true,
  alertDescription = "Devices that are part of a cluster must have the same NTP servers used. Review the differences below.",
  baseRemediationText = "Review the NTP configuration on each device to ensure they match.")()