Scheduling of custom check to run once a day at certain time

I have a custom check that I only want to run once a day but at 12am or 12:01 exactly.
I know the .conf file can specify interval for 24h in inputs.exec section but i’m wondering at what TIME this is run if it is every 24 hours and how can I specify this if it isnt to my liking.

sh-4.2$ cat cch_cl_daily_txn_count.conf

interval = “24h”
commands = [“python /etc/telegraf/scripts/”]
timeout = “60s”
name_override = “cch_cl_daily_txn_count”

Hello @fliu_infor,
I believe you can just run telegraf --once using cron itself for the scheduling.


  1. If I go this route, then should i set the interval to 0 so that telegraf does not run the script automatically? Or would I disable it?

  2. I was able to get --test to work but not --once not sure why this is the case…
    sh-4.2$ telegraf --config /etc/telegraf/telegraf.d/cch_cl_daily_txn_count.conf --once
    2021-07-22T18:13:42Z I! Starting Telegraf 1.18.3
    2021-07-22T18:13:42Z E! [telegraf] Error running agent: Error: no outputs found, did you provide a valid config file?
    sh-4.2$ telegraf --config /etc/telegraf/telegraf.d/cch_cl_daily_txn_count.conf --test
    2021-07-22T18:13:52Z I! Starting Telegraf 1.18.3

cch_cl_daily_txn_count, cch_cl_daily_txn_count=0 1626977633000000000