Advertisements
How can we achieve this? We can do this by using a simple python script with nrpe(nagios)
We will create the script which will take all the local users from the /etc/passwd file, check their account and password expiry and show warning if the expiry dates are less than the specified argument.
Source code can be found in github. Python script to check linux user account and password expiry
The logic is to run the linux command chage for each user and get the details from the chage output for each user. If the expiry of any user is within the warning condition, show the username with warning.
No comments:
Post a Comment
Be nice. That's all.