#376 Sysadmin user monitoring
Closed: Fixed None Opened 12 years ago by mmcgrath.

Part of being in an Infrastructure FIG is that if you've been absent for 6 months from a box we can remove you from the group. We need someone to write up a script to do this. I'd prefer bash, but python would be fine.


  • Normally runs on bastion but could run on any machine
  • Checks the last time all users logged in
  • Users that have not logged in in 6 months or more, get printed
  • (Optional) The groups that those users are in (sysadmin-) also gets printed.

This script will run once a month and email the admins. output would look something like this:

Stale Users found:
Username | Group(s)

oldUser | sysadmin-main
notYoungUser | sysadmin-tools,sysadmin-noc

Reminder, if you want the ticket, assign it to you so no one else works on the same thing. If you run out of time, can't do it or don't want to, please re-assign it back to sysadmin-noc-members

Attached the file for review, it appears to work. :D Always happy to hear comments or suggestions as I am fairly new at the scripting stuff.

so the script needs some more work. doesn't exclude all the system accounts.

finished the script, according to mmcgrath it will work. closing the ticket...

Login to comment on this ticket.