Announcement

Collapse
No announcement yet.

New perf data metric not showing in Centreon graphs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New perf data metric not showing in Centreon graphs

    Hi

    I have introduced a new metric in my perf data for a particular check. E.g

    PRE-CHANGE: CPU1=4; CPU2=44; CPU3=50;
    POST-CHANGE: CPU1=5; CPU2=49; CPU3=51; CPU4=10;

    I can see the new metric_id in the metrics table in MySQL and I can also see the associated rrd file with data in it. It's just that the graph in Centreon is not showing this new metric.

    I have tried the "Rebuild RRD Database" option in Centreon (Administration -> Options -> CentStorage -> Manage) but this didn't work.

    I can find the new metric in the Administration -> Options -> CentStorage -> Manage page. I also tried "Empty All Service Data" for this new metric but that just deleted the current metric_id in MySQL and the accompanying RRD file and then created new ones with a new metric_id.

    Any ideas on how to introduce this new metric to the graph without blowing away all data? I have a year's worth of data for the original metrics so want to retain that.

    Cheers

  • #2
    I dug deep last night and think I have a solution for deleting and adding new perf data without losing the original data....

    DELETING A PERF DATA METRIC:

    1. Within the MySQL database, identify the index id for the particular graph you want to modify, Here I am using a service description and hostname to filter out what I need:

    mysql> select id,host_name,service_description from index_data where service_description like '%CPU%' and host_name = 'server1';"

    2. Using the index_id from above (e.g. 84621), identify the metric_id for the particular metric you want to delete:

    mysql> select metric_id,index_id,metric_name from metrics where index_id = '84621';

    3. Now delete that particular metric (e.g 150821) from the database:

    mysql> delete from metrics where metric_id = '150821';

    4. Delete (move if unsure) the associated rrd file (I am storing perf data in RRD files not the DB - you may need to remove this from your DB if not). I've found if you leave it a while the rrd gets deleted automatically following the delete from the DB in step 3.

    # rm /opt/RRD_DATA/centreon/lib/metrics/150821.rrd

    5. Finally, "Rebuild RRD Database" in Centreon (Administration -> Options -> CentStorage -> Manage)


    ADDING A PERF DATA METRIC:

    1. Using the methods in "DELETING A DATA METRIC" above, identify the metric_id for the currents metrics in the graph where you will be adding a new metric (new perf data).

    2. Move the associated rrd files for these current metrics to a safe temporary location.

    3. In Centreon GUI (Administration -> Options -> CentStorage -> Manage), select "Empty all Service Data" for the graph where you will be adding the new metric.

    4. Run the service check where the new perf data will appear.

    5. Using the methods in "DELETING A DATA METRIC" above, identify the new index_id for your graph as this will have changed since emptying all the service data.

    6. Using the methods in "DELETING A DATA METRIC" above, identify the new metric_id's for the metrics in the graph.

    7. Copy the each rrd file back into it's original location but rename it according to the new metric_id noted in step 6. Make sure ownership is correct so Centreon can write to the rrd files.

    8. Run the check again and the graph should eventually start building with the new perf data.
    Last edited by deltasparc; 7 July 2017, 18:55.

    Comment

    Working...
    X