Checking Microsoft SQL Encryption in Transit TLS Cert expiration #417
-
Hello! I have been trying to use the check_ssl_cert plugin to check the expiration dates on our MS SQL encryption in Transit certs, but I am not having an luck so far. We are in the process of moving all of our MS SQL environments to encryption in transit and I would love to use Nagios to monitor the certs. We are using an Internal CA cert, and we have verified that the encryption in transit is fully functional,(packets are being encrypted, and clients can connect) but I can't get Nagios to check it. Here is an example just running from the command line basic arguments. I have included the results with the server FQDN replaced:
It was recommended on another forum to try to connect with the openssl s_client, so i attempted that as well, here is the output, again with the FQDN replaced:
Any help is greatly appreciated. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 9 replies
-
You are trying an HTTPS handshake on port 1433 of an SQL server, but the used protocol is another one (I am not an MS SQL user and don't know the details). Next week I might be able to access an MS SQL server and see if I can implement it. |
Beta Was this translation helpful? Give feedback.
-
What happens with
? |
Beta Was this translation helpful? Give feedback.
-
I did some research, and it does not seem possible to connect using OpenSSL directly. From Retrieve public server certificate key during handshake:
|
Beta Was this translation helpful? Give feedback.
-
This could be a solution: https://gist.github.com/Scherlac/0f048eb8f2aab274a903dcda5acbd99f But it would require
|
Beta Was this translation helpful? Give feedback.
-
Does not really work as expected. I am testing with a real certificate and only get:
Which is not the real certificate. |
Beta Was this translation helpful? Give feedback.
-
I am still checking option 2): embed a small script to retrieve the certificate, but I didn't find anything working. |
Beta Was this translation helpful? Give feedback.
-
I have to give up… If you find a small script (in any language) I will be happy to try to integrate it. |
Beta Was this translation helpful? Give feedback.
-
Never give up :-) This works: https://gist.github.com/lnattrass/a4a91dbf439fc1719d69f7865c1b1791#file-get_tds_cert-py |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I just released a new version with a first implementation. Could you please test it? |
Beta Was this translation helpful? Give feedback.
-
Yes, in theory it should work. Seems a Python problem. Which version do you use? I tested only with Python3.... |
Beta Was this translation helpful? Give feedback.
-
I’ll try to make it work with both. Sadly I am not a Python developer ….-- Matteo Cortihttp://corti.liIl giorno 19 ott 2022, alle ore 20:42, jax7778 ***@***.***> ha scritto:
the box is RHEL 7, so it is running with the default 2.7. I will try to test it with Python3
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You can use the —python-bin option -- Matteo Cortihttp://corti.liIl giorno 19 ott 2022, alle ore 20:51, jax7778 ***@***.***> ha scritto:
Thanks for working on this, but I have to ask a dumb question, how do I call python3 for the embedded script in the Nagios check? I am looking it up. I can't just call python3 to run the script since it is not a python script. I am looking this up as we converse, but I am trying not to make even more work for you here.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I opened an issue (#424) for the python 2 problem |
Beta Was this translation helpful? Give feedback.
-
I had to exclude Python 2 as the script I have found is not working. It would maybe be possible to fix it, but:
If someone wants to add support for Python 2.0 I will be glad to merge the changes, but for the moment I will stick with Python 3 only. |
Beta Was this translation helpful? Give feedback.
I just released a new version with a first implementation. Could you please test it?