# 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:** 3

<div class="post-metadata">

**Author:** ![AlanZ](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alanz/32/29676_2.png) [@AlanZ](https://community.dynatrace.com/u/AlanZ)\
**Post date:** [February 4, 2022, 10:07pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/41 "2022-02-04T22:07:09Z")

</div>

Well the real thanks goes to whomever though of tags in the first place. Maybe “tag configuration” will catch up for other features 🙂

---

<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:** [February 4, 2022, 10:11pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/42 "2022-02-04T22:11:49Z")

</div>

[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;it would be a single key tag only e.g. “sslcheck”

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [February 4, 2022, 11:08pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/43 "2022-02-04T23:08:15Z")

</div>

Funny you mention that. I created an RFE actually asking Dynatrace to add a tag context type of [CONFIGURATION].&nbsp; &nbsp;I agreed, hopefully it catches on.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [February 8, 2022, 11:51pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/44 "2022-02-08T23:51:15Z")

</div>

[@r\_weber](https://community.dynatrace.com/user/35901)

First of all, let me congratulate you for this extension!

I have just installed it and getting the following error when configuring for the first time:

Error(No module named ‘\_cffi\_backend’)

I have checked the code, and cffi\_backend doesn’t seem to be included… Any ideas?

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [February 9, 2022, 12:17am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/45 "2022-02-09T00:17:06Z")

</div>

I should have read this before:

> <https://github.com/360Performance/dynatrace-plugin-certcheck/issues/4>
>
> Dear,
> 
> I get following error when I want to use this plugin on my Linux AG.
> I… see that there is an "so" file included regarding cffi backend. Does that need to go somewhere?
> 
> Thanks,
> Bert

I’m using it with an 1.229.168 Activegate. Will be trying on a newer one later today…

---

<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:** [February 9, 2022, 8:01am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/46 "2022-02-09T08:01:34Z")

</div>

Hi&nbsp;[@AntonioSousa](https://community.dynatrace.com/user/17213)&nbsp;,

maybe I should consider building the newest version still for older AGs while these are still around. Alternatively you could use one of the older releases, which are built for Python 3.6 (missing only minor config-via-tag feature).

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [February 9, 2022, 9:08am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/47 "2022-02-09T09:08:14Z")

</div>

Thanks [@r\_weber](https://community.dynatrace.com/user/35901) ,

I considered switching to an older version, but didn’t even try, as I believe, given the way Dynatrace implements versioning in Activegate extensions, it wouldn’t let it work after having installed it in a newer version.

I’m going to compile it locally in my 3.6 dev environment.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [February 9, 2022, 10:20pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/48 "2022-02-09T22:20:06Z")

</div>

[@r\_weber](https://community.dynatrace.com/user/35901)

Worked as expected: Had to increment version, recompile & deploy. Worked afterwards with no issue :dynaspin:

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [February 9, 2022, 11:22pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/49 "2022-02-09T23:22:21Z")

</div>

[@AlanZ](https://community.dynatrace.com/user/19668),

I just put one Activegate working with both HTTP monitors AND this extension. Well, really, with several other extensions I have in it. You can get some tips on how to do this in this thread:

[https://community.dynatrace.com/t5/Synthetic-Monitoring/Regular-Activegate-with-HTTP-monitors/m-p/116246](https://community.dynatrace.com/post/116246)

Please don’t forget that this is not officially supported by Dynatrace, so be careful with it’s usage!

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [February 10, 2022, 2:03pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/50 "2022-02-10T14:03:41Z")

</div>

When the extension checks for already open problems, how is it doing that? I ask because my initial testing a few weeks ago I had this check a synthetic, problem created with no issues. I manually closed out that problem because I was working through vetting out this extension before rolling out to our customers, and simply trying to understand it more (synthetic i used was not mine so I didn’t yet want the app team to see the problem is why i closed the problem). Anyways, that same synthetic will now not open a new problem even though the cert is going to expire in 12 days, check is doing 15 days. I pulled the below from the AG logs and do see where there is an error while trying to get the synthetic hosts so maybe that is the issue? The 14082 minutes lines up with when the original problem was created, back on 1/31. Replaced the URL with xxxx.

Ideally yes we should not be closing out problems manually especially when the problem is not actually resolved 🙂 I was simply testing here and now don’t know how to get things back to where a problem will be created, aside from removing and installing the extension back.

2022-02-10 13:55:01.758 UTC INFO [Python][6276281846038309027][SSL\_Certificate\_Check][139788694841088][ThreadPoolExecutor-0\_1] - [getMonitorsWithOpenEvents] A problem for SS9 D01 is already open for 14082 minutes  
2022-02-10 13:55:01.993 UTC ERROR [Python][6276281846038309027][SSL\_Certificate\_Check][139788694841088][ThreadPoolExecutor-0\_1] - [getSSLCheckHosts] Error while trying to get synthetic hosts  
2022-02-10 13:55:01.994 UTC INFO [Python][6276281846038309027][SSL\_Certificate\_Check][139788694841088][ThreadPoolExecutor-0\_1] - [query] Refreshing open problems for: [‘xxxxxx’]  
2022-02-10 13:55:02.062 UTC INFO [Python][6276281846038309027][SSL\_Certificate\_Check][139788694841088][ThreadPoolExecutor-0\_1] - [getCertExpiry] Certificate for xxxxxxx (MonitorID: SYNTHETIC\_TEST-356B7E801199A8CC) expires in 12 days: ERROR

---

<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:** [February 10, 2022, 2:42pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/51 "2022-02-10T14:42:15Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)

that is interesting. it actually checks the problem opening error events. Those should also clear upon manual close of a problem.

Can you try to set the treshold to 10, so that the check turns into OK on the next run and then set it back to 15?

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [February 11, 2022, 11:54pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/52 "2022-02-11T23:54:10Z")

</div>

That did work, setting the cert expiry threshold to a lower number, one where the extension will see that the cert expiry date is within the threshold and subsequently mark the event as closed. Any clue why this would be needed? We plan to use 1 endpoint and anyone that wants to use this check will add the tag to their synthetic. There will unfortunately be a time where somewhere will close the problem manually even though the issue is not actually addressed (won’t happen on the regular i hope but it will happen). This would mean that I would then have to change the threshold to something that is lower to ‘force’ the extension to mark the event as closed, OR i just change it to something like 1 day then after the clearing, change it back to our standard. Ideally I would love to not have to do this 🙂

Also, through my testing when I do close the ticket manually I see the time value for the event being updated to the time when the problem was closed. As an example, I had a problem get created at 18:15 today and I manually closed it at 18:29. While the problem was open the time value for the event was accurate (showed 18:15) but when I closed out the problem it now shows ‘today, 18:29-now’. It shows now because the extension thinks the event is still open. This update of the start time for the event does not occur with problems that close automatically, I’ve only seen this issue if you manually close the problem.

---

<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:** [February 12, 2022, 10:51am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/53 "2022-02-12T10:51:33Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;,

interesting observation. It seems that manually closing the problem doesn’t “clear” the problem-opening event so from the plugin perspective the opening event is just refreshed but Dynatrace doesn’t interpret this as another problem opening event.

I might need to do additional checks for this special case of manual close….or state in the problem description of the problem that manual close equals a ignore of the certificate expiry forever 😉

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [February 15, 2022, 2:28pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/54 "2022-02-15T14:28:42Z")

</div>

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

If this is something planned to be fixed then I will wait for the new version before communicating this out to our users.

---

<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:** [February 16, 2022, 10:25am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/55 "2022-02-16T10:25:00Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;,

The [new version (1.18)](https://github.com/360Performance/dynatrace-plugin-certcheck/releases/tag/1.18) now will reopen problems if the error condition is still met after a manual close of a problem. (Please note the API token permission change requirement)

Hope that helps! Enjoy!

kr,

Reinhard

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [June 8, 2022, 10:47am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/56 "2022-06-08T10:47:16Z")

</div>

Since I migrated to AG 1.239, the extension stopped working. Getting the errors below in the gateway logs. Tried some tricks recompiling extension, but with no luck…

```markup
2022-06-08 10:39:00.141 UTC [000045ac] severe [native] 139751677454080(ThreadPoolExecutor-0_0) - [set_full_status] No module named '_cffi_backend'
 Traceback (most recent call last):
   File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/engine_unzipped/ruxit/plugin_state_machine.py", line 336, in _execute_next_task
     self._query_plugin()
   File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/engine_unzipped/ruxit/plugin_state_machine.py", line 663, in _query_plugin
     self._plugin_run_data = self._create_plugin_run_data()
   File "/var/lib/dynatrace/remotepluginmodule/agent/runtime/engine_unzipped/ruxit/plugin_state_machine.py", line 636, in _create_plugin_run_data
     plugin_module = importlib.import_module(self.metadata["source"]["package"])
   File "/opt/dynatrace/remotepluginmodule/agent/plugin/python3.8/importlib/ __init__.py", line 127, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 843, in exec_module
   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
   File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.certcheck/certcheck.py", line 28, in <module>
     from OpenSSL import SSL
   File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.certcheck/OpenSSL/ __init__.py", line 8, in <module>
     from OpenSSL import crypto, SSL
   File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.certcheck/OpenSSL/crypto.py", line 11, in <module>
     from OpenSSL._util import (
   File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.certcheck/OpenSSL/_util.py", line 5, in <module>
     from cryptography.hazmat.bindings.openssl.binding import Binding
   File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.certcheck/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
     from cryptography.hazmat.bindings._openssl import ffi, lib
 ModuleNotFoundError: No module named '_cffi_backend'
2022-06-08 10:39:01.058 UTC [000044b7] info [native] 139751206131456(MainThread) - [one_plugin_loop_step] plugin <RemotePluginEngine, meta_name:custom.remote.python.certcheck id:0x7f1a39a37580> threw exception No module named '_cffi_backend'

```

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [June 8, 2022, 11:06am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/57 "2022-06-08T11:06:45Z")

</div>

Seems like a problem on my side. I’ll comment when solved.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [June 8, 2022, 11:22am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/58 "2022-06-08T11:22:45Z")

</div>

Yep, it was a false alarm. I had previously had to recompile the extension, and for some reason it was incorporating a Python 3.6 file, instead of the correct one. Recompiled again, with your new code, and it works 🙂

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [June 8, 2022, 12:21pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/59 "2022-06-08T12:21:16Z")

</div>

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

Are you aware of any problem that this extension might have running on a Windows Activegate?

---

<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:** [June 8, 2022, 12:25pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/60 "2022-06-08T12:25:30Z")

</div>

Hi&nbsp;[@AntonioSousa](https://community.dynatrace.com/user/17213), I’ve used it successfully on a Windows-based AG as a test.

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

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