@@ -106,7 +106,9 @@ func probeExpectInfo(registry *prometheus.Registry, qr *config.QueryResponse, by
106106}
107107
108108func ProbeTCP (ctx context.Context , target string , module config.Module , registry * prometheus.Registry , logger * slog.Logger ) bool {
109+ probeSSLEarliestCertStart := prometheus .NewGauge (sslEarliestCertStartGaugeOpts )
109110 probeSSLEarliestCertExpiry := prometheus .NewGauge (sslEarliestCertExpiryGaugeOpts )
111+ probeSSLLastChainStartTimestampSeconds := prometheus .NewGauge (sslChainStartInTimeStampGaugeOpts )
110112 probeSSLLastChainExpiryTimestampSeconds := prometheus .NewGauge (sslChainExpiryInTimeStampGaugeOpts )
111113 probeSSLLastInformation := prometheus .NewGaugeVec (
112114 prometheus.GaugeOpts {
@@ -143,9 +145,11 @@ func ProbeTCP(ctx context.Context, target string, module config.Module, registry
143145 }
144146 if module .TCP .TLS {
145147 state := conn .(* tls.Conn ).ConnectionState ()
146- registry .MustRegister (probeSSLEarliestCertExpiry , probeTLSVersion , probeSSLLastChainExpiryTimestampSeconds , probeSSLLastInformation )
148+ registry .MustRegister (probeSSLEarliestCertStart , probeSSLEarliestCertExpiry , probeTLSVersion , probeSSLLastChainStartTimestampSeconds , probeSSLLastChainExpiryTimestampSeconds , probeSSLLastInformation )
149+ probeSSLEarliestCertStart .Set (float64 (getEarliestCertStart (& state ).Unix ()))
147150 probeSSLEarliestCertExpiry .Set (float64 (getEarliestCertExpiry (& state ).Unix ()))
148151 probeTLSVersion .WithLabelValues (getTLSVersion (& state )).Set (1 )
152+ probeSSLLastChainStartTimestampSeconds .Set (float64 (getLastChainStart (& state ).Unix ()))
149153 probeSSLLastChainExpiryTimestampSeconds .Set (float64 (getLastChainExpiry (& state ).Unix ()))
150154 probeSSLLastInformation .WithLabelValues (getFingerprint (& state ), getSubject (& state ), getIssuer (& state ), getDNSNames (& state ), getSerialNumber (& state )).Set (1 )
151155 }
@@ -210,11 +214,13 @@ func ProbeTCP(ctx context.Context, target string, module config.Module, registry
210214 conn = net .Conn (tlsConn )
211215 scanner = bufio .NewScanner (conn )
212216
213- // Get certificate expiry.
217+ // Get certificate start and expiry.
214218 state := tlsConn .ConnectionState ()
215- registry .MustRegister (probeSSLEarliestCertExpiry , probeTLSVersion , probeSSLLastChainExpiryTimestampSeconds , probeSSLLastInformation )
219+ registry .MustRegister (probeSSLEarliestCertStart , probeSSLEarliestCertExpiry , probeTLSVersion , probeSSLLastChainStartTimestampSeconds , probeSSLLastChainExpiryTimestampSeconds , probeSSLLastInformation )
220+ probeSSLEarliestCertStart .Set (float64 (getEarliestCertStart (& state ).Unix ()))
216221 probeSSLEarliestCertExpiry .Set (float64 (getEarliestCertExpiry (& state ).Unix ()))
217222 probeTLSVersion .WithLabelValues (getTLSVersion (& state )).Set (1 )
223+ probeSSLLastChainStartTimestampSeconds .Set (float64 (getLastChainStart (& state ).Unix ()))
218224 probeSSLLastChainExpiryTimestampSeconds .Set (float64 (getLastChainExpiry (& state ).Unix ()))
219225 probeSSLLastInformation .WithLabelValues (getFingerprint (& state ), getSubject (& state ), getIssuer (& state ), getDNSNames (& state ), getSerialNumber (& state )).Set (1 )
220226 }
0 commit comments