check_users plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ctretelea
Posts: 59
Joined: Fri Feb 17, 2017 5:43 pm

check_users plugin

Post by ctretelea »

Hello,

I'm little bit confuse. Nagios plugin check_users return this:

Code: Select all

USERS CRITICAL - 302 users currently logged in
but when I run who in terminal a have this:

Code: Select all

userxxxx pts/0        2017-05-30 10:33 (10.237.60.113)
root     hpsa         2017-04-23 20:21 (HP Server Automation)
Why I receive 2 different results?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: check_users plugin

Post by avandemore »

Please show your full check command, XI > Configure > CCM > Services > yourservice > Run Check Command
Previous Nagios employee
ctretelea
Posts: 59
Joined: Fri Feb 17, 2017 5:43 pm

Re: check_users plugin

Post by ctretelea »

avandemore wrote:Please show your full check command, XI > Configure > CCM > Services > yourservice > Run Check Command
here it is:

Code: Select all

[nagios@NagiosXI]$ /usr/local/nagios/libexec/check_nrpe -H 10.40.5.200 -t 30 -c check_users -a '-w 5 -c 10'
USERS CRITICAL - 303 users currently logged in |users=303;5;10;0
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: check_users plugin

Post by avandemore »

Can you also share how check_users is defined remotely? It would be in file nrpe.cfg or one of it's include files. Please post them as as there could be overlaps.
Previous Nagios employee
ctretelea
Posts: 59
Joined: Fri Feb 17, 2017 5:43 pm

Re: check_users plugin

Post by ctretelea »

avandemore wrote:Can you also share how check_users is defined remotely? It would be in file nrpe.cfg or one of it's include files. Please post them as as there could be overlaps.
here it is the list of commands:
  • ### MISC SYSTEM METRICS ###
    #command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
    command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$
    #command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$
    command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
    command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
    command[check_mem]=/usr/local/nagios/libexec/custom_check_mem -n $ARG1$
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_users plugin

Post by tgriep »

There has been some changes to the check_users plugin for the last few releases, what version are you running on the remote server?
Can you login to that server, run the following and post the output?

Code: Select all

/usr/local/nagios/libexec/check_users -V
/usr/local/nagios/libexec/check_users -w 5 -c 10
su nagios
/usr/local/nagios/libexec/check_users -w 5 -c 10
Be sure to check out our Knowledgebase for helpful articles and solutions!
ctretelea
Posts: 59
Joined: Fri Feb 17, 2017 5:43 pm

Re: check_users plugin

Post by ctretelea »

tgriep wrote:There has been some changes to the check_users plugin for the last few releases, what version are you running on the remote server?
Can you login to that server, run the following and post the output?

Code: Select all

/usr/local/nagios/libexec/check_users -V
/usr/local/nagios/libexec/check_users -w 5 -c 10
su nagios
/usr/local/nagios/libexec/check_users -w 5 -c 10
Hi I cannot log as nagios but this is results:

Code: Select all

Using username "ctretelea".
Last login: Wed May 31 06:23:10 2017 from 10.237.60.113
[user@lxelkapp] 14:17 $ /usr/local/nagios/libexec/check_users -V
check_users v2.0.3 (nagios-plugins 2.0.3)
[user@lxelkapp] 14:17 $ /usr/local/nagios/libexec/check_users -w 5 -c 10
USERS CRITICAL - 256 users currently logged in |users=256;5;10;0
[user@lxelkapp] 14:18 $ su nagios
Password:
su: incorrect password
[user@lxelkapp] 14:18 $ sudo su
[sudo] password for user:
[root@lxelkapp] 14:18 # /usr/local/nagios/libexec/check_users -w 5 -c 10
USERS CRITICAL - 256 users currently logged in |users=256;5;10;0
[root@lxelkapp] 14:18 # su - nagios
This account is currently not available.
[root@lxelkapp] 14:19 # su  nagios
This account is currently not available.
[root@lxelkapp] 14:19 # idnagios
bash: idnagios: command not found
[root@lxelkapp] 14:20 # id nagios
uid=496(nagios) gid=491(nagios) groups=491(nagios),10668(nagcmd)
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_users plugin

Post by ssax »

Please run this and see what users are listed:

Code: Select all

sudo who -u
ctretelea
Posts: 59
Joined: Fri Feb 17, 2017 5:43 pm

Re: check_users plugin

Post by ctretelea »

ssax wrote:Please run this and see what users are listed:

Code: Select all

sudo who -u
Here are:

Code: Select all

[user@lxelkapp] 11:25 $ sudo who -u
[sudo] password for user:
user1 pts/4        2017-06-01 11:08 00:13        3011 (192.168.50.143)
user1 pts/0        2017-06-01 10:00 00:54       42307 (192.168.10.177)
user2 pts/7        2017-05-12 10:36 03:33       21696 (192.168.10.162)
user1 pts/11       2017-06-01 11:21   .         25918 (192.168.10.162)
user pts/8        2017-06-01 11:25   .         35254 (10.237.60.113)
user1 pts/2        2017-06-01 10:11 00:59       55343 (192.168.10.155)
user1 pts/9        2017-06-01 08:12 00:45       34707 (192.168.10.106)
root     hpsa         2016-12-20 03:19   ?         48234 (HP Server Automation)
user1 pts/5        2017-06-01 10:17   .         62125 (192.168.10.174)
user1 pts/3        2017-06-01 09:39 00:43       16450 (192.168.10.161)
[user@lxelkapp] 11:25 $ /usr/local/nagios/libexec/check_users -w 5 -c 10
USERS CRITICAL - 252 users currently logged in |users=252;5;10;0
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: check_users plugin

Post by avandemore »

What happens when run from the listener?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -t 30 -c check_users -a '-w 5 -c 10'
Can you attach the full nrpe.cfg?
Previous Nagios employee
Locked