- Zenoss 3.x
- Resource Manager 4.x
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.
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):
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:
- Create a blank template.
- Define one or more data points.
- Define threshold(s) (optional).
- Create one or more graph definition(s) (optional).
- Bind the template to device classes or devices as needed.
Create a Blank Template
- Navigate to Advanced --> Monitoring Templates.
- Click the + symbol near the bottom of the page to add a new template.
- Name the template, for example, SystemUptime.
- Select a Template Path, for example /Server.
When the template is created, it is highlighted and ready for editing.
- Begin editing the template. Click the + (plus) symbol near the top under Data Sources.
- Enter the Data Source Name, for example systemuptime. In this case, leave the default SNMP selection for the Type.
- Submit the form to create the data point.
- Highlight the new data source and click the gearbox icon under Data Sources.
- Choose View and Edit Details from the dropdown list.
- 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: 188.8.131.52.184.108.40.206.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.
- Optionally, test the OID using the Test Against a Device option against a Linux server your Zenoss instance is currently monitoring.
- Save and exit the form.
Define the Template Threshold (Optional)
- Click the + (plus) symbol under the Thresholds section of the template.
- Select a Threshold Type, in this case MinMax Threshold.
- Name the threshold, for example, 30_DAY_UPTIME and submit the form.
- Double-click the new threshold to edit it.
- 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:
- Click the data point to highlight it.
- Click the right arrow to move it into the right hand column.
- 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.
- Save the form.
Create the Template Graph Definition
- Click the + (plus) symbol under the Graph Definitions section of the template.
- Name the new graph, for example, SystemUptime.
- Highlight the graph name and click the gearbox icon under Graph Definitions.
- Choose Manage Graph Points to select the data points for the graph.
- Click the + (plus) symbol in the Manage Graph Points form and select Data Point.
- Select the datapoint, for example systemuptime.systemuptime and click Submit.
- With the data point selected, in this case systemuptime click the gearbox icon to edit it.
- Specify the Line Type for the grpahic representation, in this example, choose Area for the Line Type.
- In this example, in the RPN field, enter the RPN expression 8640000,/ to convert the data point from timeticks to days.
- Click Save twice to exit the Manage Graph Points form.
- To edit the Graph Definitions, highlight the graph object and click the gearbox icon under Graph Definitions.
- Select View and Edit Details.
- Specify the units for the graph, in this case, enter Days in the Units field.
- Specify the minimum y axis value, in this case , enter 0 in the Min Y field.
- Specify the maximum y axis value, in this case enter 30 in the Max Y field.
- Click Submit to save and exit the form.
Bind the Template
- Click the monitoring template, in this case SystemUptime in the list on the left.
- Click the gearbox icon at the bottom of the screen and select Copy / Override Template.
- 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.
- To bind the template to the class, highlight the new copy of the template and click the gearbox icon.
- 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.