Skip to content
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

[zabbix-community/zabbix] Agent 2 Plugin Configuration of Plugin Options #22

Closed
MaxDiOrio opened this issue Jan 5, 2023 · 3 comments
Closed
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested wontfix This will not be worked on

Comments

@MaxDiOrio
Copy link

There doesn't seem to be a way to modify the plugin configuration options in the helm chart. There are no helm values exposed, and no way to mount configmaps into the container.

E.g.: I am attempting to use the Postgres plugin to monitor a database. I want to use a custom query, however there is no default value set for Plugins.Postgres.CustomQueriesPath, and no way to adjust the path when the agent is deployed using the Helm chart that I can see.

@aeciopires aeciopires self-assigned this Jan 8, 2023
@aeciopires aeciopires added the documentation Improvements or additions to documentation label Jan 8, 2023
@aeciopires
Copy link
Member

Hello @MaxDiOrio !

Thanks for your question.

According to these documentation links... I understood that the Plugins.Postgres.CustomQueriesPath parameter is a setting from the zabbix_agent2.conf file, right?

Therefore, you can use the following helm values ​​to add custom settings on the agent and mount a file in the pod. Creating the configmap to mount can be accomplished using the Kubernetes yaml manifest or the kubectl command.

# **Zabbix Agent** configurations
zabbixagent:
  # -- Enables use of **Zabbix Agent**
  enabled: true
  # -- Extra environment variables. A list of additional environment variables. See example: https://github.com/zabbix-community/helm-zabbix/blob/master/charts/zabbix/docs/example/kind/values.yaml
  extraEnv: []
  # -- additional volumeMounts to the zabbix agent container
  extraVolumeMounts: []

Your need is an advanced configuration and we understand that you must have knowledge to execute.

References:

Zabbix-Agent2

Postgresql

Extraenv

Extraparameters

@aeciopires aeciopires added help wanted Extra attention is needed question Further information is requested wontfix This will not be worked on labels Jan 8, 2023
@aeciopires aeciopires mentioned this issue Jan 8, 2023
@sa-ChristianAnton
Copy link
Contributor

I think the solution should be easy, without having to override the entire zabbix-agent2.conf, as since Zabbix 6.0 it is possible to phase out Plugins configuration options to Included config file snippets, as with all other configuration settings. This was not possible for Plugin..... settings before 6.0.

The entrypoint of the zabbix-agent2 image does even have a directory prepared for that: /etc/zabbix/zabbix_agent2.d/plugins.d/*.conf: https://github.com/zabbix/zabbix-docker/blob/35d3837b0d5ad6a1c1d9b435734550115a867955/Dockerfiles/agent2/alpine/docker-entrypoint.sh#L183

So, a working solution could look as follows (untested):

kind: ConfigMap
apiVersion: v1
metadata:
  name: postgresql-agent2-config
data:
  postgresql.conf: |
    Plugins.Postgres.CustomQueriesPath=/etc/zabbix/postgres/sql

You can then define an extraVolume from within the "zabbixserver" or "zabbixproxy" section of the values.yaml:

zabbixserver:
  extraVolumes:
    - name: agent-postgres-config
      configMap:
        name: postgresql-agent2-config

This will be changed if #20 gets implemented as commented by me, then you would have to put the above into the zabbixagent section.

And then you can mount this volume inside the Zabbix Agent2 container with the following in your values.yaml:

zabbixagent:
  extraVolumeMounts:
    - name: agent-postgres-config
      mountPath: /etc/zabbix/zabbix_agent2.d/plugins.d

Together with #20 we might set a templating in values.yaml to build these configmaps and mount them into the agent container, like this:

zabbixagent:
  extraAgentPluginConfigs:
    - fileName: postgres.conf
      content: |
        Plugins.Postgres.CustomQueriesPath=/some/path

But this is not implemented yet.

Can we close this issue then?

@aeciopires
Copy link
Member

Closing this issue because passed a one year without feedback. You can reopen if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants