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

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 Display Modes
  #1 (permalink)  
Old 10-06-2009, 06:21 PM
Active Member
 
Posts: 32
Default creating script to manage zmprov commands from remote server using ssh.

im developing a little bash script to group all the importants command
to create, delete, change quota and disabling accounts from a external web interface using php_ssh2 to connect to my zimbra server.

I want know if the zmprov command drop sucess or error codes number if
the comand run sucessfully or not.
Reply With Quote
  #2 (permalink)  
Old 10-06-2009, 08:13 PM
Special Member
 
Posts: 164
Default

Yes, it drop code number, you can check by use "system" command of perl language:
$numberCode = system("zmprov ga abc@domain.com");
print $numberCode
hope this help
when U success, can u upload your code here?
Reply With Quote
  #3 (permalink)  
Old 10-06-2009, 10:38 PM
Active Member
 
Posts: 32
Default

Thanks.. sure, i can upload the code little more later. I not really a programmer, so my code its so basic.
My works is around this:
I have a webserver with apache+ssl+php and a php system did it by the programer senior. This program create and delete accounts from email server using cyrus system and sasldb berkeley DB. It also update a ldap server and a main alias map. So, im going to migrate that system with around 14000 mailboxes to zimbra. The office want keep the php manager program but they want update it removing the cyrus mailboxes module and create the new system for zimbra. So. I compiled php with SSH support to connect from the webserver to zimbra system using public/private keys and executing remote commands sending args to my bash script on my zimbra server. So.
If the new program call ssh "user@zimbra ./bashcript create user@domain.com password" my script will create the account, on zimbra and set the proppers options for all created users. Again, if the php system want erase any user, check their quota, account status and enable or disable it, all is did it by my bash script and not directly using the zmprov commands.
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0