Migrating perfdata

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Migrating perfdata

Post by WillemDH »

hello,

I'd love to find a way to safely upgrade my NSClient from 0.4.1.105 to 0.5.0.x on Windows Servers.

But as you know a lot has changed since. One of the things is the perdata returned by standard services, such as drive usage. After doing a standard upgrade, I noticed the perfdata is getting switched. C__% becomes C__used and C_ becomes C__used_% resulting in a graph where used % and used GB are suddenly switched.

How could I prevent this from happening? What would be the best way to keep my history and being able to migrate safely with changed perfdata? I would need to do this in a scripted way, as I have 600 servers on my todo. If it's too much manual labour, I will just have to remove the old rrd and xml for each service i'm migrating with changed perfdata implying I'm loosing 3 year old history. :(

I'm open for alternative options, such as renaming the service to DRV_C_Usage.old and then starting from scratch in a new DRV_C_usage. But how can I script a rename of a service. What needs to b done in the xml and rrd? Just sed replace all old servicenames to the new service names?

Grtz

Willem
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Migrating perfdata

Post by tgriep »

I found this in the NSClient forums. There seems to be a workaround but I can't seem to get it to work.
http://forums.nsclient.org/t/checkdrive ... -data/3471
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Migrating perfdata

Post by Box293 »

So from what I understand, the data in the RRD files is stored in datasource numbers, like [1] [2] etc. There is no direct relationship to the name vs the number.

Hence because the perfdata strings coming back from NSClient++ has changed the order of the data, it's being put into the wrong datasource in the RRD.

So this KB article might be a good starting point.

https://support.nagios.com/kb/article.php?id=497

There is a rrd_modify.pl script which can do an insert or delete.

If I'm correct, it exports the data to an xml file and then imports it into a new rrd file.

You could make an alternative script that did the same thing, but just flipped the datasources around perhaps.

Also, this KB article uses the rrdtool command tom do the dump and restore commands.

https://support.nagios.com/kb/article.php?id=166

Perhaps you could dump, then use a grep to flip the datasource numbers around and then import.

The end solution is most likely:
  • Move all performance data files to a different location to let them be recreated new with the right datasource numbering
    Compare the old files to the new (rrdtool info) to determine the order of datasource numbers so you know where the old needs to be imported into the new
    Do the import into the new files
Let us know if you come up with something, as this would make a good KB article.
Last edited by Box293 on Sun May 01, 2016 8:57 pm, edited 1 time in total.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Migrating perfdata

Post by WillemDH »

Oh Troy, you made my head spin with your answer. Look's like there is no easy fix. Why is rrd so hard. Using a lot of InfluxDB lately which is a revelation. Nagios should consider dumping rrd and switch to InfluxDB. :) (I guess it's easier said then done.. ;) )

Well, as I'm working on a command which also contains the total size in the perfdata, there is a chance it gets even more complicated. it might just be the best idea to keep the existing services and create a new service with the new perfdata.

i'll have to investigate further. tbc
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Migrating perfdata

Post by rkennedy »

I'll leave this open should you have any questions in the future, Willem.
Former Nagios Employee
Locked