Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It's not possible to add another metric without modifying the source code of sar.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.