Page 2 of 2

Re: how do i monitor Linux User Account Status

Posted: Fri Jun 10, 2016 1:27 pm
by harsha.s.aryan
the issue is after running the nagios script i am not getting the user account which is having issue

Code: Select all

root@Nagios:~# chage -l harsha
Last password change                                    : password must be changed
Password expires                                        : password must be changed
Password inactive                                       : password must be changed
Account expires                                         : Jun 16, 2016
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
root@Nagios:~# /home/harshas/check_passwd_expiration
PASSWD_EXPIRATION CRITICAL - , Excluded account(s): [none]
root@Nagios:~#
in this place
[/code]
(root@Nagios:~# /home/harshas/check_passwd_expiration
PASSWD_EXPIRATION CRITICAL - , Excluded account(s): [none])
[/code]
i was suppose to get PASSWD_EXPIRATION CRITICAL - harsha, Excluded account(s): [none]) where harsha account is expired

Re: how do i monitor Linux User Account Status

Posted: Fri Jun 10, 2016 2:01 pm
by lmiltchev
The script works as expected for me, however my "test" user (tom) has a password that expires today:
[root@192 libexec]# chage -l tom
Last password change : Jun 09, 2016
Password expires : Jun 10, 2016
Password inactive : never
Account expires : Jun 10, 2016
Minimum number of days between password change : 0
Maximum number of days between password change : 1
Number of days of warning before password expires : 7
You user's password must be changed - the chage output doesn't even show when user's password will expire...
root@Nagios:~# chage -l harsha
Last password change : password must be changed
Password expires : password must be changed
Password inactive : password must be changed
Account expires : Jun 16, 2016
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
root@Nagios:~# /home/harshas/check_passwd_expiration
PASSWD_EXPIRATION CRITICAL - , Excluded account(s): [none]
Most probably, this is the reason why the plugin doesn't show the user for you as it does it for me.

It is also possible that the plugin would show this (PASSWD_EXPIRATION CRITICAL -) if the user's password is ALREADY expired. Try resetting the password and see if this is going to help.

FYI, this is NOT one of our "official" plugins (it's a 3rd party plugin), so we are not familiar with it. We tested it in-house though, and it worked for us (for me and a co-worker).

Re: how do i monitor Linux User Account Status

Posted: Fri Jun 10, 2016 2:12 pm
by harsha.s.aryan
i changed only issue is am not getting which user account is expired.

Code: Select all

root@Nagios:~# chage -d 1 harsha
root@Nagios:~# chage -l harsha
Last password change                                    : Jan 02, 1970
Password expires                                        : Mar 03, 1970
Password inactive                                       : Apr 02, 1970
Account expires                                         : Jun 16, 2016
Minimum number of days between password change          : 0
Maximum number of days between password change          : 60
Number of days of warning before password expires       : 14
root@Nagios:~# /home/harshas/check_passwd_expiration
PASSWD_EXPIRATION CRITICAL - , Excluded account(s): [none]
is there any way to get that user account in output

Re: how do i monitor Linux User Account Status

Posted: Fri Jun 10, 2016 2:18 pm
by rkennedy
Because the dates are set to the following -

Code: Select all

Last password change                                    : Jan 02, 1970
Password expires                                        : Mar 03, 1970
Password inactive                                       : Apr 02, 1970
The plugin does not know what to do. Can you try setting these to dates that are in the future, and try again?