Monitoring age of active user sessions

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Luminary
Posts: 2
Joined: Mon Jan 27, 2020 5:07 am

Monitoring age of active user sessions

Post by Luminary »

Hi all,

I'm a bit of a novice with nagios and I'm having trouble with checking the amount of time that users have been logged into a Linux server. is there any way to have nagios poll this information?

For example, I want to be alerted if a user has been logged in for more than 5 hours. Have any of you had any experience with monitoring this or something similar?

Thanks in advance.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring age of active user sessions

Post by Box293 »

I've looked in the Nagios Exchange and I could not find any plugins that give you what you want, hence you are going to have to write your own plugin or alter the existing one

I looked at the existing check_users plugin and it seems that it uses the who command to determine information about users.

You may want to look at the who command and it's output and see if you can determine how long a user has been logged in for. If that doesn't provide the information then you'll need to find some command that will give you that information. Once you have that information then you can write a plugin to do what you need.

Sorry it's not a straight forward answer but all the plugins that exist out there are simply the result of a scenario like this.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked