ADC

Custom SNMP OIDs

Starting from NetScaler version 14.1-38.x, you can dynamically expose a counter to SNMP and use it for monitoring and managing network devices on your own.

Create a YAML file custom_get.yaml

The subagent running on the device under test (DUT) picks the YAML file custom_get.yaml and registers the Object ID (OID) corresponding to each counter to the main agent. When the registration is done, the SNMP framework is ready to respond to the query for the newly registered OIDs.

OIDs from 1.3.6.1.4.1.5951.1.1.1.1 to 1.3.6.1.4.1.5951.1.1.1.100 are reserved as the custom SNMP OIDs of the SNMP query.

The custom_get.yaml file has the following format:

CNTR_1:
Counter: nic_tot_tx_bytes
Description: platformRateLimitPktDrop
OID: 1.3.6.1.4.1.5951.1.1.1.1
Type: int
partitionid: 0
entityname: '1/1'
entitytype: 'interface'
CNTR_2:
Counter: nic_tot_tx_bytes
Description: tcpSWChecksumDone
OID: 1.3.6.1.4.1.5951.1.1.1.2
Type: int
partitionid: 3
entityname: 'LO/1'
entitytype: 'interface'
<!--NeedCopy-->

Each counter in the custom_get.yaml file has the following fields:

Field Description Permissible value
Counter Unique name of the NetScaler counter. For a list of common NetScaler counters, see the NetScaler ‘Counters’ Grab-Bag! blog. This field is mandatory.  
Description Description of the counter without any whitespaces. This field is mandatory.  
OID Unique object identifier. Must be from the range 1.3.6.1.4.1.5951.1.1.1.1 to 1.3.6.1.4.1.5951.1.1.1.100
Type The value must be int. int
partitionid Routing partition for those counters which are partition specific.  
entityname Name of the NetScaler entity associated with the counter. ’’ if there is an empty value.
entitytype Type of the NetScaler entity associated with the counter. ’’ if there is an empty value.

Configure NetScaler for custom SNMP OIDs

  1. Place custom_get.yaml in the /nsconfig folder.

  2. Start the subagent by running the following command on the NetScaler shell prompt:

    python3 /netscaler/custom_snmpd.py SUBAGENT-START

  3. Verify that a subagent is running on NetScaler using the following command on the NetScaler shell prompt:

    ps -aux | grep sub root 1931 18.3 1.3 56596 46412 - S 05:08 0:01.39 /var/python/bin/python3 /var/python/bin/snmpdsubagent START (python3.9)

  4. From SNMP manager, run the snmpwalk command on the newly registered OIDs to retrieve the relevant data.

  5. If you edit the YAML file, then restart the subagent by using the following command:

    python3 /netscaler/custom_snmpd.py SUBAGENT-RESTART

  6. To stop the subagent from responding to custom OIDs, run the following command:

    python3 /netscaler/custom_snmpd.py SUBAGENT-STOP

Custom SNMP OIDs