selivan / https-ssl-cert-check-zabbix

Script to check validity and expiration of TLS/SSL certificate on hosts. May be used with Zabbix or standalone.
Other
291 stars 71 forks source link

discovery rule "SSL Checker:ssl_cert_list" became not supported: Unsupported item key #47

Closed marcuspax closed 7 months ago

marcuspax commented 1 year ago

Getting this error from log: discovery rule "ssl_cert_list" became not supported: Unsupported item key My userparameters file is updated as per #42 Zabbix version 6.0.21

dmfox00 commented 10 months ago

Getting this error from log: discovery rule "ssl_cert_list" became not supported: Unsupported item key My userparameters file is updated as per #42 Zabbix version 6.0.21

Do you have a solution to your problem? I have: Unknown metric ssl_cert_check_expire Unknown metric ssl_cert_check_valid

ogshaggyshawn commented 10 months ago

I am having the same issue. I have followed the steps in the discussion under the topic "Unsupported item key" from Dec 2022. eg

  1. userparameters_ssl_cert_check.conf is in /etc/zabbix/zabbix_agentd.d/
  2. ssl_cert_check.sh is executable and in the location specified in userparameters_ssl_cert_check

Also I have updated userparrameters_ssl_cert_check as per the discussion in https://github.com/selivan/https-ssl-cert-check-zabbix/issues/42 with one minor update: this line

UserParameter=ssl_cert_list[], /bin/cat /etc/zabbix/scripts/ssl_cert_list

caused my zabbix agent to fail with

cannot load user parameters: user parameter "ssl_cert_list[], /bin/cat /etc/zabbix/scripts/ssl_cert_list": syntax error

but

UserParameter=ssl_cert_list[*], /bin/cat /etc/zabbix/scripts/ssl_cert_list

worked (as the other "userparameter" lines in this file also had [*] in them.)

The agent seems to function properly. eg:

sudo -u zabbix zabbix_agentd -t ssl_cert_list 

returns my ssl cert list and

sudo -u zabbix zabbix_agentd -t ssl_cert_check_json[google.com,443]

returns

ssl_cert_check_json[google.com,443] [t|{"expire_days": 38, "valid": 1, "return_code": 0, "return_text": "ok"}]

Unfortunately I am still getting " Unsupported item key"

image


zabbix 6.0.4, zabbix-web 6.0.23 running on rocky linux 9 installed from zabbix YUM repos.

ogshaggyshawn commented 10 months ago

well..... i'm not sure what fixed it, but when I just re-ran discovery this worked. Likely the additional line in the userparameters_ssl_cert_check.conf file for ssl_cert_list.

thanks for the tool selivan !

selivan commented 9 months ago

@marcuspax These zabbix integration templates were committed by another contributor, I never checked them myself.

Now I created docker compose project to test them. Everything works fine for me. Combed up the templates a little.

You may try using sudo -u zabbix zabbix_agentd -t ssl_cert_list and check errors in output and agent logs.

@dmfox00 В чём проблема, какая конфигурация?

@ogshaggyshawn You are welcome ) Sorry fir the delayed answer.

marcuspax commented 9 months ago

@selivan still getting Unsupported item key error, see below snip:

image

selivan commented 9 months ago

@marcuspax This is some kind of misconfiguration. Click red (i) sign to get more information. May be you have wrong permissions on userparameters file, may be it is not in the right place, may be it can not read ssl_cert_list file, or something else.

nmparfyonov commented 8 months ago

Restarting zabbix-agent service helped me to resolve this issue on Zabbix 6.4.0.

systemctl restart zabbix-agent.service
marcuspax commented 7 months ago

I managed to resolve this by putting all scripts here /etc/zabbix/zabbix_agentd.d/.....now all is well.