Ad Widget

Collapse

UserParameter Always showing "Not Supported"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rushowr
    Member
    • Jul 2005
    • 30

    #1

    UserParameter Always showing "Not Supported"

    I've got an interesting one for you mates again....

    I'm running zabbix on an asterisk system using userparameters to call asterisk with the -rx (connect, run command, show output, exit) option. my command line is this:

    sudo -H /usr/sbin/asterisk -rx 'show queues' | grep --text -i '901' | awk '{print $3}'

    so in the configuration file it looks like this:

    UserParameter=queuelevel[901], sudo -H /usr/sbin/asterisk -rx 'show queues' | grep --text -i '901' | awk '{print $3}'

    now, when I login AS zabbix user, it returns the number of calls holding in the queue (0 curently for example). It returns ONLY the number.

    Here's the kicker. Zabbix changes the status of this item to "Not Supported" after every check. I have no idea why, and need help as I've got some serious breathing down my neck going on over it.

    Permissions are correct, as I can run it as the zabbix user with no problem.

    Any ideas on this?
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,

    From what I have seen, this happens if your UserParameter check returns more than a single line of data. Additionally, looking at your command, I think part of the problem may be that zabbix_agentd doesn't know where sudo is.

    First thing I would recommend trying is adding the full path to sudo to the UserParameter command. If it still fails, double check that your command is returning only a single line of data.

    Hope this helps
    Unofficial Zabbix Developer

    Comment

    • rushowr
      Member
      • Jul 2005
      • 30

      #3
      Helpful answer

      Hey thanks for the idea. I know it's returning only one line of data, and other UserParameters are using sudo (all of mine do for asterisk monitoring since it's a root only program) and they do not give this error. I'll try the fix, just in case. I'll keep ya posted.

      Thanks again,
      Sherwood

      Comment

      • rushowr
        Member
        • Jul 2005
        • 30

        #4
        Definitely not the problem

        This is definitely not the problem. The script passes data correctly (only one line), and the permissions are correct, and it's only numeric, and explicitly stating sudo is not workig either...

        anyone have any other ideas?

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          Does it have trailing EOL?
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • rushowr
            Member
            • Jul 2005
            • 30

            #6
            As far as I can tell no. GREP only puts out the line that matches the request. I'll try seeing about using sed to strip EOL's if they exist.

            Let me know if this is the right thinking. If I run the script myself and see something like this:

            Code:
            zabbix@someserver#> ./script
            515
            zabbix@someserver#>
            I should be looking at an output that returns no trailing EOL, because otherwise it would look like this:

            Code:
            zabbix@someserver#> ./script
            515
            
            zabbix@someserver#>
            sound right?

            Comment

            • rushowr
              Member
              • Jul 2005
              • 30

              #7
              I definitely have no trailing EOL....

              Any other ideas? This is rather strange...the script outputs just a digit, that's it, just like is needed for UserParameters.

              Is there a bug with returning a 0?

              Need answers, tearing my hair out over this.

              Comment

              • rajeevtomar
                Member
                • Mar 2005
                • 50

                #8
                I would suggest you to write the output of the command in some file then in conf file do a cat on that file.

                this wil help you to debug the problem for sure.

                Please let me know if it helps.

                Zabbix is cool in monitoring the things.

                Regards,
                Rajeev Tomar

                Comment

                • rushowr
                  Member
                  • Jul 2005
                  • 30

                  #9
                  Thanks for the answer, I'll try that.

                  Cheers

                  Comment

                  • xaeth
                    Member
                    • Nov 2004
                    • 67

                    #10
                    i'm having the same issue w/ my qmail monitoring now... it used to run fine, but now it rarely lasts more than a few hours.

                    I monitor 3 files. The script runs the initial query and outputs it to a file, then basically does "grep subject file > newfile". The zabbix agent does a cat of newfile. All 3 agents done in this matter die at basically the same time.


                    There doesnt appear to be any trailing eol. and the output doesnt really change from run to run from what i can see.

                    Comment

                    • tobiasbp
                      Junior Member
                      • Feb 2006
                      • 7

                      #11
                      This may have been fixed ages ago, but I just had the same problem. I solved the problem by changing:
                      awk '{print $3}'

                      to:
                      awk '{print $ 3}'

                      Comment

                      • pattieja
                        Junior Member
                        • Mar 2005
                        • 14

                        #12
                        Returning string instead of integer or float

                        If you run zabbix_agentd -p, what do you see for your returned value? I've been only getting [s|<numeric value>] returns for my UserParameter entries (ZABBIX 1.1beta8).

                        Comment

                        • just2blue4u
                          Senior Member
                          • Apr 2006
                          • 347

                          #13
                          Originally posted by tobiasbp
                          This may have been fixed ages ago, but I just had the same problem. I solved the problem by changing:
                          awk '{print $3}'

                          to:
                          awk '{print $ 3}'

                          I had the same problem.
                          Thanks to your solution (print $ 3) it works quite good now!
                          Thank you!
                          Big ZABBIX is watching you!
                          (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

                          Comment

                          Working...