1

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.

Will Glass
  • 927
  • 2
  • 12
  • 21

1 Answers1

1

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

Sirex
  • 5,499
  • 2
  • 33
  • 54
Jeff Ferland
  • 20,547
  • 2
  • 62
  • 85