Forum Discussion

JG14159's avatar
4 years ago

Custom properties for data source instance ?

Hello Community !

My basic requirement is to show string data (model name, serial number, description, versions, ...) of members of a cluster of devices hiding behind a single virtual device.

This 1/n data can be shown using data sources. Unfortunately this is limited to numeric data.

For non-numeric data there are property sources. Unfortunately this is for adding properties at the device level only. Whereas in my case the properties should be added to a multiplicity of subcomponents (ie cluster members).

What's the recommended approach for showing sets of properties ?

Many thanks for helping this greenhorn ! :-)

 

   

3 Replies

  • Typically this is done via autodiscovery, but if you add manual instances you can manually define properties for the instances. For the AD method, each instance is generated with the normal fields followed by an optional list of property/value strings.  Assuming AD is run often enough, those strings should be current (more or less) for reference in custom alert messages via unconditional token substitution.

    You can also use PropertySources to add auto properties if you want to do that without editing an existing datasource.

    If you need examples, Arista_Sensor_Fans is one of many datasources that generates auto properties.  Or, look at almost any PropertySource module.

    I would not add any manual properties to automatic instances as those would likely vanish at some point.

  • Many thanks indeed ! I'll have a look.

    Just to be certain, I am mistaken to think DS only handle numeric data ?

  • No, you are correct -- datasources store time series numerical data only. Various datasources tie themselves into knots trying to workaround this limitation via datapoint legends.  I recommended a while back adding a per-datapoint enum facility so those could be properly displayed in charts as meaningful strings, especially since legends sometimes get so long and don't wrap that you literally have to open the DS source code to find out what a value means. I never saw even a peep from LM on that sensible fix, sadly.