Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Bienvenido a la comunidad de Pandora FMS Forums Community support How do i set alert for checking CPU usage in average for 5min period?

  • How do i set alert for checking CPU usage in average for 5min period?

    Posted by Albert on febrero 2, 2023 at 09:20

    Because now i can only seem to create a alert that triggers when the CPU usage reachs above 80%

    But i want to activate the alert when the average CPU usage in the past 5mins reachs 80% or above

    Anyone can teach me where to check documents/How to do it?

    Thank you

    Sergio replied 1 year, 10 months ago 2 Members · 7 Replies
  • 7 Replies
  • Sergio

    Administrator
    febrero 2, 2023 at 09:55
    1326 Karma points
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    1
    Down
    Drop it
    ::

    Hello Albert,

    It will depend on the Interval of the Agent you have configured. If you have a 5 minutes interval set on the Agent you will have to use the FF Threshold of the module, but you will not be able to actually know if the module was +80% all the 5 minutes interval as you will only check its load every 5 minutes.

    But with the FF Threshold you can determine that in the first check of the module if it is over 80% you don’t want to trigger a critical nor any alarms yet, but if in the second interval the module is being checked it is still over 80% then you trigger the module to critical and start the alarm.

    Basically you will need to set is what you can see in the picture attached below.

    This is the most straight forward way to perform something similar of what you want.

    Here’s everything you need to know about the FF Threshold of the alert and how to configure it:

    https://pandorafms.com/manual/en/documentation/03_monitoring/01_intro_monitoring?s%5B%5D=ff&s%5B%5D=threshold#advanced_options

  • Albert

    Member
    febrero 2, 2023 at 10:16
    126 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    So what you mean is that if i want to check per 5mins i should make the monitor check per 1min and the FF threshold criticial to 5?

    • Sergio

      Administrator
      febrero 2, 2023 at 10:30
      1326 Karma points
      Community rank: tentacle_master_icon Tentacle Master
      Like it
      Up
      0
      Down
      Drop it
      ::

      Hello Albert,

      That would be an option, but bear in mind that this may overload the server if your agent has many modules to monitorize, or if the server has many agents configured this way, so in case it does not, that would definetly be an option.

      If you do have the Agent with a 1 minute interval, instead of having the FF Threshold set to 2, you will need to set it to 5 or 4, in order to skip the 4-5 minutes interval you need.

      BUT, if the module goes under the 80% in any of those checks the counter will restart to 0, so once again it will need all 4-5 checks to be over 80% to go into critical state and raise the alarm.

      Kind regards,

      Sergio B.

      • Albert

        Member
        febrero 2, 2023 at 10:35
        126 Karma points
        Community rank: tentacle-noob-1 Tentacle noob
        Like it
        Up
        0
        Down
        Drop it
        ::

        Thanks for your reply, so what happens if two spikes happens within the two 5mins ff threshold?

        What i understand is it performs 1 checks per 5mins interval according to agents for 2 ff threshold

        And fires the alarm if the in the two checks the CPU is over 80%

        Is there a better method of doing this? Like checking average value of CPU in module? Or is this the only way

        • Sergio

          Administrator
          febrero 2, 2023 at 11:04
          1326 Karma points
          Community rank: tentacle_master_icon Tentacle Master
          Like it
          Up
          0
          Down
          Drop it
          ::

          Hello Albert,

          In this case this is the only way to check it. As the Agent is not providing live information on the CPU there is no other way than to simplify it with 1 minute.

          There is another option to not overload the Agent and just leave this specific module with a 1 minute interval which is establishing the Agent in a 1 minute interval and then you can add a module_interval 5 in all the rest of the modules of the Agent except this one.

          What this will do is have the Agent in 1 minute interval and use that interval only for the CPU Load module, leaving all the rest of the modules with the module_interval 5 which multiplies the Agent interval for the value you pass on, in this case 5, so the modules will not receive any data nor changes for the whole 5 minutes, leaving them with a “normal” interval.

          Although if you have hundreds of modules inside that Agent it will be tedious to change each single module to use the module_interval 5 .

          Kind regards,

          Sergio B.

      • Albert

        Member
        febrero 2, 2023 at 10:52
        126 Karma points
        Community rank: tentacle-noob-1 Tentacle noob
        Like it
        Up
        0
        Down
        Drop it
        ::

        Also, what happens if i set 2 warning and 2 critical?

        Does it check for 4 intervals? like 20mins?

        Or does it check each status individually? like 10mins for both warning and critical status

        • Sergio

          Administrator
          febrero 2, 2023 at 11:07
          1326 Karma points
          Community rank: tentacle_master_icon Tentacle Master
          Like it
          Up
          0
          Down
          Drop it
          ::

          Hello,

          If you configure 2 warning and 2 critical it will trigger the warning / critical state when any of those conditions come true.

          If the module goes warning 2 times in a row, it will trigger the Warning state, if the module goes Critical 2 times in a row, it will trigger the Critical state.

          If the module goes Warning and then Critical or viceversa, again, the counter resets, as it needs to happen 2 times in a row to change its state

          Kind regards,

          Sergio B.