matteocorti / nagios_plugins

18 stars 7 forks source link

Output additional info for certificate #100

Closed matteocorti closed 8 years ago

matteocorti commented 8 years ago

Original reporter: anonymous

Pls add an option to output additional information of certificate in Nagios. Example -O SSL_CERT OK - X.509 certificate for ... valid until Dec 2 21:31:09 2012 GMT

Issuer: Verisign ()

Organisation: My Company ()

City: New York (<region/county/state>)

Country: US

Email: test@abc.com

Alt.Names: test2.abc.com, test3.abc.com

Keyprint: 34 56 er 23

matteocorti commented 8 years ago

Original reporter: matteo@corti.li

Hi,

could be a nice idea. Just to be sure you mean to add an option to be able to configure what is printed in the status?

For example if I say:

-O Country,Keyprintthe plugin will print

SSL_CERT OK - X.509 certificate for localhost from USA with keyprint 34 56 er 23 valid until Dec 2 21:31:09 2012 GMT?

matteocorti commented 8 years ago

Original reporter: matteo@corti.li

The issue is partially resolved with commit r1303. I added the possibility to specify a list of additional attributes that have to printed in the plugin  long output (LONGSERVICEOUTPUT). The list is limited to the attributes that can be delivered by openssl with direct request.

I decided not to parse the output to query for additional parameters since it would make a clean and safe implementation difficult.