basho/riak_nagios — pull request #32 by deanproctor (2013-05-02 00:49:06+00:00)
Title: Make check_file_handle_count runnable by non-privileged users

Nagios checks are most often run by the non-privileged "nagios" user. The current implementation of check_file_handle_count relies on lsof for the specific Riak process, an operation that requires root privileges to perform.

This commit changes the behavior of check_file_handle_count to evaluate the total system file handles (which a non-privileged user can query) against the warn/crit limits rather than using lsof specifically for the Riak process. While this is not as accurate, it will be more usable for a wider audience.

I believe the loss of accuracy is acceptable given most architectures have Riak deployed as the only major consumer of file handles on a server. Worst case, we alert sooner than we would have otherwise.