This topic describes how to configure Simple Network Management Protocol (SNMP) monitoring to collect device CPU utilization.
Prerequisites
Procedure
Step 1: Create a metric. For more information, see Metric Management.
Log on to the Cloud Managed Network console.
In the navigation pane on the left, click Network Monitoring > Metric Management.
Click the Create Metric button above the list and select Create Single-Device Metric.
On the Create Metric page, enter the basic information for the metric, such as Metric Name, Description, and Collection Method.
Set Metric Name to a globally unique name, such as CPU_Monitor.
Enter a description that explains the purpose of the metric for future maintenance, such as "Monitor device CPU utilization using SNMP".
Select the security domain for the metric, such as CMN-01. Probes in the selected security domain collect data from devices within that domain.
Select the device type. For example, if you select Network Device, the metric collects data from network devices in the specified security domain.
Select the SNMP collection type. The available types are get, getNext, getBulk, getWalk, and snmpwalk. For this procedure, select snmpwalk.
Enable the metric. Data is collected only when a metric is enabled.
Write the parsing code. Use the following example and modify it as needed:
/** The output collected by SNMP is in the following format. Therefore, parse data["output"]["results"]. {"output":{"results":[{"value":"22","oid":"1.3.6.1.4.1.4881.1.1.10.2.1.1.43.1.4"},{"value":"33","oid":"1.3.6.1.4.1.4881.1.1.10.2.1.1.43.1.5"}]}} **/ function parse(output){ var result = {}; var data = JSON.parse(output); if(data.output.results.length == 0){ return JSON.stringify(result); } data.output.results.forEach(function(kv,index){ var value = kv["value"]; result["cpu_"+index] = value; // Most network devices have multiple CPU modules. This code uses an index to generate data items such as cpu_0, cpu_1, and cpu_2. }); // Returns a JSON formatted string. In this example, the result is {"cpu_0":"22","cpu_1":"33"}. return JSON.stringify(result); }NoteThe Object Identifier (OID) used to collect device CPU data with SNMP is private. OIDs and output formats vary by vendor and model. Write the parsing code based on your device's actual output. The code in this example is for reference only.
(Optional) Add an alerting rule. For more information, see Metric Management.
Click the Submit button to save the metric.
Step 2: Deploy metrics. For more information, see Deploy Metrics.
In the navigation pane on the left, click Network Monitoring > Deploy Metrics.
From the drop-down list, select the metric that you created in Step 1, CPU_Monitor. You can perform a fuzzy search by metric name.
The system automatically displays a list of vendors and models. Select the checkboxes for the models that you want the metric to monitor. For example, to monitor a Juniper MX480 device, select the checkbox next to that model.
For SNMP metrics, set an OID for each vendor and model. OIDs are often private and vary by vendor. For this example with a Juniper MX480, enter 1.3.6.1.4.1.2636.3.1.13.1.8.9.
Click the Submit button to save the deployment configuration. The system sends the configuration to the probes and starts data collection.
NoteTo monitor CPU utilization on devices from other vendors or models, find the corresponding Management Information Base (MIB) for CPU data collection in the vendor's official documentation. Then, enter the OID into Cloud Managed Network.
Step 3: View the alert status. For more information, see Alert Status View.
In the navigation pane on the left, click Network Monitoring > Alert Status View.
Select a physical space from the pane on the left. The status of all collected metrics and devices in that physical space appears on the right. To view the monitoring status of a specific device or metric, enter search criteria in the search bar at the top of the page and click the Query button to filter the results.
Click the Details button to open the details page for more information.
Click the Device View button to open the device view. This page displays all monitoring data and historical trends for the specified device.