Is there a way to monitor the number of open file descriptors for a process using monit? Preferably comparing it against the process's limits (via /proc/$PID/limits perhaps) and alerting when a threshold is exceeded.
I don't see open file descriptors as a first class resource in the docs, but perhaps there's an easy way to do it I'm not thinking of?