... Migrate performance data/history to a new service check

6 replies [Last post]
mattywhi's picture
mattywhi
User offline. Last seen 1 week 4 days ago. Offline
Opsview Sensei - 5th DanOpsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 01 Dec 2008
Posts:
Points: 2517

Having spent the day creating lots of new service checks using teh Host Attributes feature I realise that the new checks will have no history/perf data to reference.

What I would like to do is "migrate" the data in the relevant ODW tables so that I can keep my graphs looking contiguous and not have a big gap where the old data is no longer present.

Can someone let me know a) if they have done this before and b) what the vague update statement i would be looking to run on the ODW database is.

Thanks,

0
Your rating: None
tonvoon's picture
tonvoon
User offline. Last seen 5 days 7 hours ago. Offline
Opsview Sensei - 1st Dan
Joined: 26 May 2010
Posts:
Points: 65

Bad news: a lot of data in ODW is keyed by the name of things (host names, service names), so changing a name is considered to be a new item

Good news: since ODW is designed as a datawarehouse, you can make changes to the historical data so that it points to the new names. This is usually the "data cleansing" step that some datawarehouse administrators do.

Bad news: we haven't documented this. But it should be a case of renaming the old service names in the servicechecks table to be the same as the current service name. This is like "changing the name of the service back in time".

Note: this doesn't change the graphs drawn via RRD as that uses different technology.

Your rating: None
mattywhi's picture
mattywhi
User offline. Last seen 1 week 4 days ago. Offline
Opsview Sensei - 5th DanOpsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 01 Dec 2008
Posts:
Points: 2517

Thats what I thought you would say :)

the checks I want to change are from NRPE queries against Windows hosts. I presume if i run the right update statement against the ODW tables to replace the old servicecheck_id with the new one the perf data graphs should update or are they still generated by rrd?

Your rating: None
tonvoon's picture
tonvoon
User offline. Last seen 5 days 7 hours ago. Offline
Opsview Sensei - 1st Dan
Joined: 26 May 2010
Posts:
Points: 65

Performance graphs are generated from RRD, so those would start afresh.

I know Jose has managed to write some SQL to get data from ODW and regenerate RRD files, but I don't know how he did it....

Your rating: None
mattywhi's picture
mattywhi
User offline. Last seen 1 week 4 days ago. Offline
Opsview Sensei - 5th DanOpsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 01 Dec 2008
Posts:
Points: 2517

Hmm - I shall have to have a play and see what I can do.
Where are the rrd files stored so i can see what i am working with?

Your rating: None
Henry78's picture
Henry78
User offline. Last seen 7 weeks 4 days ago. Offline
Opsview Sensei - 5th DanOpsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 09 Jun 2010
Posts:
Points: 1149

If you didn't find it in the meantime, files are stored at .../nagios/var/rrd/

And yes. It's possible to migrate data. Even to merge rrd files. Unfortunately I don't have an tutorial for you (yet). Everything you want to do is convered by rrdtool, which is well documented on the web: http://www.mrtg.org/rrdtool/doc/rrdtool.en.html. The procedure would be something like: dump data from old rrdfile, change it to match the new one (grep/sed/awk) if necessary. Then "rrdtool update" the data of the (Opsview-created) new rrd file.

Note, that you should be able to find some rrd merge scripts on the web.

Your rating: None
emisca's picture
emisca
User offline. Last seen 4 hours 51 min ago. Offline
Opsview Sensei - 5th DanOpsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 06 May 2010
Posts:
Points: 1685

I need to change some servicecheck scripts to add new performance variables, rrd are recreated by opsview and I loose the old rrd data (new files have different name).

 

Does replacing new rrds with old ones (when opsview is stopped) should work?

 

Thanks,

Emilio

Your rating: None