TECHZEN Zenoss User Community ARCHIVE  

Extend Monitoring Templates in child device classes

Subject: Extend Monitoring Templates in child device classes
Author: Bharat Kumar Kobagana
Posted: 2019-04-04 20:48

Hi Team,

We have requirement, that we have device classes as below:
/Server/SSH/Linux/Category-A
/Server/SSH/Linux/Categpry-B

We have a monitoring template, SampleMonitoringTemplate which bound to device class /Server/SSH/Linux. So the same monitoring template applies to /Server/SSH/Linux/Category-A and /Server/SSH/Linux/Category-B.

But here, I want to add specific datasources, graphs, and thresholds to Category-A and Category-B devices seperately. Like:
For Category-A devices:

    SampleMonitoringTemplate + New DataSource (NDS1) + New Threshold (NT1) + New Graph (NG1)

For Category-B devices:
    SampleMonitoringTemplate + New DataSource (NDS2) + New Threshold (NT2) + New Graph (NG2)

Currently, we are achieving this by replicating SampleMonitoringTempalte as below:

/Server/SSH/Linux:
    templates:
        SampleMonitoringTemplate:
            datasources:
                <some base data sources>
           thresholds:
                <some base thresholds>
           graphs:
                <some base graphs>

/Server/SSH/Linux/CategoryA:
    templates:
        SampleMonitoringTemplate:
            datasources:
                <some base data sources>
                New Data Source (NDS1)
           thresholds:
                <some base thresholds>
                New Threshold (NT1)
           graphs:
                <some base graphs>
                New Graph (NG1)


/Server/SSH/Linux/CategoryB:
    templates:
        SampleMonitoringTemplate:
            datasources:
                <some base data sources>
                New Data Source (NDS2)
           thresholds:
                <some base thresholds>
                New Threshold (NT2)
           graphs:
                <some base graphs>
                New Graph (NG2)

Please suggest the way to optimize the above code.



------------------------------
Bharat Kumar Kobagana
Aptira Pty Ltd.
------------------------------


Subject: RE: Extend Monitoring Templates in child device classes
Author: Adam McCurdy
Posted: 2019-04-04 23:21

How different are the datasources/thresholds/graphs? You may be able to get away with using the same template but a few cProperties that you pull into your datasource and threshold. For example, if you're doing something like:

script.sh <categoryA-arguments> and script.sh <categoryB-arguments> you could do script.sh ${here/cCategoryArguments} instead, and create that custom property and override it locally for each device class. When zenhub builds the configuration for the collector, it'll resolve those properties through zope acquisition and grab the closest copy of them up the tree (either at the device level or the device class level, wherever it's set).

You could do the same with a threshold if it's on the same datapoint; just create cCategoryThreshold or whatever you want to call it, then use ${here/cCategoryThreshold} in your threshold value.

------------------------------
Adam McCurdy
Manager, Customer Enablement
Zenoss
------------------------------


Subject: RE: Extend Monitoring Templates in child device classes
Author: Bharat Kumar Kobagana
Posted: 2019-04-05 05:51

Hi Adam,

Thanks for quick response. Above information is partly suitable to my requirement.

But in my requirement, the difference is not big huge (Not only a threshold value change). Category A and B have difference in data sources, data points, etc.

------------------------------
Bharat Kumar Kobagana
Visakhapatnam
------------------------------


Subject: RE: Extend Monitoring Templates in child device classes
Author: Adam McCurdy
Posted: 2019-04-05 16:44

I'm not sure how you'd be able to consolidate them if they're extremely different. It sounds like you need different templates.

------------------------------
Adam McCurdy
Manager, Customer Enablement
Zenoss
------------------------------


Subject: RE: Extend Monitoring Templates in child device classes
Author: Bharat Kumar Kobagana
Posted: 2019-04-06 08:48

Yeah sure. Will create separate templates. Thanks for the provided solution.

------------------------------
Bharat Kumar Kobagana
Visakhapatnam
------------------------------


< Previous
Dynamic component modeling
  Next
Intro + New Developer Docs
>