[ZBXNEXT-4076] Use a controlling socket instead of signals for controlling the zabbix subsystem Created: 2017 Sep 01  Updated: 2018 Apr 11

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: None

Type: Change Request Priority: Major
Reporter: Andrea Biscuola (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: control, runtime, server
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Actually, for controlling the zabbix server at run-time, zabbix use a signal subsystem that is linux specific (for example you can't control zabbix at runtime on other operating systems).
Being zabbix also used outside of Linux (and I know a lot of cases for it), the proposal is to replace the signal-based control mechanism with a socket-based one. This will allow:

  • Safety, as signal handlers interrupt the normal flow of the program (in particular, zabbix is not completely safe on the syscall handling for this).
  • Flexibility: It will be possible to implement in a future complex controlling behaviors (like statistics on stdout regarding the server performances).
  • Portability: All the systems where zabbix compile support the standard sockets interfaces.

My idea is to have a separated utility (named like "zabbixctl"), that take care of the communication with the server and whatnot and report to the user if required (numbers, if the operation was successful etc).



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2017 Sep 01 ]

Voted. The only thing I don't like is a separate utility. It needs to be installed separately (which may be an issue in some environments) and it's kinda weird to have Zabbix but not have control over it. How is zabbixctl different from zabbix_<something> -R?

Comment by Andrea Biscuola (Inactive) [ 2017 Sep 01 ]

glebs.ivanovskis We already install the zabbix_get, zabbix_sender utilities. Out of the name (just preferences) that in this case is just an example, keeping the utility code separated is more a matter of keeping the server code clean and making it easier to do something like:

zabbix_<whatever> log verbose

or

zabbix_<whatever> show stats

Without adding the code to the (already) big codebase of the server. It's more semantic separation than anything else. But any approach will do the job anyway

Comment by Евланов Александр Викторович [ 2018 Jan 29 ]

I think it will be reasonable to use some platform-independent MQ to send commands to zabbix components. For example, ZMQ is very small library that can be compiled in each unix and on Windows as well.

So we need to simply create 1 queue for every zabbix component running on the server: for example. we can send proxy control commands to zabbix-proxy-NNN queue (where NNN is a unique instance id in the system) and agent control commands - to the zabbix-agent-YYY queue. Instance id can be stored in any place defined by the service configuraton file (zabbix_[proxy,server,agentd].conf).

Comment by Andrea Biscuola [ 2018 Apr 11 ]

Actually zabbix already have an internal library for performing
IPC operations. As a starting point it could be a good idea to
just be able to control the server and maybe, if it tuns out that
the feature is flexible enough and useful, extend it to control
other areas of the subsystem.

Generated at Fri Apr 19 21:59:16 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.