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.Select the device types that the parser applies to, Cisco Router in this sample. By default, All Device Types are selected.
Tip: Click Advanced Filter and define more criteria to filter the devices that the parser applies to. See Advanced Filter for details.
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 filed 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
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.
▪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.Click Save Variable in the Keyword Parser dialog.
9.Highlight the used memory value exactly in the sample data, and then follow the step 6 to 8 to add the variable used_memroy.
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.
10. The free_memory and used_memory variables are both displayed in the variable tree.
11.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.