TECHZEN Zenoss User Community ARCHIVE  

How to add a custom template to a component?

Subject: How to add a custom template to a component?
Author: [Not Specified]
Posted: 2016-06-11 10:39

I am trying to add a custom component template to a interface but the modeller doesn't pick it up.

My monitoring template is of class "Products.ZenModel.IpInterface" and its properly marked as a Component (the gray snowflake-thing icon) under Advanced > Monitoring Templates

According to the "How Zenoss Chooses Template Bindings" tecdoc at https://support.zenoss.com/hc/en-us/articles/202218669-How-Zenoss-Chooses-Template-Bindings

Zenoss will look for a template that has the same name as the "type" of the interface

The type of component is "ethernetCsmacd_64" according to the Details panel but trying various compinations of "ethernetCsmacd_64" in the name of my template (like "ethernetCsmacd_64_mytemplate" and "mytemplate_ethernetCsmacd_64") doesn't work.

What am i missing here



Subject: The trick for a component
Author: Jane Curry
Posted: 2016-06-13 04:55

The trick for a component template is that it has to EXACTLY match the component - ethernetCsmacd_64 in your case, and you can only have one instance of each template name under any given device class. So, simple answer is you can't easily do what you are trying to do - you would need to get into writing ZenPack code and it's still not easy.

What you CAN easily do is add datasources to an existing template. I would start by taking a local copy of the template onto an interface of a test device (from an interface graph, change the dropdown from Graph to Template and click the "Create Local Template" button. That will give you a test environment to play with. You can then change the contents of the template - datasources, thresholds and graphs.

Once you have something that works, you then need to decide how widely you want to deploy the new template. For example, if it is applicable to all /Server/Linux devices, I would first take a copy of the standard ethernetCsmacd_64 template at the /Server/Linux device class level - by default, it will have a name starting "Copy" (and hence will NOT be automatically bound to components as it does not match the component name). Then modify the "real" ethernetCsmacd_64 template for /Server/Linux.

You should not need to recycle anything - the new definitions will be picked up automatically on the next cycle.

Cheers,

Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



Subject: You could, but you would have
Author: Jay Stanley
Posted: 2016-06-14 09:50

You could, but you would have to patch the interface component and code it in. Not too hard, but you will need to build a ZenPack for it



< Previous
Zenoss core 5.1.3 cannot add the hosts of snmp proxy
  Next
Zope Administration Issues
>