a way to identify Graph Items?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
rootameen
Posts: 5
Joined: Wed Sep 30, 2015 6:28 am

a way to identify Graph Items?

Post by rootameen »

Hi guys,

I have multiple graphs under graph management.

Each graph has over 100 graph items for different purposes.

My issue is that sometimes I get requests to modify or delete a single data source from the graph. But it takes HOURS to do these changes since each item is named Item #5 Item #38 Item #210 and so on! Plus there's no way to search among items based on the data source for the item.

How do you work with such issue? is there a way to change the name from the item# to something like the data source name?

Thanks!<
silvertip257
Posts: 33
Joined: Sun Mar 25, 2012 12:22 pm

Re: a way to identify Graph Items?

Post by silvertip257 »

rootameen wrote:Hi guys,

I have multiple graphs under graph management.

Each graph has over 100 graph items for different purposes.

My issue is that sometimes I get requests to modify or delete a single data source from the graph. But it takes HOURS to do these changes since each item is named Item #5 Item #38 Item #210 and so on! Plus there's no way to search among items based on the data source for the item.

How do you work with such issue? is there a way to change the name from the item# to something like the data source name?

Thanks!<
I don't often have to delete or tweak which Data Source/RRA is referenced, but when I do ... yes, it is cumbersome.

You could compare Data Source IDs to determine which is used where.
Couple of options, the former (using only the Cacti web interface) probably being the easiest and most ideal.

Method #1
  1. From Console View, choose Data Sources in left menu
  2. Next filter by your host
  3. Find the DS in question
  4. Make note of the number in the ID column
    • Also be aware that if you were to click on the blue hyperlink name for the DS, you'd find the path to the Round Robin Archive (RRA saved in an RRD file) which also has the ID number
  5. Write down or switch to another web browser tab
  6. From Graph View, view the graphs for the host in question
  7. On the graph that has the DS you are interested in, click the wrench image
  8. Take a look at the longer DEF lines which reference the RRA file
  9. Compare the two RRA ID numbers should match up (though this could get complicated if you have a RRA with multiple DSes inside it).
    • Once again, you can use the ID number from either of the two DS locations mentioned above
Method #2
With Data Templates which do not allow for custom DS names, you don't have the option of modifying the DS name. Otherwise that would be an option to give you peace of mind, though it is tedious and cumbersome to do that just to identify which DS it is.

Method #3
Also, with SQL DB access and a data map of the database (to help keep it straight), you could write queries that will give you the information and potential ease you need. Database backups are highly recommended in that case. Not for the faint of heart! :wink:
silvertip257
rootameen
Posts: 5
Joined: Wed Sep 30, 2015 6:28 am

Re: a way to identify Graph Items?

Post by rootameen »

Sorry, maybe I wasn't clear enough.

I have some graphs that are based on stacking multiple interfaces / devices to show total stats. The issue is that I cannot show the name of each item next to it. If I insert it in the value field it will try to put it in the graph as a legend but that will stop graphing since I'm basing my graph on areas.

Image

I hope this makes it a bit clearer. Is there a way I can add it next to the (traffic in / out)?

Thanks!
rootameen
Posts: 5
Joined: Wed Sep 30, 2015 6:28 am

Re: a way to identify Graph Items?

Post by rootameen »

Found a fix. to be edited.
silvertip257
Posts: 33
Joined: Sun Mar 25, 2012 12:22 pm

Re: a way to identify Graph Items?

Post by silvertip257 »

rootameen wrote:Sorry, maybe I wasn't clear enough.

I have some graphs that are based on stacking multiple interfaces / devices to show total stats. The issue is that I cannot show the name of each item next to it. If I insert it in the value field it will try to put it in the graph as a legend but that will stop graphing since I'm basing my graph on areas.

<...snipped...>

I hope this makes it a bit clearer. Is there a way I can add it next to the (traffic in / out)?

Thanks!
;-) Yeah, gotcha now.
Use the Text Format field (accessed when editing each graph item) to put in labels/text.
rootameen wrote: Found a fix. to be edited.
Please share your solution.
silvertip257
rootameen
Posts: 5
Joined: Wed Sep 30, 2015 6:28 am

Re: a way to identify Graph Items?

Post by rootameen »

1. On line 571 of The following file: /var/www/cacti/graphs.php Add the following to the query:

data_template_data.name_cache,


​2. ​On line 621 of the following file: /var/www/cacti/lib/html.php Change the line to the following:

$matrix_title = "(" . $item["data_source_name"] . "): " . $item["text_format"] . $item["name_cache"];


Results after implementing the fix:
Image

Good luck!
silvertip257
Posts: 33
Joined: Sun Mar 25, 2012 12:22 pm

Re: a way to identify Graph Items?

Post by silvertip257 »

Awesome.
Thanks for sharing your solution.
:)
silvertip257
rootameen
Posts: 5
Joined: Wed Sep 30, 2015 6:28 am

Re: a way to identify Graph Items?

Post by rootameen »

You're welcome :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest