monitoring files created date in a directory

1,097 views
Skip to first unread message

ishu...@gmail.com

unread,
Sep 15, 2021, 6:19:42 AM9/15/21
to Prometheus Users
Hi,

I have been looking if there is a way prometheus can monitor file modification/creation time. I have some crons generating few files everyday and i want to monitor if these are created every day. If prom can monitor a directory and report all the contents in the directory with their creation timestamps, that would also work for me. 

https://github.com/michael-doubez/filestat_exporter - I see one such exporter but first want to know if there is any prometheus native way of doing this.

Thanks
Eswar

Harald Koch

unread,
Sep 15, 2021, 3:10:27 PM9/15/21
to Prometheus Users
On Wed, Sep 15, 2021, at 06:19, ishu...@gmail.com wrote:
I have been looking if there is a way prometheus can monitor file modification/creation time. I have some crons generating few files everyday and i want to monitor if these are created every day. If prom can monitor a directory and report all the contents in the directory with their creation timestamps, that would also work for me. 


Not that I'm aware of, I use two techniques:

1) a textfile-collector script that scans a folder and outputs timestamps. see https://github.com/prometheus-community/node-exporter-textfile-collector-scripts

2) Some tools run from cron can output Prometheus metrics also for the textfile exporter - for example, I run the borg_exporter script automatically from borgmatic: https://github.com/teemow/prometheus-borg-exporter

--
Harald



Reply all
Reply to author
Forward
0 new messages