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

convertion zabbix database to DM setup returns exit code 255 but should return 0

    XMLWordPrintable

    Details

      Description

      I try to automate the zabbix server installation with puppet (www.puppetlabs.com), this works mostly well, only the conversion result has one problem.
      The conversion works as expected, but the command finishes with return code (exit status) 255.
      This is the problem because puppet assumes 0 as return code for successful commands.

      Normally on Unix the return code is 0 on success , only on failure > 0 ,

      Example:

      1. zabbix_server -n 1 -c /etc/zabbix/zabbix_server.conf ; echo $?
        Converting tables ........................................................................................ done.
        Conversion completed.
        255

      Moreover, here I try to again convert already converted database:

      1. zabbix_server -n 1 -c /etc/zabbix/zabbix_server.conf ; echo $?
        Converting tables ................zabbix_server [3641]: Warning: slow query: 2.272360 sec, "update history set itemid=itemid+100100000000000 where itemid>0"
        ........................................................................zabbix_server [3641]: Error: [Z3005] query failed: [1062] Duplicate entry '1' for key 'PRIMARY' [insert into nodes (nodeid,name,ip,nodetype) values (1,'Local node','127.0.0.1',1)]
        zabbix_server [3641]: Warning: slow query: 4.901873 sec, "rollback;"
        done.
        Conversion completed.
        255

      As you see even if I have an failed query I receive the same exit code and it's not very good. I think in this case it should be > 0.
      Final message "Conversion completed" could be customized if I have any failed query.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: