This section introduces how to create an SNMP parser to extract key metrics of device data with OIDs.
Example: Parse the free and used memory of a Cisco Router with the corresponding OIDs.
1.Click the icon on the taskbar and select New Parser.
2.Keep the default Legacy Device node type and select Cisco Router from the Device Type list. By default, the All Device Types option is selected.
Tip: The system also supports defining a parser to retrieve and parse SDN data through APIs. See Creating an API Parser to get details about API parser.
3.Select SNMP from the Parser Type drop-down menu.
4.Select an SNMP method (SNMPGet in this sample) from the drop-down menu.
5.Enter the following two OIDS in the command field and separate them with ||.
▪Free memory OID: 1.3.6.1.4.1.9.9.48.1.1.1.6.1
▪Used memory OID: 1.3.6.1.4.1.9.9.48.1.1.1.5.1
Note: Only the SNMP method SNMPGet supports multiple OID inputs while SNMPWalk and SDNMPTable supports single OID.
6.Highlight the free memory value exactly in the sample data and click Define Keyword in the floating menu.
7.The Keyword Parser dialog prompts with the following fields auto-identified. Click Save Variable.
▪Sample — the sample command line where the variable stays.
▪Parser — defines keywords and where a variable is located. The keyword parser GAUGE32: $int:var1$ is created automatically. To locate the variable exactly and differentiate it with the used memory value, modify the parser to 1.3.6.1.4.1.9.9.48.1.1.1.6.1 = GAUGE32: $int:var1$. It contains the keyword 1.3.6.1.4.1.9.9.48.1.1.1.6.1 = GAUGE32: that always stays the same, and the variable $var1 that varies in different devices.
▪Variable — the variable defined in the parser. To change the auto-created variable name to a more meaningful name, rename the variable such as from var1 to free_memory.
8.Highlight the used memory value exactly in the sample data, and then follow the step 6 to 8 to add the variable used_memroy. The free_memory and used_memory variables are both displayed in the variable tree.
Note: In the Parser field of the Keyword Parser dialog, modify the default parser to 1.3.6.1.4.1.9.9.48.1.1.1.5.1 = GAUGE32: $int:var1$, and rename the variable name as used_memory.
9.Click Save on the upper right corner of the page. The parser will be saved in the Parser Library.
Note: SNMP Parser has two special built-in SNMP parameters: $cpu_oid and $mem_oid, which represents the CPU and memory usage of a device respectively. When you use these two parameters in the command field, select a device to retrieve data, the system will automatically to get the CPU usage and memory usage by looking up the corresponding OID of the device in the domain, without having to input them manually.
See also: