Is there any way to notify the admin when any account went lock/inactive?
Is there any way to notify the admin when any account went lock/inactive?
Well since an account being marked as Locked would require an admin to do this manually in the first place... why should the Administrator be notified about the action they just took?
Are you asking for a notification of when an account gets locked (not an automatic process... as I said this is a manual action of the Administrator), or a notification of when a user has been inactive for x days?
To get automatic notifications of the first you would need to write an admin Zimlet to send an alert every time an account was marked locked. You could also look into writing something that watches /opt/zimbra/log/audit.log for lines showing an account status change. The line would look something like this:
As for the second of getting a notification of when an account has been inactive for a long period of time, your best bet would be to either use the built in "Inactive Accounts" searches for 30 or 90 days, or adding your own custom one following along the model of those two searches. You would need to add this via the command line though since you can't put in a dynamic search on the time stamp in the web UI. Here is an example for a 60 day search:Code:2009-11-16 15:55:13,715 INFO [btpool0-767://email.domain.com:7071/service/admin/soap/ModifyAccountRequest] [name=admin@domain.com;mid=2;ip=192.168.1.244;ua=ZimbraWebClient - [unknown] (Win);] security - cmd=ModifyAccount; name=user1@domain.com; zimbraMailStatus=enabled; zimbraAccountStatus=locked;
But this isn't really a notification, if you specifically wanted a notification the only way that I could think of would be to write a script that parsed the output ofCode:zmprov ma admin@domain.com +zimbraAdminSavedSearches "Inactive Accounts (60 days) : (zimbraLastLogonTimestamp<=###JSON:{func: ZaSearch.getTimestampByDays, args:[-60]}###)"for every account and determined if it was past your threshold. Put this script in a cron job to run every week or so and email you the results.Code:zmprov ga user1@domain.com | grep "zimbraLastLogonTimestamp:"
Has anyone gotten this to work? It would be extremely helpful if i could get notified when an account gets locked out. I see the code above but not sure exactly what to enter in the places where it would be specific to our server name etc. Or where to run line from, does it need to be a cron job on the server??
Thanks-Jim
I apologize for my thick headedness, I have not ever written a Zimlet. Would said admin Zimlet consist of purely this particular line of code?
There are currently 1 users browsing this thread. (0 members and 1 guests)