System call sent warnings to stderr: error: unsupported option (BSD syntax)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












When we run the Nagios check_procs module in redhat7 os, we are facing below error. By googling we found that we need to reinstall procps package. We also reinstalled procps package but the module is working for first attempt and then its getting failed.



Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)









share|improve this question



























    up vote
    2
    down vote

    favorite












    When we run the Nagios check_procs module in redhat7 os, we are facing below error. By googling we found that we need to reinstall procps package. We also reinstalled procps package but the module is working for first attempt and then its getting failed.



    Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)









    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      When we run the Nagios check_procs module in redhat7 os, we are facing below error. By googling we found that we need to reinstall procps package. We also reinstalled procps package but the module is working for first attempt and then its getting failed.



      Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)









      share|improve this question















      When we run the Nagios check_procs module in redhat7 os, we are facing below error. By googling we found that we need to reinstall procps package. We also reinstalled procps package but the module is working for first attempt and then its getting failed.



      Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)






      nagios






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 22:44









      Rui F Ribeiro

      38.2k1475125




      38.2k1475125










      asked Dec 22 '15 at 10:33









      pravin09

      242312




      242312




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote














          Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)




          The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command.



          Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to know about running processes. Given the wide variance in ps commands across operating systems, it has to tailor this to each operating system's ps command.



          This it does when the check_procs plug-in is compiled from source to binary. There's a 400-odd-line configuration script that laboriously checks each known combination of ps arguments+options and scanning format string in turn, until one works. This combination is then hardwired into the compiled plug-in.



          If the combination turns out to be wrong for the actual system where check_procs is run, ps either generates output in the wrong format (witness MacPorts bug #28801 and monitoring-plugins issue #1328) or generates error messages to standard error (witness Debian Bug #296003) which are picked up by the plug-in and alerted on. The latter is what is happening here.



          This has various consequences:



          • If you are building the plug-in from source, you need to build it with the same ps command installed as will be installed on the eventual production machine.

          • If you are using a pre-built binary, that binary needs to have been built on a system whose ps command matches the one on your machine where you are running the plug-in. If you didn't build the binary yourself, you need to talk to the person who did, or at the very least to the package maintainer if you are using a packaged-up pre-built binary.





          share|improve this answer




















          • But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
            – pravin09
            Dec 23 '15 at 11:16


















          up vote
          0
          down vote













          We have done a script for total check process, which solves the Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) issue.



          Please find the script below.



           #!/bin/bash
          #
          # Script to check Process usage on Linux. Ignores Process used by disk cache.
          #
          # Requires the bc command
          # $1 $2 $3 $4
          # ./check_Process -w 85 -c 95
          print_help()
          echo "Usage:"
          echo "[-w] Warning level as a percentage"
          echo "[-c] Critical level as a percentage"
          exit 0


          while test -n "$1"; do
          case "$1" in
          --help|-h)
          print_help
          exit 0
          ;;
          -w)
          warn_level=$2
          shift
          ;;
          -c)
          critical_level=$2
          shift
          ;;
          *)
          echo "Unknown Argument: $1"
          print_help
          exit 3
          ;;
          esac
          shift
          done

          if [ "$warn_level" == "" ]; then
          echo "No Warning Level Specified"
          print_help
          exit 3;
          fi

          if [ "$critical_level" == "" ]; then
          echo "No Critical Level Specified"
          print_help
          exit 3;
          fi

          count=`ps -ef | wc -l`

          ###################

          if [ "$count" -lt "$warn_level" ]; then
          echo "Process OK:$count | 'Process' =$count;$warn_level;$critical_level"
          exit 0;
          elif [ "$count" -ge "$warn_level" ] && [ "$count" -le "$critical_level" ]; then
          echo "Process WARNING: $count | 'Process'=$count;$warn_level;$critical_level"
          exit 1;
          elif [ "$count" -gt "$critical_level" ]; then
          echo "Process CRITICAL: $count | 'Process'=$count;$warn_level;$critical_level"
          exit 2;
          fi





          share|improve this answer




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f250883%2fsystem-call-sent-warnings-to-stderr-error-unsupported-option-bsd-syntax%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








            up vote
            4
            down vote














            Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)




            The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command.



            Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to know about running processes. Given the wide variance in ps commands across operating systems, it has to tailor this to each operating system's ps command.



            This it does when the check_procs plug-in is compiled from source to binary. There's a 400-odd-line configuration script that laboriously checks each known combination of ps arguments+options and scanning format string in turn, until one works. This combination is then hardwired into the compiled plug-in.



            If the combination turns out to be wrong for the actual system where check_procs is run, ps either generates output in the wrong format (witness MacPorts bug #28801 and monitoring-plugins issue #1328) or generates error messages to standard error (witness Debian Bug #296003) which are picked up by the plug-in and alerted on. The latter is what is happening here.



            This has various consequences:



            • If you are building the plug-in from source, you need to build it with the same ps command installed as will be installed on the eventual production machine.

            • If you are using a pre-built binary, that binary needs to have been built on a system whose ps command matches the one on your machine where you are running the plug-in. If you didn't build the binary yourself, you need to talk to the person who did, or at the very least to the package maintainer if you are using a packaged-up pre-built binary.





            share|improve this answer




















            • But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
              – pravin09
              Dec 23 '15 at 11:16















            up vote
            4
            down vote














            Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)




            The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command.



            Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to know about running processes. Given the wide variance in ps commands across operating systems, it has to tailor this to each operating system's ps command.



            This it does when the check_procs plug-in is compiled from source to binary. There's a 400-odd-line configuration script that laboriously checks each known combination of ps arguments+options and scanning format string in turn, until one works. This combination is then hardwired into the compiled plug-in.



            If the combination turns out to be wrong for the actual system where check_procs is run, ps either generates output in the wrong format (witness MacPorts bug #28801 and monitoring-plugins issue #1328) or generates error messages to standard error (witness Debian Bug #296003) which are picked up by the plug-in and alerted on. The latter is what is happening here.



            This has various consequences:



            • If you are building the plug-in from source, you need to build it with the same ps command installed as will be installed on the eventual production machine.

            • If you are using a pre-built binary, that binary needs to have been built on a system whose ps command matches the one on your machine where you are running the plug-in. If you didn't build the binary yourself, you need to talk to the person who did, or at the very least to the package maintainer if you are using a packaged-up pre-built binary.





            share|improve this answer




















            • But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
              – pravin09
              Dec 23 '15 at 11:16













            up vote
            4
            down vote










            up vote
            4
            down vote










            Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)




            The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command.



            Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to know about running processes. Given the wide variance in ps commands across operating systems, it has to tailor this to each operating system's ps command.



            This it does when the check_procs plug-in is compiled from source to binary. There's a 400-odd-line configuration script that laboriously checks each known combination of ps arguments+options and scanning format string in turn, until one works. This combination is then hardwired into the compiled plug-in.



            If the combination turns out to be wrong for the actual system where check_procs is run, ps either generates output in the wrong format (witness MacPorts bug #28801 and monitoring-plugins issue #1328) or generates error messages to standard error (witness Debian Bug #296003) which are picked up by the plug-in and alerted on. The latter is what is happening here.



            This has various consequences:



            • If you are building the plug-in from source, you need to build it with the same ps command installed as will be installed on the eventual production machine.

            • If you are using a pre-built binary, that binary needs to have been built on a system whose ps command matches the one on your machine where you are running the plug-in. If you didn't build the binary yourself, you need to talk to the person who did, or at the very least to the package maintainer if you are using a packaged-up pre-built binary.





            share|improve this answer













            Error: System call sent warnings to stderr: error: unsupported option (BSD syntax)




            The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command.



            Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to know about running processes. Given the wide variance in ps commands across operating systems, it has to tailor this to each operating system's ps command.



            This it does when the check_procs plug-in is compiled from source to binary. There's a 400-odd-line configuration script that laboriously checks each known combination of ps arguments+options and scanning format string in turn, until one works. This combination is then hardwired into the compiled plug-in.



            If the combination turns out to be wrong for the actual system where check_procs is run, ps either generates output in the wrong format (witness MacPorts bug #28801 and monitoring-plugins issue #1328) or generates error messages to standard error (witness Debian Bug #296003) which are picked up by the plug-in and alerted on. The latter is what is happening here.



            This has various consequences:



            • If you are building the plug-in from source, you need to build it with the same ps command installed as will be installed on the eventual production machine.

            • If you are using a pre-built binary, that binary needs to have been built on a system whose ps command matches the one on your machine where you are running the plug-in. If you didn't build the binary yourself, you need to talk to the person who did, or at the very least to the package maintainer if you are using a packaged-up pre-built binary.






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 22 '15 at 13:48









            JdeBP

            31.8k467148




            31.8k467148











            • But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
              – pravin09
              Dec 23 '15 at 11:16

















            • But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
              – pravin09
              Dec 23 '15 at 11:16
















            But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
            – pravin09
            Dec 23 '15 at 11:16





            But the check_procs script is working once we reinstall the procps-ng package but it is working only for few minutes. Then same error existing. Please provide a solution for this. i have Redhat 7.1 version installed.
            – pravin09
            Dec 23 '15 at 11:16













            up vote
            0
            down vote













            We have done a script for total check process, which solves the Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) issue.



            Please find the script below.



             #!/bin/bash
            #
            # Script to check Process usage on Linux. Ignores Process used by disk cache.
            #
            # Requires the bc command
            # $1 $2 $3 $4
            # ./check_Process -w 85 -c 95
            print_help()
            echo "Usage:"
            echo "[-w] Warning level as a percentage"
            echo "[-c] Critical level as a percentage"
            exit 0


            while test -n "$1"; do
            case "$1" in
            --help|-h)
            print_help
            exit 0
            ;;
            -w)
            warn_level=$2
            shift
            ;;
            -c)
            critical_level=$2
            shift
            ;;
            *)
            echo "Unknown Argument: $1"
            print_help
            exit 3
            ;;
            esac
            shift
            done

            if [ "$warn_level" == "" ]; then
            echo "No Warning Level Specified"
            print_help
            exit 3;
            fi

            if [ "$critical_level" == "" ]; then
            echo "No Critical Level Specified"
            print_help
            exit 3;
            fi

            count=`ps -ef | wc -l`

            ###################

            if [ "$count" -lt "$warn_level" ]; then
            echo "Process OK:$count | 'Process' =$count;$warn_level;$critical_level"
            exit 0;
            elif [ "$count" -ge "$warn_level" ] && [ "$count" -le "$critical_level" ]; then
            echo "Process WARNING: $count | 'Process'=$count;$warn_level;$critical_level"
            exit 1;
            elif [ "$count" -gt "$critical_level" ]; then
            echo "Process CRITICAL: $count | 'Process'=$count;$warn_level;$critical_level"
            exit 2;
            fi





            share|improve this answer
























              up vote
              0
              down vote













              We have done a script for total check process, which solves the Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) issue.



              Please find the script below.



               #!/bin/bash
              #
              # Script to check Process usage on Linux. Ignores Process used by disk cache.
              #
              # Requires the bc command
              # $1 $2 $3 $4
              # ./check_Process -w 85 -c 95
              print_help()
              echo "Usage:"
              echo "[-w] Warning level as a percentage"
              echo "[-c] Critical level as a percentage"
              exit 0


              while test -n "$1"; do
              case "$1" in
              --help|-h)
              print_help
              exit 0
              ;;
              -w)
              warn_level=$2
              shift
              ;;
              -c)
              critical_level=$2
              shift
              ;;
              *)
              echo "Unknown Argument: $1"
              print_help
              exit 3
              ;;
              esac
              shift
              done

              if [ "$warn_level" == "" ]; then
              echo "No Warning Level Specified"
              print_help
              exit 3;
              fi

              if [ "$critical_level" == "" ]; then
              echo "No Critical Level Specified"
              print_help
              exit 3;
              fi

              count=`ps -ef | wc -l`

              ###################

              if [ "$count" -lt "$warn_level" ]; then
              echo "Process OK:$count | 'Process' =$count;$warn_level;$critical_level"
              exit 0;
              elif [ "$count" -ge "$warn_level" ] && [ "$count" -le "$critical_level" ]; then
              echo "Process WARNING: $count | 'Process'=$count;$warn_level;$critical_level"
              exit 1;
              elif [ "$count" -gt "$critical_level" ]; then
              echo "Process CRITICAL: $count | 'Process'=$count;$warn_level;$critical_level"
              exit 2;
              fi





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                We have done a script for total check process, which solves the Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) issue.



                Please find the script below.



                 #!/bin/bash
                #
                # Script to check Process usage on Linux. Ignores Process used by disk cache.
                #
                # Requires the bc command
                # $1 $2 $3 $4
                # ./check_Process -w 85 -c 95
                print_help()
                echo "Usage:"
                echo "[-w] Warning level as a percentage"
                echo "[-c] Critical level as a percentage"
                exit 0


                while test -n "$1"; do
                case "$1" in
                --help|-h)
                print_help
                exit 0
                ;;
                -w)
                warn_level=$2
                shift
                ;;
                -c)
                critical_level=$2
                shift
                ;;
                *)
                echo "Unknown Argument: $1"
                print_help
                exit 3
                ;;
                esac
                shift
                done

                if [ "$warn_level" == "" ]; then
                echo "No Warning Level Specified"
                print_help
                exit 3;
                fi

                if [ "$critical_level" == "" ]; then
                echo "No Critical Level Specified"
                print_help
                exit 3;
                fi

                count=`ps -ef | wc -l`

                ###################

                if [ "$count" -lt "$warn_level" ]; then
                echo "Process OK:$count | 'Process' =$count;$warn_level;$critical_level"
                exit 0;
                elif [ "$count" -ge "$warn_level" ] && [ "$count" -le "$critical_level" ]; then
                echo "Process WARNING: $count | 'Process'=$count;$warn_level;$critical_level"
                exit 1;
                elif [ "$count" -gt "$critical_level" ]; then
                echo "Process CRITICAL: $count | 'Process'=$count;$warn_level;$critical_level"
                exit 2;
                fi





                share|improve this answer












                We have done a script for total check process, which solves the Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) issue.



                Please find the script below.



                 #!/bin/bash
                #
                # Script to check Process usage on Linux. Ignores Process used by disk cache.
                #
                # Requires the bc command
                # $1 $2 $3 $4
                # ./check_Process -w 85 -c 95
                print_help()
                echo "Usage:"
                echo "[-w] Warning level as a percentage"
                echo "[-c] Critical level as a percentage"
                exit 0


                while test -n "$1"; do
                case "$1" in
                --help|-h)
                print_help
                exit 0
                ;;
                -w)
                warn_level=$2
                shift
                ;;
                -c)
                critical_level=$2
                shift
                ;;
                *)
                echo "Unknown Argument: $1"
                print_help
                exit 3
                ;;
                esac
                shift
                done

                if [ "$warn_level" == "" ]; then
                echo "No Warning Level Specified"
                print_help
                exit 3;
                fi

                if [ "$critical_level" == "" ]; then
                echo "No Critical Level Specified"
                print_help
                exit 3;
                fi

                count=`ps -ef | wc -l`

                ###################

                if [ "$count" -lt "$warn_level" ]; then
                echo "Process OK:$count | 'Process' =$count;$warn_level;$critical_level"
                exit 0;
                elif [ "$count" -ge "$warn_level" ] && [ "$count" -le "$critical_level" ]; then
                echo "Process WARNING: $count | 'Process'=$count;$warn_level;$critical_level"
                exit 1;
                elif [ "$count" -gt "$critical_level" ]; then
                echo "Process CRITICAL: $count | 'Process'=$count;$warn_level;$critical_level"
                exit 2;
                fi






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 24 '15 at 14:55









                pravin09

                242312




                242312



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f250883%2fsystem-call-sent-warnings-to-stderr-error-unsupported-option-bsd-syntax%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

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay