Measuring custom statistics with sar

Posted by Will Glass on Server Fault See other posts from Server Fault or by Will Glass
Published on 2012-09-20T19:39:31Z Indexed on 2012/09/20 21:40 UTC
Read the original article Hit count: 175

Filed under:
|
|
|

I have a server application which I think is leaking file handles.

I want to track the usage of file descriptors over time on my Linux (ubuntu) server.

I've figured out that I can track the number of file descriptors in use by a process with

lsof -p `pgrep the-process-name` | wc -l

Since I'm already using sysstat and sar to track various metrics, I thought it'd be nice to display with sar. I want to measure this every 10 minutes. Is it possible to add a custom metric to sar? Then I can easily report it out.

If not, I'll write a simple cron job to collect this data and store it separately in a log file.

© Server Fault or respective owner

Related posts about linux

Related posts about log-files