26 Nov 2019 12:19 PM - last edited on 18 May 2023 03:31 PM by Michal_Gebacki
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")
Solved! Go to Solution.
26 Nov 2019 01:01 PM
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)
)
)