TECHZEN Zenoss User Community ARCHIVE  

Beginner understanding templates

Subject: Beginner understanding templates
Author: Marco Shaw
Posted: 2017-09-27 21:54

If there's an online article I may have missed, please let me know and I'll RTFM...

Just trying to get my head wrapped around templates.  I have Linux and Windows servers and I'm just trying to understand how things all fit together.

Ultimately, I want something like:
-Linux via SNMP (I've not been able to specifically find something that lists out the benefits of SSH)
-Windows via WMI (vs WinRM)
-CPU, memory and file system monitoring (alerting based on thresholds)

It seems like devices are clearly identified by their class like \Server\Linux and \Server\Windows\WMI.  It looks like these device classes include graphs by default (after properly modeling).

What I haven't quite figure out, for example, is how monitoring fits into this (file system is full).  I've received a few file system alerts already (and don't remember the class that showed up), but haven't quite been able to find how that "links" together.

------------------------------
Marco Shaw
N/A
------------------------------


Subject: RE: Beginner understanding templates
Author: Marco Shaw
Posted: 2017-09-28 07:26

​In addition I guess...  Does something defined at a higher class level like \Server also apply to something like \Server\Linux, unless there's some kind of override?

------------------------------
Marco Shaw
N/A
------------------------------


Subject: RE: Beginner understanding templates
Author: Jane Curry
Posted: 2017-09-28 09:51

Hi Marco,
I wish I could point you to a good explanation on templates!  Let me have a go at it.....

A template has a name and a location:
There may be many different instances of a template with the same name - look at the Device template; there's one for /Server/Linux, /Server/SSH,  /Server/Windows and so on.  They all contain different data sources (definitions of things to collect (data points) and how to collect them), so the Linux one uses snmp, the SSH one uses ssh and the Windows one uses WMI.  Each of the different instances of the Device template also contains graph definitions, using the datapoints defined.  Ultimately in the GUI, the graphs may look very similar - CPU Utilization, Memory etc - but that data may have been collected by very different methods.

These templates are all just definitions - they don't actually DO anything until they are "bound".  Zenoss provides some template bindings as default out-of-the-box; you can add, change, remove as you wish.  Templates can be bound to a device class or to a specific device and the template instance "lowest" in the class hierarchy is what will actually run on a box, so a device-level binding for a device fred in /Server/Linux/myBoxes, would override any Device template defined for class /Server/Linux/myBoxes, which in turn would override any Device template defined for class /Server/Linux, which in turn would override any Device template for class /Server, etc.

A large part of Zenoss's scalability is to apply templates at the highest possible level so that if changes are needed, they then are automatically applied to lots of devices.  Only change an instance of a template if it really needs to do something different at that level of the hierarchy.  And to answer one of your specific questions, yes - a Device template at device class /Server/Linux would apply to any device in /Server/Linux, /Server/Linux/myBoxes and on down the hierarchy, unless overridden.

In addition, both a device and a device class have a "Configuration Property" (also known as a zProperty), called zDeviceTemplates.  This is a list of the template names bound at that level - just the name; it is up to Zenoss to determine which instance of that template name is appropriate to use.

A frequent confusion with templates is the difference between device-level templates (like Device) and component templates.  If you look at ADVANCED -> Monitoring Templates and look at all the templates, some have a small icon (white snowflake on grey background) - this means it is a component template.  Unfortunately this isn't / hasn't always been totally consistent but it is generally a good guide.  An example of a component template is FileSystem; again, there are several different instances for the different parts of the device class hierarchy.   A component template is automatically bound to any relevant component - where a component is something in a device's main page under the left-hand Components menu - things like File Systems, Interfaces, Processors.  These components are discovered by modeling ( zenmodeler typically runs every 12 hours).  You should not manually bind a component template.

So, bottom line, if you put a device under /Server/Linux and you ensure that the Configuration Properties for SNMP are setup correctly, then the Device (/Server/Linux) device-level template should run on it, collecting CPU, memory, IO data every 5 minutes.  zenmodeler should be able to discover at least Interface and File System components; once discovered, the FileSystem (/Server/Linux) component template will automatically be bound to each FileSystem instance.

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


Subject: RE: Beginner understanding templates
Author: Marco Shaw
Posted: 2017-09-28 11:28

​Thank you Jane!  I'm going to re-read your reply a few times to make sure I follow it all.

In the particular example of a File System class/template, I believe I understand how it auto-magically works.  I need to make sure I then go back and find how to modify/configure the threshold of that.

So it is safe to assume that if I see that component (like the C: drive or "/" on Linux) listed in the device properties and it is being graphed, then it is also being "monitored" based on thresholds?

------------------------------
Marco Shaw
N/A
------------------------------


Subject: RE: Beginner understanding templates
Author: Jane Curry
Posted: 2017-09-29 11:51

Yup - if you are getting graphs for "something" (strictly if you are graphing a datapoint), then any threshold that is defined for that datapoint should also be honoured.  Only slight caveat is to check that a threshold does have the "enabled" box ticked - I think they all are by default but that doesn't mean to say that someone in your environment hasn't unticked it at some stage ;)

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


Subject: RE: Beginner understanding templates
Author: Jay Stanley
Posted: 2017-12-09 10:19

A simple trick you can use to find out what is being monitored for a component. Right above the graphs for that component there is a drop down menu, select Template from that and it will either show you all the datasources/datapoints (5.x+) or the name and link to the template (4.x), clicking the link will take you to the template page and show you the datasources/datapoints.

You can also see graphs and thresholds.

Here are some basic explanations I use when explaining Zenoss to users.

Modelers are plugins created to tell Zenoss what things to find on a system (Filesystems, Interfaces, Open ports, etc)
Templates tell Zenoss what needs to be monitored, what data to store, what threshold to use on said data and what graphs to create.
Datasources are the "commands" Zenoss will use to monitor an object. (IE sending an api call, pulling an snmp oid, wmi query, winrm command, etc)
Datapoints are the names of the data to be stored for later use (in thresholds or graphs).

------------------------------
jstanley
------------------------------


< Previous
Zenoss Core 5.3.2 update ISO?
  Next
Step by step to do instalation zenoss on Ubuntu Server 16.04 LTS
>