-
Incident report
-
Resolution: Fixed
-
Minor
-
1.8.10
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:
- 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:
- 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.