Ad Widget

Collapse

UserParameter does not work in 1.6.[1,2]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bogdar
    Member
    • Jan 2009
    • 33

    #1

    UserParameter does not work in 1.6.[1,2]

    # grep usern.num /etc/zabbix/zabbix_agentd.conf
    UserParameter=usern.num,who|wc -l

    # zabbix_agentd -t usern.num
    usern.num [t|1]

    # zabbix_agentd -t agent.version
    agent.version [s|1.1.4]

    After update:

    # zabbix_agentd -t agent.version
    agent.version [s|1.6.2]

    # zabbix_agentd -t usern.num
    usern.num [m|ZBX_NOTSUPPORTED]

    Same behavior with 1.6.1.

    Debian GNU/Linux 4.0 amd64 2.6.18
  • radamand
    Member
    • Aug 2008
    • 89

    #2
    and what do you get when you execute "who | wc -l" on the host machine (logged in as the zabbix user)??

    Comment

    • bogdar
      Member
      • Jan 2009
      • 33

      #3
      Originally posted by radamand
      and what do you get when you execute "who | wc -l" on the host machine (logged in as the zabbix user)??
      zabbix@etch-test:~$ who |wc -l
      1

      Comment

      • n0name
        Junior Member
        • Jul 2008
        • 11

        #4
        You should use internal item system.users.num (Zabbix agent).

        I don't have any problem with User Parameters in version 1.6 and 1.6.1

        Comment

        • bogdar
          Member
          • Jan 2009
          • 33

          #5
          Originally posted by n0name
          You should use internal item system.users.num (Zabbix agent).

          I don't have any problem with User Parameters in version 1.6 and 1.6.1
          I need User Parameters to run my own scripts, but it soe not works even for simple example from config.

          Comment

          • radamand
            Member
            • Aug 2008
            • 89

            #6
            All I can suggest is to make sure that;

            1) the zabbix user has the correct path and permissions to execute the 'who'
            2) make sure the item is 'Active' in zabbix

            if those are correct, try setting up a NEW userparameter that just does "echo 1".

            I use a 'test' parameter that just cat's the contents of a file in /tmp for testing out items, triggers, actions, parsing, etc...

            Comment

            • bogdar
              Member
              • Jan 2009
              • 33

              #7
              Hello.
              It work strange in 1.6.*
              User params work from zabbix server ir zabbix get, but fails with zabbix_agentd -t

              In 1.1.4 zabbix_agentd -t works too.

              Comment

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

                #8
                you (i guess it was you ) disappeared from irc before telling whether you had solved this problem.
                according to svn logs, it was fixed for 1.6.1...
                Code:
                $ svn log -r 6205 trunk/ChangeLog
                ------------------------------------------------------------------------
                r6205 | sasha | 2008-10-17 09:46:08 +0300 (Fri, 17 Oct 2008) | 2 lines
                
                 - [ZBX-563] added support of user parameters with -t option
                
                ------------------------------------------------------------------------
                $ svn diff -c 6205 trunk/ChangeLog
                Index: trunk/ChangeLog
                ===================================================================
                --- trunk/ChangeLog     (revision 6204)
                +++ trunk/ChangeLog     (revision 6205)
                @@ -5,6 +5,7 @@
                
                 Changes for 1.6.1
                
                + - [ZBX-563] added support of user parameters with -t option (Sasha)
                  - [ZBX-562] fixed improper host group delete action (Artem)
                  - [ZBX-527] fixed possible poller crash (Sasha)
                  - [ZBX-533] fixed incorrect SNMP string to float conversion (Sasha)
                ok, but somehow that isn't in release notes, or in currently available 1.6 branch/trunk changelogs. now how could that happen ?

                Code:
                $ svn diff -c 6246 trunk/ChangeLog
                Index: trunk/ChangeLog
                ===================================================================
                --- trunk/ChangeLog     (revision 6245)
                +++ trunk/ChangeLog     (revision 6246)
                @@ -13,7 +13,6 @@
                  - [ZBX-573] made SQL optimization for PGSQL (Artem)
                  - [ZBX-570] fixed possible server crash if flexible interval delay is 0 sec. (Sasha)
                  - [ZBX-565] fixed filtering of conf->triggers (Artem)
                - - [ZBX-563] added support of user parameters with -t option (Sasha)
                  - [ZBX-562] fixed improper host group delete action (Artem)
                  - [ZBX-527] fixed possible poller crash (Sasha)
                  - [ZBX-533] fixed incorrect SNMP string to float conversion (Sasha)
                that commit didn't have anything listed in the changelog regarding a bit vague message "misc bugs"

                Code:
                $ svn log -r 6246 trunk/ChangeLog
                ------------------------------------------------------------------------
                r6246 | sasha | 2008-11-04 16:40:32 +0200 (Tue, 04 Nov 2008) | 2 lines
                
                 - [DEV-137] misc bugs, windws binaries
                
                ------------------------------------------------------------------------
                so this problem should be solved in 1.6.1, and it is for me.
                Zabbix 3.0 Network Monitoring book

                Comment

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

                  #9
                  ok, this is wicked.
                  Code:
                  $ svn diff -c 6243
                  Index: src/zabbix_agent/zabbix_agentd.c
                  ===================================================================
                  --- src/zabbix_agent/zabbix_agentd.c    (revision 6242)
                  +++ src/zabbix_agent/zabbix_agentd.c    (revision 6243)
                  @@ -254,6 +254,8 @@
                  
                          init_collector_data();
                  
                  +       load_user_parameters();
                  +
                          /* --- START THREADS ---*/
                  
                          if(1 == CONFIG_DISABLE_PASSIVE)
                  @@ -364,8 +366,6 @@
                          if (ZBX_TASK_START == t.task || ZBX_TASK_INSTALL_SERVICE == t.task || ZBX_TASK_UNINSTALL_SERVICE == t.task || ZBX_TASK_START_SERVICE == t.task || ZBX_TASK_STOP_SERVICE == t.task)
                                  load_config();
                  
                  -       load_user_parameters();
                  -
                   #if defined (_WINDOWS)
                          if (t.flags & ZBX_TASK_FLAG_MULTIPLE_AGENTS) {
                                  zbx_snprintf(ZABBIX_SERVICE_NAME, sizeof(ZABBIX_SERVICE_NAME), "%s [%s]", APPLICATION_NAME, CONFIG_HOSTNAME);
                  
                  
                  $ svn log -r 6243
                  ------------------------------------------------------------------------
                  r6243 | sasha | 2008-11-04 16:24:35 +0200 (Tue, 04 Nov 2008) | 2 lines
                  
                   - [DEV-137] misc bugs
                  ------------------------------------------------------------------------
                  in short, fix itself was removed some revisions later as well...
                  this is why i don't like such vague commit messages
                  as you can see, 'misc bugs' only did a single change - and that is, it only reverted fix from rev 6205 (these are trunk revs, they somewhat differ for 1.6 branch).

                  as a result, it seems that no 1.6 release works completely with user parameters...

                  any comments why was the fix reverted, was that done on purpose ?
                  Zabbix 3.0 Network Monitoring book

                  Comment

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

                    #10
                    at first i wrote this for the relevant bugreport, but then i decided it's not an appropriate place.
                    while this might sound a bit ranty, i don't mean to offend anybody, just suggesting something to reduce chance of such probleams appearing in future.

                    what somewhat gets me - commit message for both reversals. "misc bugs".
                    well, at least it's partially correct - it indeed does create a bug ;>
                    while svn does not allow separate commits for large chunks of offline work, it would help a lot in future to vigorously enforce _descriptive_ commit comments.
                    often i'm looking at svn log with a silly smile, because of a commit message like that one.
                    such a policy would make devs actually think "ok, now what was that i did on this file... i don't remember for sure, let's do svn diff... OHDAMN, that's just plain wrong".
                    Zabbix 3.0 Network Monitoring book

                    Comment

                    • rts
                      Member
                      • May 2007
                      • 54

                      #11
                      Is there anything we can learn from this? Does Zabbix have an automated test suite that they run against releases? I've just battled for a few hours before discovering this forum post, so I'm a little irritated.

                      Comment

                      • BillSmithCTL
                        Junior Member
                        • Feb 2010
                        • 2

                        #12
                        UserParameter works in 1.4.6 [not in 1.6.8 or 1.8]

                        New to Zabbix. On a Solaris 10 sparc system, UserParameters did not work on v1.6.8 (complied from src) or v1.8 (precompiled agents). I compiled the v1.4.6 from src and the UserParameter's worked fine.

                        Comment

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

                          #13
                          please define "did not work" - what exactly did you try ?
                          Zabbix 3.0 Network Monitoring book

                          Comment

                          • BillSmithCTL
                            Junior Member
                            • Feb 2010
                            • 2

                            #14
                            UserParameter works in 1.4.6 [not in 1.6.8 or 1.8]

                            > please define "did not work" - what exactly did you try ?

                            SunOS 5.10 Sunfire v440 sparc

                            zabbix_agentd -t did not work v1.6.8 (from src) or v1.8 (pre-compiled)

                            Tried ksh scripts owned by zabbix:zabbix that zabbix userid ran fine.
                            Changed scripts to ksh scripts.
                            Moved scripts around -- /export/home/zabbix /usr/local/bin/
                            Converted one script to be self contained (no parameters passed in)
                            Tried straight, simple example
                            UserParamanter=test, echo 1
                            Tried restarting zabbix_agentd and that did not help.

                            They all got [m|ZBX_NOTSUPPORTED]

                            [zabbix@mgtl1net ~]$ zabbix_agentd -t test
                            test [m|ZBX_NOTSUPPORTED]


                            Compiled v1.4.6 from src (no precompiled agents available)

                            All UserParameter worked with no changes

                            [zabbix@mgtl1net ~]$ zabbix_agentd -t test
                            test [t|1]

                            zabbix_agentd --print showed the results from all defined UserParameter

                            Hope that helps. Bill

                            Comment

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

                              #15
                              hehe. why, yes... did you read zabbix_agentd --help ?
                              Zabbix 3.0 Network Monitoring book

                              Comment

                              Working...