Page 1 of 1

Calculate Average

Posted: Mon Mar 08, 2021 7:38 pm
by rexmundo
Hi

Is there a way for Nagios to calculate the average of a metric and raise an alert if above a threshold?

For example, if we are monitoring CPU, average the last 10 readings and if over 80% raise an alert?

This is something we could do with Appmon.

rgds
George

Re: Calculate Average

Posted: Tue Mar 09, 2021 5:41 pm
by benjaminsmith
Hi Rexmundo,

For the case of CPU, a load check is used to determine the CPU demand over a given time period. For example, the check_load plugin can check against the 1, 5, and 15-minute load averages on the system.

The format is as follows:

Code: Select all

 ./check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0
OK - load average: 0.55, 0.46, 0.30|load1=0.550;5.000;10.000;0; load5=0.460;4.000;6.000;0; load15=0.300;3.000;4.000;0;
Beyond that, there may be a community plugin with that kind of functionality or it would take a custom plugin to check against a historical average.

Let me know if you have further questions.

Regards,
Benjamin

References:
https://www.site24x7.com/blog/load-aver ... ux-servers