Skip to content

New to Zabbix and trying to use this #51

Closed

Description

@astrugatch

Hi,

I'm relatively new to Zabbix so there is a good chance I'm missing something. We monitor most of our hosts via SNMP and don't have the agent installed (mostly because we are still in a testing phase and I don't want an agent left behind if we go another way).

So since we aren't using the agent, I would like to monitor SSL certs on some of the hosted sites via script instead.

I've put the script in /usr/local/bin and made it executable.

I've put the conf file in /etc/zabbix/zabbix_agentd.d

I've imported the basic example template.

But when I go to assign to a host it wants it to be an agent host rather than SNMP. Is the agent required or can I modify the template in some way to make this work in our scenario.

Thanks for your help in advance.

Activity

  1. astrugatch commented on Nov 6, 2024

    @astrugatch
    Author

    reading back over what I wrote and realizing that it obviously requires the agent. sigh. Back to the drawing board.

  2. selivan commented on Nov 6, 2024

    @selivan
    Owner

    @astrugatch You can use the agent on Zabbix server itself, if it has access to hosts and ports that require TLS cert monitoring.

    See the example in zabbix_integration_examples:

    • template_ssl_advanced.xml - zabbix template
    • userparameters_ssl_cert_discovery.conf - userparameters for monitoring agent
    • ssl_cert_list.json - list of hosts, ports and domain names to monitor
  3. astrugatch commented on Nov 7, 2024

    @astrugatch
    Author

    OK. I think I'm 95% of the way there. I've got the JSON filled out and in place, the conf files in place, and the template imported and applied to the Zabbix host. But under discovery rules the status shows as Unsupported item key. instead of enabled.

  4. selivan commented on Nov 7, 2024

    @selivan
    Owner

    @astrugatch Seems that zabbix agent didn't read userparameters from userparameters_ssl_cert_discovery.conf.

    You should place that file somewhere in /etc/zabbix/zabbix_agentd.conf.d or /etc/zabbix/zabbix_agentd.d or whatever Include= directive in your /etc/zabbix/zabbix_agentd.conf says. Than you should restart zabbix agent.

    You can check if userparameter became available by running sudo -u zabbix zabbix_agentd -t ssl_cert_list.
    Running from root without sudo also works, but than you can miss problems like file premissions.

  5. astrugatch commented on Nov 7, 2024

    @astrugatch
    Author

    Thanks for your reply.
    Without changing anything sudo -u zabbix zabbix_agentd -t ssl_cert_list returns my JSON.
    /etc/zabbix/zabbix_agentd.d is the location set by Include=

    Contents of /etc/zabbix/zabbix_agentd.d

    zabbixadmin@zabbix:/etc/zabbix/zabbix_agentd.d$ ls
    ssl_cert_list.json                  userparameters_ssl_cert_discovery.conf
    userparameters_ssl_cert_check.conf
    
  6. astrugatch commented on Nov 7, 2024

    @astrugatch
    Author

    I see in another thread with a similar issue that someone moved the script int /etc/zabbix/zabbix_agentd.d as well. I'm assuming I would need to modify the conf files to match the script location.

  7. astrugatch commented on Nov 7, 2024

    @astrugatch
    Author

    moving the script worked.

    Is the hostname variable in the json the server host name or the host name expected in the certificate? I'm having servers with a wildcard installed returning as invalid.

  8. astrugatch commented on Nov 7, 2024

    @astrugatch
    Author

    Disregard. It's a config issue. Missing an intermediate cert. Browsers don't seem to mind but openssl seems to care.

  9. selivan commented on Nov 7, 2024

    @selivan
    Owner

    {#IPADDR} is network endpoint to connect to looking for certificate(DNS hostname or IP address), {#SSLDOMAIN} is hostname expected in the certificate.

    Glad I could help.

  10. Repository owner locked and limited conversation to collaborators on Nov 7, 2024
  11. converted this issue into a discussion #52 on Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions