In Nagios there exists a check_users function to check the number of users logged into the local system, but how do I do the same for a remote system? I have failed in trying to find the appropriate plugin.


you can install nrpe on remote computer that you want to monitor and invoke the plugin there.

or - if you want to hack a bit - you can write your own script and use ssh + key pair and execute on remote machine command like who + parse output locally.


If you have SNMP enabled which has been my preferred method of performing remote monitoring checks. You can setup a Nagios service check that polls the HOST-RESOURCES-MIB::hrSystemNumUsers.0 (. OID to get the number of users. This will return the current user count at the time the OID is retrieved.

The biggest advantage I find in using SNMP over NRPE as otherwise suggested is that if you find a flaw in your plugin you need to push that change out to every host that has the plugin installed on. For this reason I find doing agent-less monitoring better than agent-based.


NRPE-2.14 ;)

install the plugins and NRPE on the remote server


we are using this in production, its brilliant


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy