Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-1117

Remote command truncated to 244 characters

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • 1.6.2
    • Agent (G), Server (S)
    • Tested on RHEL AS 3 & 4

      When running a remote command from an action it is truncated to 244 characters.

      Seen that OPERATIONS.LONGDATA, where the command is stored, is VARCHAR2(2048) but it produces an error when running commands longer than 244 characters.

      Example:

      1.- Working command:

      Remote command:

      {HOSTNAME}: /usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s {HOSTNAME} -k <trapper> -o "Short text `<command_that_produces_an_output>`"
      

      zabbix_agentd.log:

      3081:20091008:133401 Requested [system.run[/usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s {HOSTNAME} -k <trapper> -o "Short text `<command_that_produces_an_output>`",nowait]]
      3081:20091008:133401 Run command '/usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s {HOSTNAME} -k <trapper> -o "Short text `<command_that_produces_an_output>`"'
      3081:20091008:133401 Sending back [1]
      

      2.- Non-working command:

      Remote command:

      {HOSTNAME}: /usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s {HOSTNAME} -k <trapper> -o "Very long text inserted to exceed 244 characters `<command_that_produces_an_output>`"
      

      zabbix_agentd.log:

      3083:20091008:133514 Requested [system.run[/usr/local/sbin/zabbix_sender -z <zabbix_server> -p 10051 -s {HOSTNAME} -k <trapper> -o "Very long text inserted to exceed 244 characters `<command_that_produces_an_o]
      3083:20091008:133514 Sending back [ZBX_NOTSUPPORTED]
      

      Found that DB field ITEMS.KEY_ is limited to 255 characters. Extended to 1024 to leave enough room for commands and changed ITEM_KEY_LEN in zabbix-1.6.2/include/db.h from 255 to 1024

      #define ITEM_KEY_LEN 1024
      

      Characters from 244 to 255 may be used for control or similar?

            Unassigned Unassigned
            luissma Luisma Arranz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: