Migrating comments from V2 to V3?

Are the status and retention files in V3 human-readable? We have a heavily commented V1 installation I’d like to upgrade. I know how to migrate the comments from V1 to V2.

For V2 to V3 I am going to have to cut and paste the comments file into the status and/or retention files, I guess.

TIA -w

Both status and retention files are human readable. I think it shouldn’t be any problems with migrating those files from v2 to v3. Haven’t done that but think there wasn’t some major differences. You can try to see if it will work, but backup first :wink:

Migration was fairly straight forward:

  • Comments are held in the status.dat file until nagios is shut down, when they are moved to retention.dat.

  • Changes made to status.dat won’t work, you have to shut Nagios down and edit retention.dat.

  • I didn’t know quite what to do about ID numbers - for importing my old comments I just started at 1000. I don’t know if this will cause problems in the future.

  • Comments in the form:

[1219768920] HOST_COMMENT;74;hostname;1;User;New server online.

(I think the 1 means “persistent”)

Shoudl be translated to:

hostcomment {
host_name=hostname
entry_type=1
comment_id=1074
source=0
persistent=1
entry_time=1219768920
expires=0
expire_time=0
author=User
comment_data=New server online.
}

You could of course easily script this. I think the change to the {}-delimited format was actually made in the V1 to V2 transition.

We had no problems going all the way from V1 to V3, except that we had a lot of contacts defined in our hostgroups, and V3 (and V2 IIRC) do not allow this.