Skip to main content
Declined

[plugins] select perfdata inside the math() method of the --extend-perfdata-group option

Related products:Infra Monitoring - Monitoring
  • March 22, 2022
  • 2 replies
  • 56 views

tcharles
Centreonian
Forum|alt.badge.img+5

Hello,

 

Here is an example of the need with the following perfdatas on a service:

 

cpu_total=60% cpu_1=20% cpu_2=40% 

 

I’d like to create a perfdata that is going to be the result of a substraction between two of the above metrics. Meaning that i want a new metric called cpu_custom that will be equal to cpu_total - cpu_1

 

To do so, I was thinking of doing the below option configuration

 --extend-perfdata-group=’cpu_total|cpu_1,cpu_custom,math(cpu_total - cpu_1)’

 

Sadly, it is not possible to do the math operation on metrics that are part of the searching group (cpu_total and cpu_1 according to my regex). 

 

I’d like to have a way to handle that a bit like the sum() method where you can use a regex to filter metrics from your searching group and then do the sum. 

 

Regards

2 replies

sims24
Forum|alt.badge.img+19
  • Ranger ***
  • March 25, 2022

Hello Tanguy,

Thanks for posting this. 


I think we will not implement such capability at plugins level. As we’ve discussed, you don’t need to set alarms, therefore it’s only a metrology need and then doesn’t seems ideal to implement it here. 


We will keep this in mind ​​​when designing upcoming visualization features.

 

Stay tuned ;)

Simon​​​​​​


sims24
Forum|alt.badge.img+19
  • Ranger ***
  • March 25, 2022
Updated idea statusNewDeclined