-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify Zabbix python librairies #197
Comments
About It allow to parse the agent config file and directly extract the data needed to send package. |
Such helper function can naturally be added, but I personally prefer not to embed this in the Sender class. Maybe something like: from pyzabbix import Sender, parse_zabbix_servers_from_config
sender = Sender(servers=parse_zabbix_servers_from_config())
sender = Sender(servers=parse_zabbix_servers_from_config("my/custom/path.conf")) Though, I wonder how to handle the new HA notation (in zabbix >= 6.0) for picking the right server. |
Good question, it's a tad hard to immerse in the C code from the agent... Maybe those part would be relevant to the question:
I would tend to think you cannot select the "right" server and either try to send to each one ensuring you should have at least one in each "cluster" that works, but I'm not fully "sure" per se. And yes it does not need to be necessarily embed inside the Sender, It could be even more abstract, something like from pyzabbix import Sender, Config
config = Config(file="my/custom/path.conf")
sender = Sender(servers=config.servers_active) So you can reuse the Config module if you need it for another module ? Ex: local requests with |
I like this idea of parsing extra details from the config file. I think @szuro has a better idea what else could be queried from there. |
I'll probably ditch The lib is updated by hand, but i have a simple Zabbix doc differ, so I know what changed between versions.
Ad I originally didn't want to embed it in the Sender class, but instead make a Parent class for both Sender and Agent, as both of them have a use for the config file. What can be extracted:
So a bunch of things really.
Maybe this would work better:
As to electing the Active Zabbix server. |
My two cents: Personally I've been using this project only to interface with the API, which is what it is supposed to do: Line 3 in 511e3a3
I like that the project is simple and only does this. Adding other features like zabbix-sender seems out of scope for me. I'm sure other projects could do that just fine? I'd like this project to continue to be an API interface, and an API interface only. So I'd suggest not expanding this current scope. As I final note I'd like to quote from the unix philosophy:
I feel that this is what this project currently does very well. Merging other features will just add unnecessary complexity. |
So, it's been a while since this started. I don't think we should merge anything in the heat of the moment just to break it later... |
Hey @szuro, My understanding is that people are looking for a zabbix sender, and only find the project at https://github.com/adubkov/py-zabbix. The adubkov/py-zabbix project haven't seen any release/changes merged since 2020, and one might assume it is dead. Until we find a magical solution, I think we should add a link to the I do agree that we might want to follow the Unix philosophy, and make sure both projects (https://gitlab.com/szuro/zappix and https://github.com/lukecyca/pyzabbix) play nice with each other. In any case, if we were to merge more code in this project, I would need the authors of this code to help me maintain it. But I haven't heard from @lukecyca about granting @szuro maintainer permissions, nor giving me permissions to fully manage this project. I don't have time to work on such changes, this might explain a bit why I now lean towards the "do one thing, do it well" philosophy. |
@jooola This is a very good idea, but think about the users. People have been using py-zabbix for years now, a bunch of automations and integrations with other systems have already been developed based on this library. Maybe someone will not like it, but I'll tell it like it is. People are switching from py-zabbix to pyzabbix because py-zabbix stopped supporting authorization. They want to see the same functionality that the "Sender" module included, but it just doesn't exist. If you want to make a more advanced library, then it's probably better to do it with a different name. The associative array that people get when they hear pyzabbix/py-zabbix is related to already established functionality. Now people are experiencing dissonance in connection with this. Therefore, I think that you just need to add "Sender" to pyzabbix, and develop new functionality as part of a new project. This is just my opinion. Maybe I don't see the whole picture. |
mmmh if @szuro https://gitlab.com/szuro/zappix works fine and is compatible with current "pyzabbix", we can just use it too (or add it in the doc for people looking for it), the only problem with multiple project owned by different maintainer is just that if it become "abandonned" it's hard to merge... while if it's one lib, the code is directly "built" to be compatible... (no incompat' between different lib usage for instance). After it's just a question of "maintability" versus "lib size/complexity", afaik there's no right answer, just a personnal choice for this :) |
|
I've previously mentioned this, but again: I'd say that it's obvious that the HTTP-API and zabbix-sender/zabbix-protocol has nothing to do with each other. I'd put that in another project. I totally agree that this project should stay simple and just interface with the HTTP-API 👍 |
So after reading all the comments, this i my current take: pyzabbix and zappixLeave zappix and pyzabbix as seperate packages, as their domains do not overlap. People migrating from py-zabbix might think that's the case, but they'd be wrong.
Hell, you could just copy the source from py-zabbix and call it a day. But I think it would be for the best to just point people to zappix. pyzabbix and zabbix-enumszabbix-enums was meant to be a part of pyzabbix from the very beginning. When developing it, I decided against it - people were still using py-zabbix back then an wouldn't be able to benefit from said enums. zabbix-enums and pyzabbix would play nicely together and I think it would actually make sense to merge them. |
Related to lukecyca#197
* docs: add link to zappix project Related to #197 * more links and fmt * remove gitlab link as the package already reference this.
In order to fix #164, I though we could reach feature parity with https://github.com/adubkov/py-zabbix and unify the work effort into a single project. This would have allowed us to fix this namespace issue.
@szuro reached out and proposed to merge his own projects instead of https://github.com/adubkov/py-zabbix. See discussion at #194 (comment)
The plan would be to merge https://github.com/szuro/zabbix-enums and https://gitlab.com/szuro/zappix into this project.
I don't have much time to put into merging all the projects, but I can do some work once we planned everything.
Before all, we should agree on the development process:
Merge zabbix enums in the api namespace
I think we can start by merging the enum library in the project, as the changes does not seem to require much thinking apart from naming.
I wonder if we want to keep the
enums
namespace, or have a more generic namespace such astypes
ortyping
?We could have the following structure:
@szuro Are there any breaking changes you intend to do will the enums library is merged ?
Is this library automatically generated ? Is there a way to generate it ?
Merge zappix in the pyzabbix namespace
First, apart from fixing #164, what does this merge bring/fix ? Is there any way we could fix this without having to merge the projects ? I prefer to ask, so we don't dive into a whole lot of work without a well defined goal.
Maybe both libraries should stay separated but each can be maintained under the same umbrella, advertising/linking to the other project for missing features.
That being said, we might bloat the project with dependencies while some people might only want to use the API client. So I was thinking, maybe we want to hide the added features behind a extra flag such as
pyzabbix[sender]
?Regarding the proposed namespace in #194 (comment)
wrapping everything in a network namespace seem overkill, maybe we simply want to have
pyzabbix.sender
andpyzabbix.agent
(I am probably missing some packages ?) We can always have a shared private namespace for network related code inpyzabbix._network
for shared protocols/socket/...How could we split the merge into smaller parts ? Can the agent and sender be merged independently ?
I probably missed a few points.
cc @szuro
The text was updated successfully, but these errors were encountered: