Skip to content

Component monitoring

This section covers monitoring component metrics using SNMP. I assume that you’ve completed the steps in Component modeling and now have temperature sensor components modeled for the NetBotz device. Currently there will be no graphs for these temperature sensors.

We will add collection, thresholding and graphing for the temperature monitored by each sensor.

Find the SNMP OID

In Component modeling, we used smidump and snmpwalk to find which values would be useful to model, and which would be useful to monitor. We found tempSensorValueStr to be the best OID to use for monitoring a sensor’s current temperature.

Let’s use snmpwalk again to see what tempSensorValueStr looks like for all of the sensors on our NetBotz device.

snmpwalk 172.17.0.1 NETBOTZV2-MIB::tempSensorValueStr

This gives of the current temperature (in Celsius) for each sensor:

NETBOTZV2-MIB::tempSensorValueStr.21604919 = STRING: 26.500000
NETBOTZV2-MIB::tempSensorValueStr.1095346743 = STRING: 27.000000
NETBOTZV2-MIB::tempSensorValueStr.1382714817 = STRING: 22.100000
NETBOTZV2-MIB::tempSensorValueStr.1382714818 = STRING: 21.100000
NETBOTZV2-MIB::tempSensorValueStr.1382714819 = STRING: 19.600000
NETBOTZV2-MIB::tempSensorValueStr.1382714820 = STRING: 19.900000
NETBOTZV2-MIB::tempSensorValueStr.1382714833 = STRING: 20.500000
NETBOTZV2-MIB::tempSensorValueStr.1382714834 = STRING: 20.100000
NETBOTZV2-MIB::tempSensorValueStr.1382714865 = STRING: 19.700000
NETBOTZV2-MIB::tempSensorValueStr.1382714866 = STRING: 20.500000
NETBOTZV2-MIB::tempSensorValueStr.1382714867 = STRING: 20.100000
NETBOTZV2-MIB::tempSensorValueStr.1382714868 = STRING: 20.000000
NETBOTZV2-MIB::tempSensorValueStr.2169088567 = STRING: 26.600000
NETBOTZV2-MIB::tempSensorValueStr.3242830391 = STRING: 27.400000

As we go on to add a monitoring template below, we’ll need to know what OID to poll to collect this value. The key to determining this for components with an snmpindex attribute like TemperatureSensor has is to find the OID for the values above and remove the SNMP index from the end of it. Let’s use snmptranslate to do this.

snmptranslate -On NETBOTZV2-MIB::tempSensorValueStr

This results in the following output:

.1.3.6.1.4.1.5528.100.4.1.1.1.7

This OID (minus the leading .) is what we’ll need.

Add a monitoring template

It is important to get the monitoring template’s name correct when adding a monitoring template that will be used for components. A Zenoss administrator has no control over which monitoring templates will be bound to a component like they do with monitoring templates that are bound to devices.

How do we know what to name a monitoring template that should be used to monitor our NetBotzTemperatureSensor components? By default the monitoring template should be named the same as the component class’ label property with all spaces removed. In Component modeling, we set the label for the NetBotzTemperatureSensor class to be Temperature Sensor. This means out monitoring template should be named TemperatureSensor.

If you’d rather specify the monitoring template’s name, or the names of multiple monitoring templates to use for your component class, you can do so by specifying an explicit monitoring_templates value for it in zenpack.yaml.

Perform the following steps to create our component’s monitoring template.

  1. Navigate to Advanced > Monitoring Templates.

  2. Add a template.

    1. Click the + in the bottom-left of the template list.
    2. Set Name to TemperatureSensor.
    3. Set Template Path to /NetBotz.
    4. Click SUBMIT.
  3. Add a data source.

    1. Click the + at the top of the Data Sources panel.
    2. Set Name to tempSensorValueStr.
    3. Set Type to SNMP.
    4. Click SUBMIT.
    5. Double-click to edit the tempSensorValueStr data source.
    6. Set OID to 1.3.6.1.4.1.5528.100.4.1.1.1.7
    7. Click SAVE.
  4. Add a threshold.

    1. Click the + at the top of the Thresholds panel.
    2. Set Name to high temperature.
    3. Set Type to MinMaxThreshold.
    4. Click ADD.
    5. Double-click to edit the high temperature threshold.
    6. Move the datapoint to the list on the right.
    7. Set Maximum Value to 32.
    8. Set Event Class to /Environ.
    9. Click SAVE.
  5. Add a graph.

    1. Click the + at the top of the Graph Definitions panel.
    2. Set Name to Temperature.
    3. Click SUBMIT.
    4. Double-click to edit the Temperature graph.
    5. Set Units to degrees c.
    6. Click SUBMIT.
  6. Add a graph point.

    1. Click to select the Temperature graph.
    2. Choose Manage Graph Points from the gear menu.
    3. Choose Data Point from the + menu.
    4. Choose tempSensorValueStr then click SUBMIT.
    5. Double-click to edit the tempSensorValueStr graph point.
    6. Set Name to Temperature.
    7. Set Format to %7.2lf.
    8. Click SAVE then SAVE again.

You can also define monitoring templates in zenpack.yaml instead of creating them through the web interface. For more information, see Monitoring templates.

Test monitoring template

Use zenperfsnmp to test the data point collection aspect of your monitoring template. For more information, see Test monitoring template.

You can verify that your monitoring template is getting bound to each temperature sensor properly by navigating to one of the temperature sensors in the web interface and choosing Templates from its Display drop-down box. Furthermore, you can verify that your Temperature graph is shown when choosing Graphs from the temperature sensor’s Display drop-down.