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 12-17-2008, 02:09 PM
Active Member
 
Posts: 28
Default [SOLVED] After zmsetservername - old stats gone

I recently changed my ZCS server (ZCS 5.0.11 on CentOS 5) host name from mail2.domain.com to mail.domain.com using zmsetservername and instructions on the wiki. All went well, and everything worked again after the changes. My server is creating new data in the graphs of the server statistics admin page, but all of the old data that was generated as the old host name is not showing. I assume this is because the old server name is associated with the old data, but the system queries for data belonging to the new hostname.

Where do I go and what do I do to associate the old data to the new server name so that it will be reflected in the graphs? Is that data in the database, or is it in files in the logger directory?

Thanks
Reply With Quote
  #2 (permalink)  
Old 12-17-2008, 08:24 PM
Zimbra Employee
 
Posts: 114
Default

You'll have to update all the tables manually in the zimbra_logger database to reflect the name change.

The tables are:

+-------------------------+
| Tables_in_zimbra_logger |
+-------------------------+
| amavis |
| amavis_aggregate |
| config |
| disk_aggregate |
| disk_status |
| mta |
| mta_aggregate |
| processing_history |
| raw_logs |
| service_status |
+-------------------------+

So you'll need to do something like:

zimbra@mail:~> logmysql zimbra_logger
mysql> update `amavis` set host='newhostname' where host='oldhostname';

for each of the tables. You should probably do something like:

mysql> select * from `amavis` limit 1\G

to find out what the old hostname is set to so that you set the new hostname similarly. Likely the hostname will be just the name, without the domain, of your system. So if your system is mail.domain.com the host field will have mail.
Reply With Quote
  #3 (permalink)  
Old 12-19-2008, 11:00 AM
Active Member
 
Posts: 28
Default

Thanks Tonster, that worked. Here are the specific sql commands for each table:

These are the tables that needed alteration:
amavis: update amavis set host='mail' where host='mail2';
amavis_aggregate: update amavis_aggregate set host='mail' where host='mail2';
disk_aggregate: update disk_aggregate set host='mail.domain.com' where host='mail2.domain.com';
disk_status: update disk_status set server='mail.domain.com' where server='mail2.domain.com';
mta: update mta set host='mail' where host='mail2';
mta_aggregate: update mta_aggregate set host='mail' where host='mail2';

These tables needed no alteration:
config
processing_history
service_status
raw_logs (I ran update raw_logs set loghost='mail' where loghost='mail2'; but no rows were changed.)

All old stats showed up after making these alterations.

Last edited by warmbowski; 04-09-2009 at 10:07 AM..
Reply With Quote
  #4 (permalink)  
Old 12-19-2008, 11:32 AM
Active Member
 
Posts: 28
Default

One additional note.

For some reason my aggregate tables all had a mix of mail2 and mail2.domain.com under the host field. so I had to run the update twice for each aggregate table such as:

update amavis_aggregate set host='mail' where host='mail2';
update amavis_aggregate set host='mail.domain.com' where host='mail2.domain.com';
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.