2

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.

4 Answers 4

2

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.

1

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 (.1.3.6.1.2.1.25.1.5.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.

-1

NRPE-2.14 ;)

install the plugins and NRPE on the remote server

-1

we are using this in production, its brilliant

https://www.monitoringexchange.org/inventory/Check-Plugins/Operating-Systems/Linux/show_users

You must log in to answer this question.