check_cpu + nsclient : set critical threshold only on 5min period












0















I am using centreon (nagios) to monitor the CPUs of some VMs using NSClient. In my case it makes only sense to set the critical state of the cpu probe if the average cpu load is > 95 over the 5m period. Is this achievable ?



I cannot find documentation on how to specify that in the critical param



Default command



check_cpu


Returns



CPU Load ok
'total 5m load'=0%;80;90 'total 1m load'=0%;80;90 'total 5s load'=7%;80;90


Command with specific threshold (but all time period can match)



check_cpu "critical=load > 90"









share|improve this question





























    0















    I am using centreon (nagios) to monitor the CPUs of some VMs using NSClient. In my case it makes only sense to set the critical state of the cpu probe if the average cpu load is > 95 over the 5m period. Is this achievable ?



    I cannot find documentation on how to specify that in the critical param



    Default command



    check_cpu


    Returns



    CPU Load ok
    'total 5m load'=0%;80;90 'total 1m load'=0%;80;90 'total 5s load'=7%;80;90


    Command with specific threshold (but all time period can match)



    check_cpu "critical=load > 90"









    share|improve this question



























      0












      0








      0








      I am using centreon (nagios) to monitor the CPUs of some VMs using NSClient. In my case it makes only sense to set the critical state of the cpu probe if the average cpu load is > 95 over the 5m period. Is this achievable ?



      I cannot find documentation on how to specify that in the critical param



      Default command



      check_cpu


      Returns



      CPU Load ok
      'total 5m load'=0%;80;90 'total 1m load'=0%;80;90 'total 5s load'=7%;80;90


      Command with specific threshold (but all time period can match)



      check_cpu "critical=load > 90"









      share|improve this question
















      I am using centreon (nagios) to monitor the CPUs of some VMs using NSClient. In my case it makes only sense to set the critical state of the cpu probe if the average cpu load is > 95 over the 5m period. Is this achievable ?



      I cannot find documentation on how to specify that in the critical param



      Default command



      check_cpu


      Returns



      CPU Load ok
      'total 5m load'=0%;80;90 'total 1m load'=0%;80;90 'total 5s load'=7%;80;90


      Command with specific threshold (but all time period can match)



      check_cpu "critical=load > 90"






      monitor nagios






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 14:46







      Ronan Quillevere

















      asked Nov 20 '18 at 8:35









      Ronan QuillevereRonan Quillevere

      2,3441533




      2,3441533
























          2 Answers
          2






          active

          oldest

          votes


















          0














          It is not exactly what I wanted to do but what I did is the following



          check_nrpe -u -H XX.XXX.X.XXX -c check_cpu -a "crit=load > 95" "warn=load > 90" time=5m


          Which limits the output to the 5m time period.



          Note that to execute this from centreon you have to set the following variables inside the nsclient.ini file (waisted a lot of time on that one)



          [/settings/NRPE/server]
          allow nasty characters=true

          [/settings/external scripts]
          allow nasty characters=true





          share|improve this answer































            0














            Check this script,



            define service{
            use generic-service
            host_name xxx
            service_description CPU Load
            check_command check_nrpe!check_load
            contact_groups sysadmin


            }



            ---

            command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20





            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389014%2fcheck-cpu-nsclient-set-critical-threshold-only-on-5min-period%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              It is not exactly what I wanted to do but what I did is the following



              check_nrpe -u -H XX.XXX.X.XXX -c check_cpu -a "crit=load > 95" "warn=load > 90" time=5m


              Which limits the output to the 5m time period.



              Note that to execute this from centreon you have to set the following variables inside the nsclient.ini file (waisted a lot of time on that one)



              [/settings/NRPE/server]
              allow nasty characters=true

              [/settings/external scripts]
              allow nasty characters=true





              share|improve this answer




























                0














                It is not exactly what I wanted to do but what I did is the following



                check_nrpe -u -H XX.XXX.X.XXX -c check_cpu -a "crit=load > 95" "warn=load > 90" time=5m


                Which limits the output to the 5m time period.



                Note that to execute this from centreon you have to set the following variables inside the nsclient.ini file (waisted a lot of time on that one)



                [/settings/NRPE/server]
                allow nasty characters=true

                [/settings/external scripts]
                allow nasty characters=true





                share|improve this answer


























                  0












                  0








                  0







                  It is not exactly what I wanted to do but what I did is the following



                  check_nrpe -u -H XX.XXX.X.XXX -c check_cpu -a "crit=load > 95" "warn=load > 90" time=5m


                  Which limits the output to the 5m time period.



                  Note that to execute this from centreon you have to set the following variables inside the nsclient.ini file (waisted a lot of time on that one)



                  [/settings/NRPE/server]
                  allow nasty characters=true

                  [/settings/external scripts]
                  allow nasty characters=true





                  share|improve this answer













                  It is not exactly what I wanted to do but what I did is the following



                  check_nrpe -u -H XX.XXX.X.XXX -c check_cpu -a "crit=load > 95" "warn=load > 90" time=5m


                  Which limits the output to the 5m time period.



                  Note that to execute this from centreon you have to set the following variables inside the nsclient.ini file (waisted a lot of time on that one)



                  [/settings/NRPE/server]
                  allow nasty characters=true

                  [/settings/external scripts]
                  allow nasty characters=true






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 20 '18 at 14:44









                  Ronan QuillevereRonan Quillevere

                  2,3441533




                  2,3441533

























                      0














                      Check this script,



                      define service{
                      use generic-service
                      host_name xxx
                      service_description CPU Load
                      check_command check_nrpe!check_load
                      contact_groups sysadmin


                      }



                      ---

                      command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20





                      share|improve this answer




























                        0














                        Check this script,



                        define service{
                        use generic-service
                        host_name xxx
                        service_description CPU Load
                        check_command check_nrpe!check_load
                        contact_groups sysadmin


                        }



                        ---

                        command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20





                        share|improve this answer


























                          0












                          0








                          0







                          Check this script,



                          define service{
                          use generic-service
                          host_name xxx
                          service_description CPU Load
                          check_command check_nrpe!check_load
                          contact_groups sysadmin


                          }



                          ---

                          command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20





                          share|improve this answer













                          Check this script,



                          define service{
                          use generic-service
                          host_name xxx
                          service_description CPU Load
                          check_command check_nrpe!check_load
                          contact_groups sysadmin


                          }



                          ---

                          command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 26 '18 at 6:13









                          vishvish

                          9710




                          9710






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389014%2fcheck-cpu-nsclient-set-critical-threshold-only-on-5min-period%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                              SQL update select statement

                              'app-layout' is not a known element: how to share Component with different Modules