Monitor Size of Single Directory?


(Seth S) #1

Is there any way to configure Topbeat to monitor the size of one directory? I am considering just writing a script that does: 'du -h > dirsize.txt' and tailing that file, but I'd prefer something more elegant..


(Andrew Kroh) #2

No, Topbeat and Metricbeat both report filesystem usage metrics on a per mount point basis.


(Mark Walkom) #3

https://github.com/kimjmin/lsbeat might help


(Seth S) #4

I'll research lsbeat, it looks like it can either do what I need or be
modified to do it.. I just wonder if that's more efficient than using
(already implemented) Filebeat and simply running a cron job every 5
minutes or so to write the results of 'du /filepath/filename'.

Thank you for your suggestion Mark.


(Seth S) #5

It looks like the current solution is to simply write file size to a file that is tailed by Filebeat.

Is anyone aware of a way to push the data without tailing a file? Ideally we don't write this data in any logs, but rather push it directly to Logstash.

Ideas regarding implementation, good/bad idea etc..?


(Magnus B├Ąck) #6

You could just send the metric with netcat over UDP or TCP.


(Seth S) #7

Good call, thank you!


(Andrew Kroh) #8

Another option... use curl to POST the data to the logstash http input.


(system) #9

This topic was automatically closed after 21 days. New replies are no longer allowed.