-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
3.0.0beta1
Feature request ZBXNEXT-611 adds support for running processes in foreground. This opens some interesting opportunities for user interaction.
For instance (quoting from (14) from ZBXNEXT-611), some programs like "ls" provide "--color" option:
--color[=WHEN] colorize the output; WHEN can be 'never', 'auto', or 'always' (the default); more info below Using color to distinguish file types is disabled both by default and with --color=never. With --color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors command to set it.
We can do similarly and only output the following message if we are connected to a user-controlled terminal:
if (0 != (flags & ZBX_TASK_FLAG_FOREGROUND)) { printf("Starting Zabbix Server. Zabbix %s (revision %s).\nPress Ctrl+C to exit.\n\n", ZABBIX_VERSION, ZABBIX_REVISION); }
Also, as wiper suggested, we can colorize console output, like so:
Idea by sasha is that we can colorize based on message severity level instead.