VMware SD-WAN モニタリング

最終更新日: 26 年 2024 月 XNUMX 日

LogicMonitor の VMware SD-WAN 監視パッケージは、VMware SD-WAN Orchestration API (正式には VMware SD-WAN™ by VeloCloud®) を利用して、重要なエッジの健全性とパフォーマンスのメトリクスを監視し、アラートを送信します。

VMware SD-WAN Orchestration API の詳細については、VMware の次のドキュメントを参照してください。

互換性

2024 年 4.2 月の時点で、LogicMonitor の VMware SD-WAN パッケージは VCO バージョン 5.4 ~ XNUMX と互換性があることが知られています。

要件

  • コレクター バージョン 32.400 以降
  • VMware Orchestrator ポータル名と API トークン
    VMware SD-WAN API トークンのセットアップの詳細については、「VMware SD-WAN API トークン」を参照してください。 VMware SD-WAN 管理ガイド
  • LogicMonitor_Collector_Snippets DataSource をインポートして、コレクターがこの監視スイートのコードをサポートしていることを確認するか、EA Collector 32.100 以降に更新します。

モニタリングにリソースを追加する

VMware SD-WAN リソースを監視にオンボードするには、次の方法を使用できます。

Note: NetScan は、system.sysname と system.displayname を調べて、重複するデバイスを識別しようとします。重複したリソースが作成されないようにするには、SNMP を有効にするか、system.displayname をデバイス名に設定する必要があります。

  1. あなたの中で ロジックモニターポータル > モジュール > 応募者と、VMware SD-WAN モジュールをインストールします。 
  2. MFAデバイスに移動する  リソース > Add > 複数のデバイス > 高度なネットスキャン.
      高度な NetScan を追加する ページが表示されます。
  3. この NetScan に関連付ける名前を入力します。たとえば、「VMware SD-WAN デバイス」です。
  4. NetScan を実行するコレクタを選択します。
    詳細については、を参照してください。 コレクターの割り当て in 強化されたスクリプト ネットスキャン.
  5. 選択 強化されたスクリプト NetScan   方法 ドロップダウンリスト。
  6. 「拡張スクリプト」セクションから、次を選択します。 デバイスの資格情報 > このスキャンにカスタム資格情報を使用する.
  7. NetScan に必要な VMware SD-WAN 認証情報を提供する次のプロパティを追加し、NetScan がリソースを作成および編成する方法と場所を変更します。
プロパティ必須
vmware.sdwan.orchestrator.hostVMware Orchestrator のそれぞれのポータルをフォーマットする必要があります vcoX.velocloud.net.有り
vmware.sdwan.keyVMware オーケストレーター API トークン。詳細については、「~」を参照してください。 APIトークン.有り
vmware.sdwan.enterprise.idVMware エンタープライズ ID。有り
vmware.sdwan.フォルダ.名この NetScan が作成するか、すでに存在する場合は使用する LogicMonitor リソース グループの名前。値は、ネストされた子フォルダー (フォルダー/フォルダー/フォルダーなど) にすることができます。これはデフォルトで「VMware SDWAN」になります。動的デバイス グループは NetScans によって追加されないため、これを動的デバイス グループに割り当てるべきではありません。詳細については、「」を参照してください。 デバイスグループの概要いいえ
vmware.sdwan.collector新しく追加されたデバイスに使用されるコレクター ID。いいえ
スキップ.device.dedupeデバイスの重複排除チェックをスキップできるため、LogicMonitor API 認証情報が不要になります。いいえ
lmaccess.id 
or
ロジックモニター.アクセス.id
ポータルにリソースを追加する前に NetScan で重複リソースを検索するための LogicMonitor API アクセス ID。 ポータル監視の詳細については、次を参照してください。 LogicMonitorポータルモニタリング.有り
注: Skip.device.dedupe が true に設定されている場合にのみ必要です
lmaccess.key
or
ロジックモニター.アクセス.キー
ポータルにリソースを追加する前に NetScan で重複リソースを検索するための LogicMonitor API キー。 ポータル監視の詳細については、次を参照してください。 LogicMonitorポータルモニタリング.有り
注: Skip.device.dedupe が true に設定されている場合にのみ必要です
ホスト名.ソースNetScan で使用されるホスト名のソースを選択できます。 これは、既存のリソースに競合が見つかった場合に、重複したデバイスの作成を防ぐのに役立ちます。 詳細については、「」を参照してください。 NetScan のトラブルシューティング.いいえ

注: 追加のフィルターを設定して、特定の VM を検出から除外することができます。これらのフィルターは、Active Discovery フィルターと同じように動作します。次のデバイス レベルのプロパティが自動的に検出され、フィルタリングできます。デバイスの追加を除外するには、次のいずれかのプロパティでフィルターを設定し、「等しくない」を選択します。

プロパティ
vmware.sdwan.edge.logical.idVMware Edge論理ID
vmware.sdwan.edge.nameVMware エッジ名
vmware.sdwan.serial.番号VMware Edge のシリアル番号
  1. 「Groovy スクリプトを埋め込む」を選択し、次のスクリプトを埋め込みます。

警告: スクリプトを編集しないでください。編集された拡張スクリプト NetScan はサポートされていません。 LogicMonitor が提供するスクリプトを編集した場合、問題が発生した場合、LogicMonitor サポートはサポートされているスクリプトで編集内容を上書きするよう要求する場合があります。

/*******************************************************************************
 * © 2007-2024 - LogicMonitor, Inc. All rights reserved.
 ******************************************************************************/

import com.logicmonitor.common.sse.utils.GroovyScriptHelper as GSH
import com.logicmonitor.mod.Snippets
import com.santaba.agent.AgentVersion
import java.text.DecimalFormat
import groovy.json.JsonOutput
import groovy.json.JsonSlurper


// To run in debug mode, set to true
Boolean debug = false

// Set props object based on whether or not we are running inside a netscan or debug console
def props
try {
    hostProps.get("system.hostname")
    props = hostProps
    debug = true  // set debug to true so that we can ensure we do not print sensitive properties
}
catch (MissingPropertyException) {
    props = netscanProps
}

// Import any needed credentials or properties that have been set in the UI
// Required properties
def key = props.get("vmware.sdwan.key")
def orchestratorHost = props.get("vmware.sdwan.orchestrator.host")
def enterpriseId = props.get("vmware.sdwan.enterprise.id")

// Optional properties
def rootFolder = props.get("vmware.sdwan.folder.name") ?: "VMware SD-WAN"
def collectorId = props.get("vmware.sdwan.collector")

Boolean skipDeviceDedupe = props.get("skip.device.dedupe", "false").toBoolean()
String hostnameSource = props.get("hostname.source", "")?.toLowerCase()?.trim()

// Retrieve the collector version
Integer collectorVersion = AgentVersion.AGENT_VERSION.toInteger()

// Bail out early if we don't have the correct minimum collector version to ensure netscan runs properly
if (collectorVersion < 32400) {
    def formattedVer = new DecimalFormat("00.000").format(collectorVersion / 1000)
    throw new Exception(" Upgrade collector running netscan to 32.400 or higher to run full featured enhanced script netscan. Currently running version ${formattedVer}.")
}

// Bail out early if we don't have the necessary credentials
if (!key) {
    throw new Exception("Must provide credentials to run this script.  Verify necessary credentials have been provided in NetScan properties.")
}

// Bail out early if we don't have the necessary properties
if (!orchestratorHost || !enterpriseId) {
    throw new Exception("Must provide vmware.sdwan.orchestrator.host and vmware.sdwan.enterprise.id to run this script.  Verify necessary properties have been provided in NetScan properties.")
}

def logCacheContext = "vmware-sdwan"
def modLoader = GSH.getInstance()._getScript("Snippets", Snippets.getLoader()).withBinding(getBinding())
def debugSnip = modLoader.load("lm.debug", "1").debugSnippetFactory(out, debug, false, logCacheContext)
def lmEmit = modLoader.load("lm.emit", "1")
def http = modLoader.load("proto.http", "0").httpSnippetFactory(props)
def VMwareSnippet = modLoader.load("vmware.sdwan", "0").vmwareSdwanSnippetFactory(props, debugSnip, http)

// Only initialize lmApi snippet class if customer has not opted out
def lmApi
if (!skipDeviceDedupe) {
    def lmApiSnippet = modLoader.load("lm.api", "0")
    lmApi = lmApiSnippet.lmApiSnippetFactory(props, http, debugSnip)
}

Map sensitiveProps = [
        "vmware.sdwan.key": key,
]

// Get information about devices that already exist in LM portal
List fields = ["name", "currentCollectorId", "displayName", "systemProperties"]
Map args = ["size": 1000, "fields": fields.join(",")]
def lmDevices
// But first determine if the portal size is within a range that allows us to get all devices at once
def pathFlag, portalInfo, timeLimitSec, timeLimitMs
if (!skipDeviceDedupe) {
    portalInfo = lmApi.apiCallInfo("Devices", args)
    timeLimitSec = props.get("lmapi.timelimit.sec", "60").toInteger()
    timeLimitMs = (timeLimitSec) ? Math.min(Math.max(timeLimitSec, 30), 120) * 1000 : 60000
    // Allow range 30-120 sec if configured; default to 60 sec
    if (portalInfo.timeEstimateMs > timeLimitMs) {
        debugSnip.LMDebugPrint("Estimate indicates LM API calls would take longer than time limit configured.  Proceeding with individual queries by display name for each device to add.")
        debugSnip.LMDebugPrint("\t${portalInfo}\n\tNOTE:  Time limit is set to ${timeLimitSec} seconds.  Adjust this limit by setting the property lmapi.timelimit.sec.  Max 120 seconds, min 30 seconds.")
        pathFlag = "ind"
    } else {
        debugSnip.LMDebugPrint("Response time indicates LM API calls will complete in a reasonable time range.  Proceeding to collect info on all devices to cross reference and prevent duplicate device creation.\n\t${portalInfo}")
        pathFlag = "all"
        lmDevices = lmApi.getPortalDevices(args)
    }
}

Map lmDevicesByName
if (pathFlag == "all" && !skipDeviceDedupe) {
    // VMware does not provide individual IP addresses, check dedupe by device name
    lmDevicesByName = lmDevices?.collectEntries { device ->
        def sysName = device?.systemProperties?.find { it -> it?.name == "system.sysname" }?.value
        def displayName = device?.systemProperties?.find { it -> it?.name == "system.displayname" }?.value
        [
                ("${sysName ?: displayName}".toString().toLowerCase()): [
                        "name"              : "${device.name}",
                        "displayName"       : (device.displayName),
                        "currentCollectorId": (device.currentCollectorId),
                        "sysName"           : (sysName)
                ]
        ]
    }
}

// Get your data and build your list of resources
List<Map> resources = []

def now = new Date()
def dateFormat = "yyyy-MM-dd'T'HH:mm:ss.s z"
TimeZone tz = TimeZone.getDefault()
Map duplicateResources = [
        "date"     : now.format(dateFormat, tz),
        "message"  : "Duplicate display names found within LogicMonitor portal wherein hostname in LM does not match hostname in Netscan output.  Refer to documentation for how to resolve name collisions using 'hostname.source' netscan property.",
        "total"    : 0,
        "resources": []
]

def edges = VMwareSnippet.setupRequestV1("enterprise/getEnterpriseEdges", enterpriseId)
edges?.each { device ->
    String hostName = device.name
    String displayName = device.name
    String displayNameToCheck = "${displayName}".toString().toLowerCase()

    // Check for existing device in LM portal with this displayName; set to false initially and update to true when dupe found
    def deviceMatch = false
    //  If customer has opted out of device deduplication checks, we skip the lookups where we determine if a match exists and proceed as false
    if (!skipDeviceDedupe) {
        if (pathFlag == "ind") {
            deviceMatch = lmApi.findPortalDeviceByProperty(hostName, args)
        } else if (pathFlag == "all") {
            deviceMatch = lmDevicesByName?.get(displayNameToCheck)
        }
    }

    if (deviceMatch) {
        // Log duplicates that would cause additional devices to be created; unless these entries are resolved, they will not be added to resources for netscan output
        if (deviceMatch.name.toString().toLowerCase() != displayNameToCheck) {
            def collisionInfo = [
                    (hostName): [
                            "Netscan" : [
                                    "hostname": hostName
                            ],
                            "LM"      : [
                                    "hostname"   : deviceMatch.name,
                                    "collectorId": deviceMatch.currentCollectorId
                            ],
                            "Resolved": false
                    ]
            ]

            // If user specified to use LM hostname on display name match, update hostname variable accordingly
            // and flag it as no longer a match since we have resolved the collision with user's input
            if (hostnameSource == "lm" || hostnameSource == "logicmonitor") {
                hostName = deviceMatch.name
                collectorId = deviceMatch.currentCollectorId
                displayName = deviceMatch.displayName
                deviceMatch = false
                collisionInfo[hostName]["Resolved"] = true
            }
            // If user specified to use netscan data for hostname, update the display name to make it unique
            // and flag it as no longer a match since we have resolved the collision with user's input
            else if (hostnameSource == "netscan") {
                // Update the resolved status before we change the displayName
                collisionInfo[hostName]["Resolved"] = true
                displayName = "${displayName - deviceMatch.name}"
                deviceMatch = false
            }

            duplicateResources["resources"].add(collisionInfo)
        }
        // Don't worry about matches where the hostname values are the same
        // These will update via normal NetScan processing and should be ignored
        else {
            deviceMatch = false
        }
    }

    List groupName = ["${rootFolder}"]

    def deviceProps = [
            "vmware.sdwan.orchestrator.host": orchestratorHost,
            "vmware.sdwan.edge.logical.id"  : device.logicalId,
            "vmware.sdwan.edge.name"        : device.name,
            "vmware.sdwan.serial.number"    : device.serialNumber,
            "vmware.sdwan.enterprise.id"    : enterpriseId
    ]

    deviceProps.putAll(sensitiveProps)

    Map resource = [
            "hostname"   : hostName,    // String
            "displayname": displayName,    // String
            "hostProps"  : deviceProps, // Map<String, String>
            "groupName"  : groupName,   // List<String>
    ]

    // Only add the collectorId field to resource map if we found a collector ID above
    if (collectorId) {
        resource["collectorId"] = collectorId
        if (duplicateResources["resources"][hostName]["Netscan"]) {
            duplicateResources["resources"][hostName]["Netscan"][0]["collectorId"] = collectorId
        }
    }

    if (!deviceMatch) {
        resources.add(resource)
    }
}

// Output validated data in JSON format
// If errors have been made in acceptable/required keys, lm.emit will throw and inform the user
lmEmit.sanitizeResourceSensitiveProperties(resources, debug)
lmEmit.resource(resources)

// Report devices that already exist in LM via log file named after root folder
if (duplicateResources["resources"].size() > 0) {
    def netscanDupLog = new File("../logs/NetscanDuplicates/${rootFolder.replaceAll(" ", "_")}.json")
    new File(netscanDupLog.getParent()).mkdirs()
    duplicateResources["total"] = duplicateResources["resources"].size()
    def json = JsonOutput.prettyPrint(JsonOutput.toJson(duplicateResources))
    netscanDupLog.write(json)
    if (hostnameSource) {
        debugSnip.LMDebug("${duplicateResources["resources"].size()} devices found that were resolved with hostname.source=${hostnameSource} in netscan output.  See LogicMonitor/Agent/logs/NetscanDuplicates/${rootFolder.replaceAll(" ", "_")}.json for details.")
    } else {
        debugSnip.LMDebug("${duplicateResources["resources"].size()} devices found that were not reported in netscan output.  See LogicMonitor/Agent/logs/NetscanDuplicates/${rootFolder.replaceAll(" ", "_")}.json for details.")
    }
}

return 0
  1. 「スケジュール」セクションで、「この NetScan をスケジュールに従って実行する」を選択します。動的環境の場合、NetScan を 1 時間ごとに実行するようにスケジュールできます。
  2. 選択 Save or 保存して実行.

NetScan を実行した後、追加されたリソースの数、または NetScan がリソースを作成しない場合はエラー メッセージの履歴を確認します。

リソースを手動で追加する

  1. VMware SD-WAN 組織デバイス グループを作成します。詳細については、「」を参照してください。 デバイスグループの追加.
  2. デバイスを VMware 組織グループに追加します。
  3. 次のプロパティがリソース上または VMware SD-WAN 組織リソース グループの下に設定されていることを追加または確認します。プロパティの設定の詳細については、を参照してください。 リソースとインスタンスのプロパティ.
プロパティ
vmware.sdwan.orchestrator.hostVMware Orchestrator のそれぞれのポータルをフォーマットする必要があります vcoX.velocloud.net.
vmware.sdwan.keyVMware オーケストレーター API トークン。詳細については、以下を参照してください。 APIトークン.
system.sysname または
vmware.sdwan.edge.name または
vmware.sdwan.edge.logical.id または
システム.表示名
system.displayname が VMware で定義されたデバイス名に設定されている場合、または SNMP が有効になっている場合、デバイスを特定できます。 SNMP が有効になっていない場合、または system.display 名が VMware で定義されたデバイス名に設定されていない場合は、エッジ論理 ID またはデバイス名を追加します。
vmware.sdwan.enterprise.idVMware エンタープライズ ID。

LogicModulesのインポート

LogicMonitor パブリック リポジトリから、すべての VMware SD-WAN LogicModule をインポートします。これらの LogicModule がすでに存在する場合は、最新バージョンであることを確認してください。

LogicModule がインポートされると (以前のセットアップ要件がすべて満たされていると仮定して)、データ収集が自動的に開始されます。モジュールのインポートの詳細については、を参照してください。 LMエクスチェンジ.

NetScan のトラブルシューティング

このスイートの NetScan は、ポータル内の既存のデバイスを更新して、WMware の API から取得した関連情報を追加できます。表示名は同じだが system.hostname の値が異なるという競合が存在する場合、NetScan はポータル内に重複したデバイスを作成することもできます。デバイスが適切に更新され、重複したデバイスが作成されないように、この NetScan は LogicMonitor の API を使用して既存のデバイスをクエリし、検出された名前の競合を報告します。コレクター ログ内のファイルにアクセスできます。詳細については、を参照してください。 コレクターログ–LogicMonitorへのログの送信.

NetScan がプロパティで構成されていない限り、レポート内のデバイスは NetScan 出力の一部として LogicMonitor に報告されません。 hostname.source。 このプロパティを使用すると、ユーザーは、NetScan 出力で使用されるホスト名のソースを選択することによって、検出された名前の競合を解決できます。 考えられる XNUMX つのホスト名ソースは、次の値によって決まります。

  • 「lm」または「logicmonitor」 名前が競合しているデバイスは、LogicMonitor の既存の system.hostname を使用して、ポータル内のデバイスが NetScan を使用して更新されるようにします。 この設定では新しいデバイスは作成されません。
  • 「netscan」 名前が競合しているデバイスは、NetScan スクリプトで決定された system.hostname を維持し、追加するように報告された表示名を更新します。 - <system.hostname> 一意であり、ポータルに追加できることを確認するためです。 このオプションは、厳密な命名規則がなく、同じ表示名を持つ複数のデバイスがある場合に役立ちます。

注:NetScan は system.hostname の値を更新できませんが、表示名、カスタム プロパティ、およびグループ割り当てを更新する可能性があります。

パッケージ内のLogicModules

LogicMonitor の VMware SD-WAN 用パッケージは、次の LogicModule で構成されています。完全にカバーするには、次のすべての LogicModule が LogicMonitor プラットフォームにインポートされていることを確認してください。

表示名タイプ説明
VMware_SDWAN_BGP_SessionsデータソースVMware SD-WAN Edge の BGP セッションを監視します。
VMware SDWAN の健全性データソースVMware SDWAN の健全性を監視します。
VMware SDWAN インターフェイスデータソースVMware SD-WAN Edge の WAN インターフェイスを監視します。
VMware SDWAN のパフォーマンスデータソースVMware SDWAN パフォーマンスを監視します
VMware SDWAN トンネルデータソースVMware SD-WAN EdgeのWANトンネルを監視します。
VMware_SDWAN_トポロジトポロジーソースVMware SD-WAN トポロジを生成します。
VMware SDWAN アラートログソースVMware SD-WAN デバイスのログを提供します。
addCategory_VMwareSDWANプロパティソースシステム カテゴリ VMwareSDWANEdge と、関連するデバイス情報を含む自動プロパティを追加します。
addERI_VMware_SDWANプロパティソースVMware SDWAN リソースの ERI を検出して追加します。

このパッケージの DataSource によって追跡されるさまざまなメトリクスに静的なデータポイントのしきい値を設定する場合、LogicMonitor はテクノロジー所有者のベスト プラクティス KPI 推奨事項に従います。

おすすめ: 必要に応じて、環境固有のニーズを満たすようにこれらの事前定義されたしきい値を調整します。データポイントのしきい値の調整の詳細については、「データポイントの静的しきい値のチューニング」を参照してください。

記事上で