sensu-plugins / sensu-plugins-ssl

This plugin provides native SSL instrumentation for monitoring, including: hostname and chain verification, cert expiry, and Qualys SSL Labs reporting
http://sensu-plugins.io
MIT License
15 stars 47 forks source link

check-ssl-cert.rb fails on Ubuntu 20.04 #97

Open edgan opened 3 years ago

edgan commented 3 years ago

I am using the check definition below and it throws an openssl error. It is because the runtime includes openssl 1.1.0, but Ubuntu 20.04's openssl is 1.1.1. Since the runtime doesn't provide it's own openssl, then the system one fails. It fails, because sensu is setting a LD_LIBRARY_PATH to point to the runtime copy of openssl that is 1.1.0.

The best solution would be for the runtime to include it's own openssl. It is kind of the whole point of the runtimes, give system independent tested versions of dependencies.

My workaround is to explicitly set the LD_LIBRARY_PATH. I tried using env_vars, but it still appends to the end. So I had to set it on the command line, giving it no power to override.

Linux distribution:

Ubuntu

Distribution release:

20.04

sensu-backend and sensu-agent version:

6.1.3-3642

sensu-plugins-ss version:

 3.0.2

Errors:

openssl: /var/cache/sensu/sensu-agent/a28952fd93fc63db1f8988c7bc40b0ad815eb9f35ef7317d6caf5d77ecfbfd824a9db54184400aa0c81c29b34cb48c7e8c6e3f17891aaf84cafa3c134266a61a/lib/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by openssl)
openssl: /var/cache/sensu/sensu-agent/a28952fd93fc63db1f8988c7bc40b0ad815eb9f35ef7317d6caf5d77ecfbfd824a9db54184400aa0c81c29b34cb48c7e8c6e3f17891aaf84cafa3c134266a61a/lib/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by openssl)

Check:

type: CheckConfig
api_version: core/v2
metadata:
  name: check-ssl-cert
  namespace: default
spec:
  command: check-ssl-cert.rb -c 30 -w 45 -h hostname -p 443
  interval: 60
  publish: true
  runtime_assets:
  - sensu-plugins-ssl
  - sensu-ruby-runtime
  subscriptions:
  - public

Workaround:

  command: LD_LIBRARY_PATH=/lib:/usr/lib check-ssl-cert.rb -c 30 -w 45 -h hostname -p 443
DoctorOgg commented 3 years ago

Thank you, also fixed debian