# Configuration-less Advanced SSL Certificate Check Plugin

**URL:** <https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199>\
**Category:** Dynatrace Tips\
**Tags:** data-privacy-and-product-security, knowledge-sharing, extensions, synthetic-monitoring\
**Created:** [January 12, 2021, 2:00pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199 "2021-01-12T14:00:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 12, 2021, 2:00pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/1 "2021-01-12T14:00:48Z")

</div>

There are multiple variants how to validate SSL certificates and alert on expiry. I’ve taken a look at all of them and missed a lack of automation. I therefor created another one that hopefully overcomes some of the limitations and is easier to use in large environments.

As we are not having this feature out of the box for a long time this might be useful.

Summarizing the various attempts and threads from:

[SSL Certification expiration checks out of the box - Details?](https://answers.dynatrace.com/spaces/482/dynatrace-open-qa/questions/235437/ssl-certification-expiration-checks-out-of-the-box.html) ([@Larry R.](https://answers.dynatrace.com/users/24228/view.html))  
[Does Dynatrace monitor SSL certificate validation](https://answers.dynatrace.com/spaces/482/dynatrace-open-qa/questions/224997/does-dynatrace-monitor-ssl-certificate-validation.html) ([@Akshay S.](https://answers.dynatrace.com/users/30050/view.html))  
[Monitor SSL certificate expiry and generate alert](https://answers.dynatrace.com/spaces/482/dynatrace-open-qa/questions/227155/monitor-ssl-certificate-expiry-and-generate-alert.html) ([@Dario C.](https://answers.dynatrace.com/users/32269/view.html))  
(also the contributors [@Július L.](https://answers.dynatrace.com/users/16467/view.html)'s [OneAgent extension](https://github.com/juliusloman/dynatrace-oneagent-plugin-sslcertcheck) and&nbsp;[@Leon Van Z.](https://answers.dynatrace.com/users/33542/view.html)'s&nbsp;[ActiveGate extension](https://github.com/mediro-ict/activegate_python_ssl_plugin))

**What is different about this plugin?**

1. It doesn’t need any configuration for hosts/sites that are checked. The endpoints are determined dynamically from already configured (and tagged) synthetic monitors. Add/remove monitors and they will be checked automatically without any additional configuration needs.
2. Error events (about expiring certificates) are posted/attached to the synthetic monitor, where one would expect it, not to custom devices
3. Check intervals can be adjusted in long timeframes - no one needs to check certificate validity every minute or even hour.
4. It is an active gate remote plugin so it can communicate with the Dynatrace API via the active gate.
5. It doesn’t consume any licenses for custom metrics!

**Where to find it?**

You can find the plugin in my personal [github repository](https://github.com/reinhard-brandstaedter/dynatrace-plugin-certcheck).

---

<div class="post-metadata">

**Author:** ![larry\_roberts](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/larry_roberts/32/7131_2.png) [@larry\_roberts](https://community.dynatrace.com/u/larry_roberts)\
**Post date:** [January 12, 2021, 2:23pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/2 "2021-01-12T14:23:42Z")

</div>

NICE! You sir, [@Reinhard W.](https://answers.dynatrace.com/users/20278/view.html) ROCK! 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [January 12, 2021, 2:26pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/3 "2021-01-12T14:26:01Z")

</div>

Thanks for sharing! Our services team created a similar one but instead of using synthetic tests as input it took a csv as well as automatically discovering all https endpoints from incoming/outgoing service calls.

That one does require some configuration though and does use DDUs to track the endpoints.

Mike

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 12, 2021, 4:37pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/4 "2021-01-12T16:37:09Z")

</div>

Thanks [@Larry R.](https://answers.dynatrace.com/users/24228/view.html), hope you can use it. Feedback always welcome!

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 12, 2021, 4:41pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/5 "2021-01-12T16:41:08Z")

</div>

Using the synthetic monitor configuration seemed logical. Can’t rely too much on the services as they are more likely to change and eventually there are no services and one would still perform synthetic tests (or test something that is not even covered by DT on the backend).

Though I use the detected services approach to automatically configure RUM applications at scale…waiting for DT to bring back automatic application detection 🙂

---

<div class="post-metadata">

**Author:** ![aymeric\_blanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymeric_blanc/32/35825_2.png) [@aymeric\_blanc](https://community.dynatrace.com/u/aymeric_blanc)\
**Post date:** [January 14, 2021, 3:53pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/6 "2021-01-14T15:53:26Z")

</div>

Thanks for sharing !  
I will try it.

The best solution (in my opinion) was to develop our own AG plugin (based on ssl and openssl library) in order to be able to manage our own groups of certificates and the associated alert thresholds. (I don’t really like to use synthetics for this kind of monitoring).

The concern also (for me) to use events is that the problem will be automatically closed after 15 minutes (max 120 minutes) and therefore would not be compatible with an execution schedule higher than 120 minutes (or we have to manage this in the script and many events will be created every day until the certificate is renewed)

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 14, 2021, 4:55pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/7 "2021-01-14T16:55:28Z")

</div>

Hi [@Aymeric B.](https://answers.dynatrace.com/users/30406/view.html),

actually this AG plugin uses OpenSSL in the background to fetch the certificates. Any solution that gets certificates from remote servers is some kind of synthetic monitoring. Unless you do cert checks locally on the filesystem (which is hardly controllable on large heterogeneous environments) IMO.

There is no issue with problems closing after 15 minutes. You can actually set the timeoutduration higher and also simply refresh the problem when needed. So my approach is to set the timeout to longer than the check interval, then the problem will be simply refreshed and no additional ones will be created.

---

<div class="post-metadata">

**Author:** ![aymeric\_blanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/aymeric_blanc/32/35825_2.png) [@aymeric\_blanc](https://community.dynatrace.com/u/aymeric_blanc)\
**Post date:** [January 14, 2021, 6:03pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/8 "2021-01-14T18:03:13Z")

</div>

Hi [@Reinhard W.](https://answers.dynatrace.com/users/20278/view.html)  
We had specific needs for this AG plugin (management of assignment groups for the ticketing tool, different thresholds according to the type of certificates, …).  
Regarding the events management, the documentation indicated that the maximum timeout was 120 minutes for an event , so i have decided to configure a custom event in order not to manage a situation where the execution interval would be greater than the maximum timeout.  
(but you’re absolutely right, it’s indeed possible to manage the refresh of the event in the script, maybe I’ve been a little lazy.^^)

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 14, 2021, 6:37pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/9 "2021-01-14T18:37:34Z")

</div>

Hi [@Aymeric B.](https://answers.dynatrace.com/users/30406/view.html)

you just gave me a great idea on how to do the refresh better, will include that in my plugin.

For the different thresholds for different groups of certificates. This could be covered with different instances of the plugin. In case you know on which sites (synthetic monitors) you have which certificates, you could assign different tags in DT and then the different instances of the plugin would pick up those sites with separate thresholds.

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [January 14, 2021, 8:01pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/10 "2021-01-14T20:01:33Z")

</div>

Hello [@Reinhard W.](https://answers.dynatrace.com/users/20278/view.html)

In how to use the below sentence written.

“_ **that is able to access the sites you want to monitor** _.”

I am a bit confused about this, thus need your assistance to clear my concept before using the plugin. We have a few eChannel applications monitoring with the Synthetic Browser.

Do you mean the Environment AG should be able to reach that publically available DNS?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 15, 2021, 10:29am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/11 "2021-01-15T10:29:55Z")

</div>

Thanks for the feedback ([@Aymeric B.](https://answers.dynatrace.com/users/30406/view.html)). I’ve added functionality to the plugin so that it now also checks previously created problems/events and if their state is still satisfied (outside of the normal long cert check interval). It will so so by fetching the event/problem and check if it is close to expiry (the max. 120 minutes). It this is the case it will check those hosts and make sure the problem is refreshed, or if the failure condition doesn’t exist anymore close the problem.

Additionally I added proxy support for the plugin. This can be useful in cases where direct access to the sites to check isn’t possible. The plugin will only use TLSv1.2 for security reasons.

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 21, 2021, 10:05am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/12 "2021-01-21T10:05:09Z")

</div>

Hi [@Babar Q.](https://answers.dynatrace.com/users/5357/view.html),

yes, the AG that is executing the Plugin must be able to reach the public available DNS/Hosts/Sites to check the certificates.  
This is done independently of the synthetic monitors (that you probably let execute on Dynatrace’s infrastructure).

Reinhard

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [January 21, 2021, 1:02pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/13 "2021-01-21T13:02:13Z")

</div>

Hello [@Reinhard W.](https://answers.dynatrace.com/users/20278/view.html)

Thank you for the confirmation. On the uploading of the extension, I received the message that it will consume the DDU.

Is this true or was it just a default message?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [January 21, 2021, 1:03pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/14 "2021-01-21T13:03:36Z")

</div>

This plugin doesn’t create any custom metrics, only events so it will not consume any DDUs.

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [January 21, 2021, 1:11pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/15 "2021-01-21T13:11:39Z")

</div>

Hello [@Reinhard W.](https://answers.dynatrace.com/users/20278/view.html)

Thank you for the clarification.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [March 31, 2021, 9:16pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/16 "2021-03-31T21:16:21Z")

</div>

[@r\_weber](https://community.dynatrace.com/user/35901)&nbsp;this looks good, it makes sense to leverage the Synthetic checks. However, there are cases where a client doesn’t use Synthetic, and being able to add domains/FQDNs manually still makes sense. I guess for those, I’ll continue to leverage&nbsp;[@leon\_vanzyl](https://community.dynatrace.com/user/35133)’s [plugin](https://github.com/mediro-ict/activegate_python_ssl_plugin)&nbsp;:smiling\_face\_with\_sunglasses:

Question: does the plugin work for SaaS and Managed? I’ve set it up on a Managed instance, but I’m not sure what to add to the ‘_Dynatrace Tenant UUID to report to_’ field, the env. ID? Incl. or excl. the /e/? Or the entire env. URL, incl. the [https://FQDN/e/](https://FQDN/e/)?

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [April 1, 2021, 1:17pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/17 "2021-04-01T13:17:20Z")

</div>

Hi&nbsp;[@andre\_vdveen](https://community.dynatrace.com/user/11931)&nbsp;,

you can always configure your synthetic monitors (but disable them) and the plugin would pick them up as well 🙂

Re SaaS/Managed:  
As the plugin uses the remote execution engine it pushes the notification vie the AG API. This API is always [https://localhost/e/\<tenantid\>](https://localhost/e/%3Ctenantid)&nbsp;regardless of managed or saas this API urls is the same. so you only need the tenant ID & API key.

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [April 12, 2021, 6:51pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/18 "2021-04-12T18:51:36Z")

</div>

Hi&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901)&nbsp;thanks for the feedback, didn’t realize it will still work even with the monitors disabled! 🙂

I’ve deployed the plugin as I normally would, but I couldn’t get it working, no matter what I tried. Upon checking the logs, I noticed this:  
_Token is missing required scope. Use one of: ExternalSyntheticIntegration (Create and read synthetic monitors, locations, and nodes)_  
Turns out the token permissions on the documentation need some updating, as it only mentions:

- ‘Read synthetic monitors, locations, and nodes’
- ‘Access problem and event feed, metrics, and topology’ and
- ‘Data Ingest, e.g. metrics and events’

After adding the missing token scope, it is working now - very cool, thank you! 😉

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [April 14, 2021, 4:14pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/19 "2021-04-14T16:14:09Z")

</div>

Hi&nbsp;[@andre\_vdveen](https://community.dynatrace.com/user/11931)&nbsp;! Thanks for pointing that out! I’ve corrected the token scope requirements!

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [April 20, 2021, 9:03am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/20 "2021-04-20T09:03:43Z")

</div>

Hi&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901),

You said the Synthetic monitors can be disabled and the certificate checks should still work, correct?  
Perhaps I’m doing something wrong, but if I have a Synthetic test set up but disable it, the certificate check never seems to execute/check that monitor, even though the threshold value (85 days till expiry, threshold set to 90 day) is valid?  
If I enable the Synthetic monitor, let it run once, and then disable it, it seems to work OK (it raises a problem for the certificate’s expiry date) but I can’t confirm if it will close the problem once the certificate is updated while the monitor is disabled.

[Next page](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199.md?page=2)
