How to get current number of opened inotify watches?

My system is CentOS.

I'm trying to get this by listing fs.inotify variables via sysctl call (sysctl fs.inotify), but didn't found anything useful, only variables to specify limits.


lsof | grep inotify | wc -l

lsof prints special line for each inotify watch allocation.

See How do I find out what inotify watches have been registered? for details.