Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-2009, 02:10 PM
Special Member
 
Posts: 128
Default Notify Locked/Inactive accounts

Is there any way to notify the admin when any account went lock/inactive?
Reply With Quote
  #2 (permalink)  
Old 11-16-2009, 03:17 PM
Moderator
 
Posts: 1,147
Default

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?
Reply With Quote
  #3 (permalink)  
Old 11-16-2009, 03:41 PM
Special Member
 
Posts: 128
Default

Quote:
Originally Posted by ArcaneMagus View Post
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?
Is it possible to implement these notifications? I just want to know which users are probably no longer (inactive) working with us. Cause very often HR forget to ask me to close their account.
Reply With Quote
  #4 (permalink)  
Old 11-16-2009, 03:43 PM
Moderator
 
Posts: 1,147
Default

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?
Reply With Quote
  #5 (permalink)  
Old 11-16-2009, 03:50 PM
Special Member
 
Posts: 128
Default

Quote:
Originally Posted by ArcaneMagus View Post
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?
Both ArcaneMagnus, but for my job the "inactive" notification is more useful.
Reply With Quote
  #6 (permalink)  
Old 11-16-2009, 04:06 PM
Moderator
 
Posts: 1,147
Default

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:
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;
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:
zmprov ma admin@domain.com +zimbraAdminSavedSearches "Inactive Accounts (60 days) : (zimbraLastLogonTimestamp<=###JSON:{func: ZaSearch.getTimestampByDays, args:[-60]}###)"
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 of
Code:
zmprov ga user1@domain.com | grep "zimbraLastLogonTimestamp:"
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.
Reply With Quote
  #7 (permalink)  
Old 11-17-2009, 02:10 AM
Special Member
 
Posts: 128
Default

Quote:
Originally Posted by ArcaneMagus View Post
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:
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;
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:
zmprov ma admin@domain.com +zimbraAdminSavedSearches "Inactive Accounts (60 days) : (zimbraLastLogonTimestamp<=###JSON:{func: ZaSearch.getTimestampByDays, args:[-60]}###)"
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 of
Code:
zmprov ga user1@domain.com | grep "zimbraLastLogonTimestamp:"
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.
Thanks ArcaneMagus, you're the man
Reply With Quote
  #8 (permalink)  
Old 09-01-2010, 07:05 AM
Member
 
Posts: 14
Default

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
Reply With Quote
  #9 (permalink)  
Old 09-01-2010, 07:11 AM
Zimbra Consultant & Moderator
 
Posts: 20,312
Default

Quote:
Originally Posted by jimm View Post
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??
It tells you in one of the earlier posts:

Quote:
Originally Posted by ArcaneMagus View Post
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.
__________________
Regards


Bill
Reply With Quote
  #10 (permalink)  
Old 09-01-2010, 07:41 AM
Member
 
Posts: 14
Default

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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.