-
Notifications
You must be signed in to change notification settings - Fork 56
Example: Configuring Cisco Catalyst Switch
This example will show up how to configure a Cisco Catalyst on snmpcollector
In order to select the correct metrics for our device, we must check first what model it is. If you don't know the model, you can pre-add the device on SNMP Device Component and do a test connection. To do that:
- Click on
SNMP Device
menu item - A table with configured devices will show up. Press "New" button or edit an existing one to access to the configuration form.
- Fill the device with the basic connection information
- If everything is OK, you will be able to do a "Test Connection". This button will show up a console with System information of the Device.
The first step is selecting what metrics we want to collect. For this we can check for Cisco docs and defined MIBs like:
In this example, we are going to collect the following metrics to provide basic interface and performance status of our switch.
- Basic Metrics
Metric Name | MIB | OID | Indexed |
---|---|---|---|
ifHCInOctets | IF-MIB | .1.3.6.1.2.1.31.1.1.1.6 | ifName |
ifHCOutOctets | IF-MIB | .1.3.6.1.2.1.31.1.1.1.10 | ifName |
ifHighSpeed | IF-MIB | .1.3.6.1.2.1.31.1.1.1.15 | ifName |
ifAlias | IF-MIB | .1.3.6.1.2.1.31.1.1.1.18 | ifName |
ciscoMemoryPoolUsed | CISCO-MEMORY-POOL-MIB | .1.3.6.1.4.1.9.9.48.1.1.1.5 | ciscoMemoryPoolName |
ciscoMemoryPoolFree | CISCO-MEMORY-POOL-MIB | .1.3.6.1.4.1.9.9.48.1.1.1.6 | ciscoMemoryPoolName |
cpmCPUTotal1minRev | CISCO-MEMORY-POOL-MIB | .1.3.6.1.4.1.9.9.109.1.1.1.1.7 | cpmCPUTotalPhysicalIndex (depending on model) |
ℹ️ Basic Metrics table
In order to give more generic information, we will define the following extended metrics. On the next point we will see how to configure them.
- Extended Metrics
Metric Name | Formula | Indexed |
---|---|---|
InputUtilization | ((ifHCInOctets * 8)/(ifHighSpeed * 1000000)) * 100 | .1.3.6.1.2.1.31.1.1.1.10 |
OutputUtilization | ((ifHCOutOctets * 8)/(ifHighSpeed * 1000000)) * 100 | .1.3.6.1.2.1.31.1.1.1.10 |
ciscoMemoryPool_utilization_percent | (ciscoMemoryPoolUsed/ciscoMemoryPoolFree+ciscoMemoryPoolUsed) * 100 | .1.3.6.1.2.1.31.1.1.1.15 |
ℹ️ Extended Metric table
Once we have defined our metrics its time to configure them on our SNMPCollector Instance:
- Click on
SNMP Metric
menu item - Click
+New
button. The metric form will show up.
Notes:
- On
Counter32/64
metric type you can defineCOUNTER32/64
as DataSrcType, which computes the difference between iterations. It only works with really counter behaivour. -
IsTag
option allows to set the value as tag. The tag key will be defined asField Name
-
GetRate
option only works whenCOUNTERNN
as DataSrcType. It divides the result of the computed difference by the elapsed time between polls. - Remember that you can always test your OIDs on SNMP Console from our pre-added SNMP Device
Recomendations:
- In order to identify all your components IDs, we recommend you to set some prefix when you are configuring them. This will allow to find faster and set up devices easier. In this example, if.* Metrics are coming from a MIB that can be shared for more than one device type. For the CPU/Mem metrics, we will use the prefix
Cisco_Catalyst
ID | Field Name | IsTag | DataSrcType | GetRate | Base OID/Extradata | Scale | Shift |
---|---|---|---|---|---|---|---|
ifHCInOctets | ifHCInOctets | false | COUNTER64 | true | .1.3.6.1.2.1.31.1.1.1.6 | 0 | 0 |
ifHCOutOctets | ifHCOutOctets | false | COUNTER64 | true | .1.3.6.1.2.1.31.1.1.1.10 | 0 | 0 |
ifHighSpeed | ifHighSpeed | false | Gauge32 | true | .1.3.6.1.2.1.31.1.1.1.15 | 0 | 0 |
ifAlias | ifAlias | true | OCTETSTRNG | -- | .1.3.6.1.2.1.31.1.1.1.18 | 0 | 0 |
Cisco_Catalyst_ciscoMemoryPoolUsed | memUsed | false | Gauge32 | -- | .1.3.6.1.4.1.9.9.48.1.1.1.5 | 0 | 0 |
Cisco_Catalyst_ciscoMemoryPoolFree | memFree | false | Gauge32 | -- | .1.3.6.1.4.1.9.9.48.1.1.1.6 | 0 | 0 |
Cisco_Catalyst_cpmCPUTotal1minRev | cpuUsed | false | Gauge32 | -- | .1.3.6.1.4.1.9.9.109.1.1.1.1.7 | 0 | 0 |
ℹ️ SNMP Basic Metrics configuration
Once you get all your basic metrics, it is time to configure the extended ones:
ID | Field Name | IsTag | DataSrcType | GetRate | Base OID/Extradata | Scale | Shift |
---|---|---|---|---|---|---|---|
InputUtilization | InputUtilization | false | STRINGEVAL | -- | ((ifHCInOctets * 8)/(ifHighSpeed * 1000000)) * 100 | 0 | 0 |
OutputUtilization | OutputUtilization | false | STRINGEVAL | -- | ((ifHCOutOctets * 8)/(ifHighSpeed * 1000000)) * 100 | 0 | 0 |
Cisco_ciscoMemoryPool_utilization_percent | memUtilization | false | STRINGEVAL | -- | (ciscoMemoryPoolUsed/ciscoMemoryPoolFree+ciscoMemoryPoolUsed) * 100 | 0 | 0 |
ℹ️ SNMP Extended Metrics configuration
Once we have our metrics configured, its time to define where and how we want to store them in InfluxDB data structure: measurements.
Recomendations:
- If a collection of metrics are defined with the same index OID, try to set up them on the same measurement. This will reduce the number of walks to create the indexes and filterings rules.
- Try to define the measurement name with a easy identifier to make configuring the devices easier for you.
- If you are going to define metrics with 'nonZero' report, remember that if the metric is not already defined on InfluxDB you won't be able to query it. We recommend you to create the metrics for few minutes and then change the report status to desired
nonZero
.
To create a measurement:
- Click on Measurement menu item
- Click
+New
button. The measurement form will show up.
The following metrics have the same index on the table and are coming from the same MIB, so we create a new measurement with ifMIB basic + extended metrics.
In our example, we are only interested of computed metrics, so, we need set the right report status of each one:
_Notes_:
- As the defined extended metrics are computed, we need to add relational needed metrics on the same measurement.
We define the Cisco_ifMIB_Basics measurement which will group all metrics. Remember that they are indexed with the name of the interfaces, so we need to set up like this:
ID | Name | GetMode | Index OID | Tag OID | Index Tag | Index Tag Format | Index as Value | Metric Fields |
---|---|---|---|---|---|---|---|---|
Cisco_ifMIB_Basics | cisco_ifMib_basics | indexed | .1.3.6.1.2.1.2.2.1.2 | -- | portName | -- | false |
#BASICS:
|
ℹ️ ifMIB Measurement configuration
Let's configure the Cisco Memory measurement. As we did on the ifMIB metrics, we need to have clear what metrics are we going to send. In our case, we are interested on send only the % usage of the Memory, so:
So we create the new Measurement with the following configuration:
ID | Name | GetMode | Index OID | Tag OID | Index Tag | Index Tag Format | Index as Value | Metric Fields |
---|---|---|---|---|---|---|---|---|
Cisco_Catalyst_ciscoMemoryPool | cisco_catalyst_ciscoMemoryPool | indexed | .1.3.6.1.4.1.9.9.48.1.1.1.2 | -- | memIndex | -- | false |
#BASICS:
|
ℹ️ Cisco Memory Measurement configuration
Our last measurement: Cisco CPU. This OID is indexed by a double index:
In order to identify the physical entity to which these values correspond, we must poll the following MIB Object : cpmCPUTotalPhysicalIndex:
MIB Object | OID | Description |
---|---|---|
cpmCPUTotalPhysicalIndex | 1.3.6.1.4.1.9.9.109.1.1.1.1.2 | Returns the index assigned on entPhysicalName |
ℹ️ cpmCPUTotalPhysicalIndex MIB Object
With those values we can get the assigned name of each CPU Module from the following OID:MIB Object | OID | Description |
---|---|---|
entPhysicalName | 1.3.6.1.2.1.47.1.1.1.1.7 | Returns the name of each CPU Module |
ℹ️ entPhysicialName MIB Object
Once we get our double indexed resolved we can configure our measurement... but before that, we must check out what would happen if the CPU Module are set up with the same name? The SNMPCollector will create 2 points with the same tag/field set, so it will only send 1 value!
In order to solve that, we can add an Index Tag Format
. The SNMP Collector generates the following vars each time it does an Indexing operation:
-
IndexOID
returns$IDX1
and$VAL1
-
Tag OID
returns$IDX2
and$VAL2
So to distinguish some CPU with the same name we must set up the Index Tag Format
with $VAL2 - $IDX1
.
i.e: Tag set : CPU Module 1 - 8
-
$VAL2 = CPU Module 1
is the result of the entPhysicalName poll -
$IDX1 = 8
is the index of entry table.
With all cases checked, we can finally add our measurement:
ID | Name | GetMode | Index OID | Tag OID | Index Tag | Index Tag Format | Index as Value | Metric Fields |
---|---|---|---|---|---|---|---|---|
Cisco_Catalyst_CiscoProcessMIB | cisco_catalyst_ciscoProcessMib | indexed_it | .1.3.6.1.4.1.9.9.109.1.1.1.1.2 | .1.3.6.1.2.1.47.1.1.1.1.7 | physIndex | $VAL2-$IDX1 | false |
#BASICS:
|
ℹ️ Cisco CPU Measurement configuration
Now, its time to create a template for all Cisco Catalyst switches!
- Click on
Measurement
Group from menu item - Press
+New
button or edit an existing one to access to the configuration form.
Measurement Groups is a virtual group of measurements, it allows to have different templates in order to configure devices on a really easy way!
We don't have to do any especial here, we only must to set up the ID and select the different measurement that are going to be part of our template:
ID | Name |
---|---|
Cisco_Catalyst_Template_Basic |
|
ℹ️ Cisco_Catalyst_Template Measurement Group configuration
On this point we are now able to poll all data configured in our metrics. But lets do something more complex! Lets filter what do we want to send, it is time to create some OIDs Conditions!
In our example we will work with the following requirements:
- (1) We only want the interfaces with UP state
- (2) We only want the physical Eth interfaces
So the result would be translated as: we only want those that comply with the following (1) && (2)
To do that, we need to create a total of three OID conditions, lets configure all:
- Click on
OID Condtions
item on menu - Click
+New
button. The measurement form will show up.
The MIB object that returns that information is the ifOperStatus
MIB Object | OID | Description |
---|---|---|
ifOperStatus | 1.3.6.1.2.1.2.2.1.8 | Return the status of the interface: |
ℹ️ ifOperStatus MIB Object
We only want the up interfaces so numerical equal than 1
. Let's create a OID Condition with the following configuration:
ID | Is Multiple | OID | CondType | CondValue |
---|---|---|---|---|
ifOperStatus_UP | false | .1.3.6.1.2.1.2.2.1.8 | neq | 1 |
ℹ️ ifOperStatus_UP OID Condition configuration
The MIB object that returns that information is the ifType
MIB Object | OID | Description |
---|---|---|
ifType | 1.3.6.1.2.1.2.2.1.3 | The type of interface, distinguished according to the physical/link protocol |
ℹ️ ifType MIB Object
The eth are ifType = 6
, so we need to configure a new OID Condition:
ID | Is Multiple | OID | CondType | CondValue |
---|---|---|---|---|
ifType_ETH | false | .1.3.6.1.2.1.2.2.1.3 | neq | 6 |
ℹ️ ifType_ETH OID Condition configuration
### 4.3 Mutiple OID Condition: UP && ETHIn order to apply a multiple condition we need to activate the configuration flag Is Multiple
and set the field OID Condition
with the logical combination of already created ones:
ID | Is Multiple | OID Condition | CondType | CondValue |
---|---|---|---|---|
interfaces_ETH_UP | true | ifOperStatus_UP && ifType_ETH | neq | 6 |
ℹ️ interfaces_ETH_UP Multiple Condition configuration
Once we have our OID Conditions configured, lets put them on a Measurement Filter. The measurement filter is applied on measurement with Indexed/Tag OIDs.
In our case, we need to create the filter in our ifMIB measurement to only get those interfaces that are UP and are Ethernet like.
To to that, lets create a Measurement Filter:
- Click on
Measurement Filters
menu - Click
+New
button. The filter form will show up.
Lets fill our Measurement filter.
ID | Measurements | Filter Type | OID Condition |
---|---|---|---|
Cisco_ifMIB_UP_ETH | Cisco_ifMIB_Basics | OID Condition | interfaces_ETH_UP |
ℹ️ Cisco_ifMIB_UP_ETH Measurement Filter configuration
Lets do a check what we have done until now:
- We defined our core basic metrics to get performance and port statistics of our device!
- We defined 3 different measurements with complex indexes that allows to get every entry of metric objects without overlapping!
- We defined a Basic Template that allows us to configure a new device in less than 1 minute!
- We defined 3 OID Conditions and created a filter to only get ETH and UP interfaces!
So its time to add our device and attach our already created components:
Note:
- To simplfy the following configuration, we will skip connection data fields.
ID | ConnectionData | Measurement Groups | Measurement Filters |
---|---|---|---|
myCisco_Catalyst | .... | Cisco_Catalyst_Template_Basic | Cisco_ifMIB_UP_ETH |
ℹ️ Cisco SNMP Device configuration
In order to reload configuration you must click on the menu item Reload Config
. Once the SNMP Collector will receive the signal and it will try to reload all configuration. During that process you won't be able to navigate until the process is finished.
See what are you collecting from the Runtime component!
- Click on
Runtime
menu item - Find your device and check if its actived and connected. If not, check your connection data!
- Click on the eye icon and see what are you collecting!!!
You must check the Metrics Info panel:
- Check that the are our 3 defined Measurements
- Click on every measurement and check the created Metrics and its value
- Check the indexes are correct and that the filters are applied correctly on our ifMIB measurement!