Ad Widget

Collapse

UserParameter problem on Zabbix_agentd 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Buzz
    Junior Member
    • Aug 2007
    • 17

    #1

    UserParameter problem on Zabbix_agentd 2.0

    Hi,

    I just upgraded Zabbix from 1.8.8 to 2.0.0.

    The server works fine, except that it sets as "unsupported" all the items linked to a userparameter.

    I created a test userparameter, that calls a script which only echoes a number (57).
    When I run zabbix_agentd -p, it display "test [t|57]"
    So it succeeds to execute my script... But on the server side, it says that the test item isn't supported..

    And I have this same behaviour with each userparameter..

    Any clue would be highly appreciated !

    Regards,
    Buzz.
  • piet
    Junior Member
    • Jun 2012
    • 8

    #2
    same for me

    UserParameter=abc,shellscript(x)

    example: UserParameter=test_1,ping -c3 192.168.1.1

    if i do zabbix_get abc it doesnt work (item unsupported), if i do zabbix_get shellscript(x) it works

    Comment

    • Buzz
      Junior Member
      • Aug 2007
      • 17

      #3
      indeed !

      Yes Piet, you're right !

      In my agent config file, I have

      UserParameter=cpu.iowait,/home/zabbix/bin/cpu.iowait.bsh

      In the Zabbix GUI, I configured the item with :
      type = External check
      key = cpu.iowait.bsh[]

      and it works this way...

      Could somebody from the Zabbix team confirm that it's the normal way of doing it... or if it is a little bug... before I start upgrading the agent on all my clients ?

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        Originally posted by Buzz
        Yes Piet, you're right !

        In my agent config file, I have

        UserParameter=cpu.iowait,/home/zabbix/bin/cpu.iowait.bsh

        In the Zabbix GUI, I configured the item with :
        type = External check
        key = cpu.iowait.bsh[]
        i don't believe it works as you expect it to work... external checks are executed by the server. if you actually want to use userparams, type must be agent or agent (active)
        Zabbix 3.0 Network Monitoring book

        Comment

        • Buzz
          Junior Member
          • Aug 2007
          • 17

          #5
          Oups ! OK !

          But when I turn it to "Agent" or "Agent (active)", it switches to "Unsupported".

          What am I missing ? is there some option to activate in the agent or server's config files ?

          Looks really weird, because when I run zabbix_agentd -p, it shows the item as supported...

          Comment

          • Gunsthall
            Junior Member
            Zabbix Certified Specialist
            • Jul 2011
            • 15

            #6
            Permissions?

            It may sounds stupid but ... are you sure execution permissions were not changed when you upgraded? Take a look, just in case.

            Comment

            • Buzz
              Junior Member
              • Aug 2007
              • 17

              #7
              Hi Gunsthall,

              I double-checked the permissions on the script that's called by my item, but it's OK : the zabbix user can read and execute it..

              I even changed my agent's configuration file so that it runs as root. And even so, the problem remains.

              So I don't think it's a permission problem.

              I created a new agentd configuration file from the templates delivered with Zabbix 2.0. But it doesn't solve the issue...

              When I run zabbix_agentd -p , it shows my item as supported, but when I launch the agent with debuglevel=4, the agent's log says :

              2163:20120620:090753.418 Processing request.
              2163:20120620:090753.418 Requested [cpu.iowait[]]
              2163:20120620:090753.418 Sending back [ZBX_NOTSUPPORTED]

              and if I test my item with zabbix_get, I get the correct value for the item...

              I'm running out of ideas...
              Last edited by Buzz; 20-06-2012, 09:53.

              Comment

              • piet
                Junior Member
                • Jun 2012
                • 8

                #8
                Originally posted by richlv
                i don't believe it works as you expect it to work... external checks are executed by the server. if you actually want to use userparams, type must be agent or agent (active)
                Maybe i have requested the wrong way. The server requests the data - thats obvious. How do i get the data.last(0) from the database. If i use the ping in a map to describe a connection with "live"-data i want to get from the database not from the client itself.

                In zabbix 1.8.x i used something like server.userparameter.last(0) to get this and this seems not to work in 2.0

                Comment

                • jessi
                  Junior Member
                  • Apr 2010
                  • 3

                  #9
                  hi all.

                  not sure what the issue is but im having the same problem with 2.0..
                  no UserParameter i try is working for me..

                  i have:

                  UserParameter=test,cat test.txt

                  which is simply a file with a 0 in it..
                  but nothing i try seames to get this to work.

                  zabbix_get always returns ZBX_NOTSUPPORTED
                  permissions are fine and what im trying to do is just confirm a simple test works...

                  Comment

                  • richlv
                    Senior Member
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Oct 2005
                    • 3112

                    #10
                    Originally posted by jessi
                    UserParameter=test,cat test.txt
                    you assume test.txt is in the current directory, which is not the case. try something like:

                    Code:
                    UserParameter=test,echo 13
                    UserParameter=test,cat /full/path/to/test.txt
                    Zabbix 3.0 Network Monitoring book

                    Comment

                    • jessi
                      Junior Member
                      • Apr 2010
                      • 3

                      #11
                      Sorry i should have been clearer..

                      i am doing that..

                      ####### USER-DEFINED MONITORED PARAMETERS #######
                      UserParameter=test,cat /opt/zabbix/test

                      i have a script that echo's a 0 to this file if certain conditions are met.

                      permissions are as so..

                      -rwxrwxrwx 1 zabbix zabbix 2 Aug 14 12:39 test

                      from what i see it would appear that nothing i add to the agentd.conf is being interpreted.. "this should have been my first clue"

                      so i have just now created a new one and recompiled zabbix 2.0 from scratch.."server and agent"

                      i seam to remember that during compile time i had to stipulate the conf path..
                      and i think thats were it has gone wrong..

                      by default its in /usr/local/etc/
                      changing it there seams to have fixed the issue..
                      although i did stipulate the confs location...

                      [root@zabbix zabbix]# zabbix_get -s localhost -k test
                      0

                      so rtfm saves the day...
                      im not to proud to mention this has taken me 4 hours...

                      now to setup the items and triggers.

                      thanks for the assist..

                      Comment

                      • Buzz
                        Junior Member
                        • Aug 2007
                        • 17

                        #12
                        sorry to come back with this, but for me it just does not work..
                        All my userparameters became unsupported when I upgraded to 2.0.

                        Here are the tests I did :

                        I have the agent's config file in the default location : /usr/local/etc
                        I contains the following userparameter :
                        UserParameter=test,echo 57

                        - I'm sure the agent uses this configuration file, because when I rename it, the agent refuses to start.

                        - when I run
                        zabbix_agentd -p | grep -i test
                        I get
                        test [t|57]

                        - when I run
                        zabbix_get -s localhost -k test
                        I don't get any result. But if I replace localhost with the IP of the machine, I do get 57

                        so the agent seems to be able to run my test.

                        But when I try to monitor this item on server, I always get the following line in the server log :
                        item [Kermit:test[]] became not supported: ZBX_NOTSUPPORTED

                        And if a downgrade the agent to 1.8, the problem disappear.

                        On the server side, the item is defined as follow :
                        type = I tried Zabbix agent (active), Zabbix agent, External check
                        type of information = numeric unsigned

                        I also checked that the agent and server were both in version 2.0.

                        I'm pretty sure I did something obviously stupid somewhere.. but I just can't find it out...

                        Thanks in advance for any idea !

                        Comment

                        • mbsit
                          Senior Member
                          • Sep 2012
                          • 130

                          #13
                          Are you sure that:

                          -k test
                          is the same as:

                          Key test[]

                          If you don't want to use parameters in scripts, do not use bracket in Key of item.

                          Bests,
                          Grzegorz
                          Pozdrawiam
                          Grzegorz Grabowski
                          ____
                          WdroĊĵenia, szkolenia, umowy serwisowe
                          Warszawa - Polska

                          Comment

                          • piet
                            Junior Member
                            • Jun 2012
                            • 8

                            #14
                            v2.0.0 vs v.2.0.2

                            Buzz,

                            Have you upgraded ? That solves the problem for me.

                            rgrds

                            Comment

                            • Buzz
                              Junior Member
                              • Aug 2007
                              • 17

                              #15
                              Hi Mbsit, Piet

                              thanks for your answers.

                              Mbsit : indeed I'm not sure test[] is the same as -k test...
                              I tried to replace test[] by test , but it doesn't solve the issue.

                              Piet, thanks for the suggestion. I'm gonna upgrade... but not today, since I'm on holiday starting tonight..

                              I'll upgrade this thread as soon as I complete the upgrade.

                              Kind regards,
                              Buzz

                              Comment

                              Working...