[SOLVED] 'zmprov ma' returns null

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
kumar nishant
Posts: 4
Joined: Sat Sep 13, 2014 12:25 am

[SOLVED] 'zmprov ma' returns null

Post by kumar nishant »

Hi,

I want to capture the output of the 'zmprov ma' command from CLI. But the problem is that the command returns null when, for example I try to change the account status to 'active' when the account is already 'active' which is the same when the account was previously in 'locked' state.
I need to differentiate between the two actions by the command's return value. Can u help me to work around this little problem?
dustys
Advanced member
Advanced member
Posts: 67
Joined: Fri Sep 12, 2014 10:25 pm

[SOLVED] 'zmprov ma' returns null

Post by dustys »

I'm guessing the only way to accommodate this would be to run a 'zmprov ga' and check for your value, run the 'zmprov ma', and then run the 'zmprov ga' to see if it changed. I understand that this running 2 extra commands, but I believe returning (null) is standard for success in a *NIX environment. :)
Just a thought!
Cheers,

Dusty
kumar nishant
Posts: 4
Joined: Sat Sep 13, 2014 12:25 am

[SOLVED] 'zmprov ma' returns null

Post by kumar nishant »

Hi Dusty,

The problem is when i have to run the command for multiple users(like 1000 or more). In that case those 2 extra commands would be quite an overhead...
Any other workarounds?
Cheers,

Nishant.
bdial
Elite member
Elite member
Posts: 1633
Joined: Fri Sep 12, 2014 10:39 pm

[SOLVED] 'zmprov ma' returns null

Post by bdial »

if you're concerned about performance you should probably look at doing a custom soap script, the startup/teardown overhead associated with zmprov is pretty great thats why it takes a few seconds to execute any commands.
you could try running zmprov with the -v (verbose) or -d (debug) options and see if that produces any output that could be helpful for you but I doubt it will because when you do a zmprov ma you're just changing the value of a field and it really does not care what the existing value was.
kumar nishant
Posts: 4
Joined: Sat Sep 13, 2014 12:25 am

[SOLVED] 'zmprov ma' returns null

Post by kumar nishant »

Running zmprov with -d(debug) does help. Now i can run grep on the output. This is much lighter with very low overhead.

Though this still leaves a lot of scope for improvement. May be custom soap scripts will help.
Thanks n Cheers,

Nishant.
Post Reply