cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Statetimeseries supported on OneAgent plugins

I want to use statetimeseries on my oneagent plugin with following states:

"states": ["OK", "NOT_YET_TRIGGERED", "PAUSED", "INVALID", "ERROR"],

and with a dimensions: "job"

 

I assumed I could report the value like this ...

         for jobDetail in jobDetails:
    if interval is not None:
                    self.results_builder.absolute(
key='jobExecutionState',
                value=status.replace(" ", "_"),
                dimensions={
                    "job":  jobDetail['name']
                },
                entity_id=pgi_id                       
                    )

However... value must be a float.

With activegate-plugins these statetimeseries are reported via the device using state_metric.

device.state_metric("my_state", "OK") 

 

1 REPLY 1

After some searching and learning some more python ...


self.results_builder.add_absolute_result(
                PluginStateMetric(
                    key='jobExecutionState',
                    value=status.replace(" ", "_"),
                    dimensions={
                        "job":  jobDetail['name']
                    },
                    entity_selector=ExplicitPgiSelector(pgi_id=pgi_id)
                )
            )

Featured Posts