Follow

How to Create a Custom Template In Resource Manager

Applies To

  • Zenoss 3.x
  • Resource Manager 4.x

Summary

Zenoss monitoring templates (referred to as templates) are collections of data points, often with corresponding thresholds (data point limits) and graphs, that are designed to monitor particular devices or applications. Zenoss Resource Manager ships with a default set of monitoring thresholds, and the Zenoss platform has been designed to be flexible enough to allow administrators to edit existing templates or create entirely new ones.

In this article, we describe how to create a new template and examine a sample use case for why an administrator may wish to do so. For example, suppose Hypothetical Insurance Company (a fictitious business) wants to monitor the uptime of their Linux servers and to be warned when those systems have been running for longer than a prescribed period of time between reboots. Creating a custom template is an excellent approach for meeting this need. The example examined here is deliberately over simplified, resulting in a template with only a single data point, a single threshold, and a single graph. Before the steps necessary for creating the template are explained, some review of monitoring template basics is helpful. 

Theory

Templates provide the following:

  • Data Sources that are conceptually equivalent to data point queries that use a specific protocol or command. The results of these queries are parsed and returned in the form of one or more data points. One example of a data point might be hard drive utilization of a server. Another - and the one detailed in this article - might be the system uptime.
  • Thresholds that define conditions under which events are generated and implemented by the collector. Thresholds are linked to data points. For example, a threshold may be created that generates an event should any given server exceed 60 days of uptime.
  • Graph Definitions that visually depict the performance of a data point over time.

Default templates are supplied for many devices including (but not limited to):

Apache Tomcat
DigMonitor
DNSMonitor
EC2
FTPMonitor
IrcdMonitor
Jabber
Java
JBoss
LDAPServer
Mail transactions
MSSQLServer
NNTPMonitor
NTPMonitor
Oracle
RPCMonitor
Weblogic
 

Templates are their own independent objects within the Zenoss database, and are "put to work" by being associated with ("bound to") devices or device classes. Templates can be customized and additional monitoring functionality can be added to a device or device class by binding the appropriate monitoring template or adding a data source to an existing template. The Zenoss platform is deliberately flexible when it comes to managing templates because they can be copied to new locations and even cloned and customized for individual devices.

For a use case such as the one examined in this article, a template is created first, then linked to one or more device classes as needed to be put to use.

Example Procedure - System Uptime Template

The procedure to define and use a custom template includes the following steps:

  1. Create a blank template.
  2. Define one or more data points.
  3. Define threshold(s) (optional).
  4. Create one or more graph definition(s) (optional).
  5. Bind the template to device classes or devices as needed.

Create a Blank Template

  1. Navigate to Advanced --> Monitoring Templates.
  2. Click the + symbol near the bottom of the page to add a new template.
  3. Name the template, for example, SystemUptime.
  4. Select a Template Path, for example /Server.
    When the template is created, it is highlighted and ready for editing.
  5. Begin editing the template. Click the + (plus) symbol  near the top under Data Sources.
  6. Enter the Data Source Name, for example systemuptime. In this case, leave the default SNMP selection for the Type.
  7. Submit the form to create the data point.
  8. Highlight the new data source and click the gearbox icon under Data Sources.
  9. Choose View and Edit Details from the dropdown list.
  10. In the form that appears, specify the OID that is associated with the desired data point.

    In this case, querying Linux servers for uptime requires the following OID: 1.3.6.1.2.1.25.1.1.0.

    The Linux servers will respond to this OID with the system's uptime in 100ths of a second (timeticks). Although this is an inconvenient form for the data to be delivered, Zenoss provides the ability to transform the data within the template to make it more human friendly when creating thresholds or graphs.

  11. Optionally, test the OID using the Test Against a Device option against a Linux server your Zenoss instance is currently monitoring.
  12. Save and exit the form.

Define the Template Threshold (Optional)

  1. Click the + (plus) symbol under the Thresholds section of the template.
  2. Select a Threshold Type, in this case MinMax Threshold.
  3. Name the threshold, for example, 30_DAY_UPTIME and submit the form.
  4. Double-click the new threshold to edit it.
  5. In the form that displays, available data points are listed in the left hand column, and data points used for the threshold are in the right hand column.

    Ensure the system uptime data point exists in the right hand column, in this example, systemuptime_systemuptime.

    If the data point is not in the right hand column:

    1. Click the data point to highlight it.
    2. Click the right arrow to move it into the right hand column.

  6. Scroll down in the form to the Maximum Value field and enter a value in .01 second increments. In this example, to define a 30 day period, enter  259200000 , where 1 timetick = 1/100 second.
  7. Save the form.

Create the Template Graph Definition

  1. Click the + (plus) symbol under the Graph Definitions section of the template.
  2. Name the new graph, for example, SystemUptime.
  3. Highlight the graph name and click the gearbox icon under Graph Definitions.
  4. Choose Manage Graph Points to select the data points for the graph.
  5. Click the + (plus) symbol in the Manage Graph Points form and select Data Point.
  6. Select the datapoint, for example systemuptime.systemuptime and click Submit.
  7. With the data point selected, in this case systemuptime click the gearbox icon to edit it.
  8. Specify the Line Type for the grpahic representation, in this example, choose Area for the Line Type.
  9. In this example, in the RPN field, enter the RPN expression 8640000,/ to convert the data point from timeticks to days.
  10. Click Save twice to exit the Manage Graph Points form.
  11. To edit the Graph Definitions, highlight the graph object and click the gearbox icon under Graph Definitions.
  12. Select View and Edit Details.
  13. Specify the units for the graph, in this case, enter Days in the Units field.
  14. Specify the minimum y axis value, in this case , enter 0 in the Min Y field.
  15. Specify the maximum y axis value, in this case enter 30 in the Max Y field.
  16. Click Submit to save and exit the form.

Bind the Template

  1. Click the monitoring template, in this case SystemUptime in the list on the left.
  2. Click the gearbox icon at the bottom of the screen and select Copy / Override Template.
  3. A prompt displays to select a target device class. In this example, select /Server/Linux and click Submit.
    Although the template is copied to the device class, in this case the Linux device class, it must be bound to the class.
  4. To bind the template to the class, highlight the new copy of the template and click the gearbox icon.
  5. Select Toggle Template Binding from the dropdown list.

Binding of the new template to the entire /Device/Server/Linux class will cause every server in the class to have its uptime polled at each polling cycle, and - because the threshold was configured - an event will be generated for any servers with more than 30 days uptime. Finally, administrators will be able to check the uptime of each server by viewing its uptime graph.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk