X509 Certificate time stamps

Hi,

I’m collecting certificate information from a few different domains and realise the start and expiry dates are in unix/epoch time.

I know there is a function in Kapacitor to turn a timestamp into a unix timestamp, but is there a function or method to convert unix timestamp to a human readable format?
There are 4 fields, all integers.

startdate = epoch time
age = stored in seconds
expiry = stored in seconds
enddate = epoch time

I plan to convert expiry into days using a TICK Script so i can trigger an alert when the cert has <30 days to expiration. What i would like to do though is convert the two unix timestamps into a human readable format i can use in my alert messages.

Can this be done with TICK/Kapacitor?

Kapacitor 1.5.2.
InfluxDB: all servers runnning 1.5.2 EXCEPT for one, which is running influxdb 1.8.3

We’re using the official telegraf plugin to collect this information

Any ideas/thoughts?

Thanks,

Phil

Hello @philb,
This exists in Flux if you’re willing to upgrade the rest.

Alternatively you could use the execd processor plugin to convert the timestamps in the language of your choice before writing to InfluxDB.

Hi @Anaisdg, thank you for the suggestions.

Flux seems like a good option. I have some questions though.

If i enable flux, will i need to rebuild my grafana dashboards?
Currently, we use Influx, Kapacitor and Telegraf for alerting. If i enable flux will:

  1. Kapacitor still work (for alerts)?
  2. will changing to flux impact any CQ’s we currently have running?
  3. Can i run the new Flux language alongside the previous FluxQL?

Thanks

Phil

If you use 1.8 then yes Kapacitor will still work.
Enabling flux should not impact any existing CQs
You can run Flux alongside InfluxQL with 1.x. And this feature is in the works for 2.x.

Thanks @Anaisdg I’ll do some research and testing. Its more of a would be nice to have than a requirement. As long as i can display the days til expiry i can work with that.I just thought i’d pretty up the data a little bit for the guys getting the alerts.

Thanks