Page 1 of 3
check_users plugin
Posted: Tue May 30, 2017 12:45 pm
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?
Re: check_users plugin
Posted: Tue May 30, 2017 1:41 pm
by avandemore
Please show your full check command, XI > Configure > CCM > Services > yourservice > Run Check Command
Re: check_users plugin
Posted: Tue May 30, 2017 1:55 pm
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
Re: check_users plugin
Posted: Tue May 30, 2017 4:16 pm
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.
Re: check_users plugin
Posted: Wed May 31, 2017 8:44 am
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$
Re: check_users plugin
Posted: Wed May 31, 2017 2:32 pm
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
Re: check_users plugin
Posted: Wed May 31, 2017 4:30 pm
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)
Re: check_users plugin
Posted: Wed May 31, 2017 4:50 pm
by ssax
Please run this and see what users are listed:
Re: check_users plugin
Posted: Thu Jun 01, 2017 1:36 pm
by ctretelea
ssax wrote:Please run this and see what users are listed:
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
Re: check_users plugin
Posted: Thu Jun 01, 2017 3:19 pm
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?