Ad Widget

Collapse

[1.6] zabbix_sender ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    [1.6] zabbix_sender ?

    Hi

    I am trying to use a trapper on 1.6.
    If I replace the old zabbix_sender with the new one using
    the same syntax, I simply get this error message:
    Code:
    usage: zabbix_sender [-Vhv] {[-zpsI] -ko | [-zpI] -i <file>} [-c <file>]
    My script calls:
    Code:
    ./zabbix_sender --key check_ldap_resptime --value 0.034911 -c $HOME/ZABBIX/zabbix-1.6/misc/conf/zabbix_agentd16.conf
    Using the old (1.4.6) zabbix_sender with the same configuration file and syntax there is no such error message.
    It simply works.
    It's the same if I use the short options.
    Using a textfile with the values included didn't change anything.

    Did something change in the usage ?

    Regards

    Norbert.
  • mcvella
    Junior Member
    • Oct 2008
    • 1

    #2
    Other undocumented changes to Zabbix sender?

    In response to the first post, it appears that the -z (server) option is now a required command line option - I was using zabbix_sender 1.4 with an input file, where each line specified the server option and therefore was not previously specifying in on the command line. This change is not clearly documented.

    Secondly, it appears that the expected format for input files has changed! Although the help message and Zabbix 1.6 documentation still state that each line should be:

    <zabbix_server> <hostname> <port> <key> <value>

    it appears that the actual 1.6 expected format is:

    <hostname> <key> <value>

    It took me a while to figure this out, I finally did by looking in the zabbix_sender source code.

    The fact that this is not documented properly is a bug and should be fixed! I'm not sure if there is a better way to contact the Zabbix project in order to get this addressed.

    (this is not to mention the fact that these changes will probably break a lot of scripts that rely on zabbix_sender in the case of upgrade!)

    Comment

    • Tenzer
      Senior Member
      • Nov 2007
      • 316

      #3
      Originally posted by mcvella
      I'm not sure if there is a better way to contact the Zabbix project in order to get this addressed.
      You could create a bug about this on the issue tracker at https://support.zabbix.com/, I suppose they prefer to get it through there, otherwise the team probably wouldn't have made it public

      Comment

      • NOB
        Senior Member
        Zabbix Certified Specialist
        • Mar 2007
        • 469

        #4
        Hi

        thanks for the answers.
        It's right, you have to pass the "-z server" option and the format of the
        file changed, too.

        Unfortunately, the argument this change will break all old scripts is true.

        EDIT: The option -z server should be optional, i.e. as long as -c configfile is used and the Server is
        defined in there, fine. IMHO, this is not just a documentation bug !

        I think this might be introduced by the changes for the more efficient sender - transmission
        of several values in one connection.

        Question is: who uses / needs it ?

        Why not support the old and the new options ?
        Add one more option to specify old / new behaviour ?

        Hope it's read.

        Regards

        Norbert.
        Last edited by NOB; 14-10-2008, 12:43. Reason: Thought about how to do it right

        Comment

        • NOB
          Senior Member
          Zabbix Certified Specialist
          • Mar 2007
          • 469

          #5
          Patch for usage

          Hi

          I did take a look at the source code and modified it,
          so that the old commandline usage is still OK.

          However, you still have to modify the file format to use the 1.6 zabbix_sender, though.

          You can override the settings in the config file by the settings on the command line.
          This was and still is the current implementation.
          The patch simply removes the requirement
          that the ZABBIX-Server (option -z) must be passed on the command-line.
          It will complain, if ZABBIX-Server is set neither on the command-line nor in the config file, anyway.

          Here is the patch - it just removes the obsolete check for the
          ZABBIX_SERVER in command-line processing.
          Code:
          --- zabbix_sender.c.orig        Thu Sep 18 22:15:26 2008
          +++ zabbix_sender.c     Tue Oct 14 13:03:47 2008
          @@ -360,11 +360,13 @@
                                          break;
                          }
          
          +/* TTT
                  if(ZABBIX_SERVER == NULL)
                  {
                          usage();
                          exit(FAIL);
                  }
          +TTT */
          
                  return task;
           }

          HTH,

          Norbert.
          Last edited by NOB; 14-10-2008, 13:34. Reason: More studying of the source code

          Comment

          Working...