Hello,
When using graph templates that ask users to input values for HRULE or VRULE lines during instantiation of such templates, how can one print the value of the HRULE or VRULE to the legend?
If you can do the above with a COMMENT, how does one "associate" the value of the HRULE or VRULE to the COMMENT (e.g. Use |"something esoteric variable name"| notation in the COMMENT.)?
I have posted this question a couple of weeks ago; so, excuse me, but I think it would be useful for others to know how to do this undocumented task.
Thank You,
gm20175
Printing user specified HRULE, VRULE values in legend.
Moderators: Developers, Moderators
I'm in a similar situation. I have a series of graphs that I'd like to display a HRULE and a COMMENT, but the values have to be entered by hand.
I have it working but the title of the graph appears to get messed up so I'll work on that. However, here's how I did what you're asking for.
Find the graph template you want to augment from within "Graph Templates", check the box next to it, and select "duplicate" in the actions box. Give it a new name.
Edit the graph template. Add a new graph template item with the information you want. Leave the value blank.
Then (and here's the magic) add a graph input item (in the section below the graph template items). The field type is "Value" and associate it with the item you just created.
Then go to "Graph Management", search for the graphs you want to change, and change the template to the one you made above. You'll then have to select each individual graph and enter the required data by hand.
I think that when you create new graphs using this template you'll be prompted for the information.
Sean
Edit: Clarified location of graph input items
I have it working but the title of the graph appears to get messed up so I'll work on that. However, here's how I did what you're asking for.
Find the graph template you want to augment from within "Graph Templates", check the box next to it, and select "duplicate" in the actions box. Give it a new name.
Edit the graph template. Add a new graph template item with the information you want. Leave the value blank.
Then (and here's the magic) add a graph input item (in the section below the graph template items). The field type is "Value" and associate it with the item you just created.
Then go to "Graph Management", search for the graphs you want to change, and change the template to the one you made above. You'll then have to select each individual graph and enter the required data by hand.
I think that when you create new graphs using this template you'll be prompted for the information.
Sean
Edit: Clarified location of graph input items
I'm still unclear what I've done but I had to associate the graph template with the data template, and set that up.
Data Queries->SNMP - Interface Statistics->Add
Don't forget to get the data sources correct, by default I found they both referred to the same one (bytes in) rather than in and out.
Gandalf, I'm curious why this isn't taken care of when I duplicated the graph template? I would have thought that if I duplicated a graph template that I'm always going to be using the same data template.
I'll have to pull up the docs on this one a bit later.
Sean
Data Queries->SNMP - Interface Statistics->Add
Don't forget to get the data sources correct, by default I found they both referred to the same one (bytes in) rather than in and out.
Gandalf, I'm curious why this isn't taken care of when I duplicated the graph template? I would have thought that if I duplicated a graph template that I'm always going to be using the same data template.
I'll have to pull up the docs on this one a bit later.
Sean
Found the answer!
OK,
SeanW, we are doing something similar, but what I was trying to do is an extension---adding a user configured HRULE's or VRULE's value to the legend in the same format as other legend items: [color] [description] [value].
These H or V RULEs can be used to put static baselines, thresholds, or other information on graphs---plus, have their actual value appear in the legend like other legend items.
I figured out how to do this, finally---here is how you configure the graph template for an HRULE:
1. Add an HRULE to the graph template:
set Data Source to "None"
set Graph Item Type to "HRULE"
set Value to blank
set Text Format to a description of the HRULE (e.g. Threshold:) < this will appear on the legend
click save
2. Add a COMMENT to the graph template:
set Data Source to "None"
set Graph Item Type to "COMMENT"
set Value to blank
set Text Format to blank
click save
3. Add a Graph Item Inputs for the HRULE:
set Field Type to Value
set Name to a description of the HRULE (e.g. Value [Threshold])
select Associated Graph Items checkbox for the HRULE created in step 1
click save
4. Add a Graph Item Inputs for the COMMENT:
set Field Type to Text Format
set Name to a description of the COMMENT (e.g. Text Format [Threshold])
select Associated Graph Items checkbox for the COMMENT created in step 2
5. Create or edit a graph template instance:
Now when you create an instance of the template or edit an existing instance of the template using Graph Management, you will be asked the value of the HRULE and the text format of the Comment---set the value to the numerical value of the HRULE and set the text format to the numerical value of the HRULE plus its units (e.g. 10 msec). Note: Other descriptive text can be added here, also. Click save, and view your graphs---the HRULE value will print the [color][description] part of the legend item and the COMMENT text format will print the [value] part of the legend item.
This configuration can be used multiple times on the same graph template for other HRULEs or VRULEs.
Hope this helps!
gm20175
SeanW, we are doing something similar, but what I was trying to do is an extension---adding a user configured HRULE's or VRULE's value to the legend in the same format as other legend items: [color] [description] [value].
These H or V RULEs can be used to put static baselines, thresholds, or other information on graphs---plus, have their actual value appear in the legend like other legend items.
I figured out how to do this, finally---here is how you configure the graph template for an HRULE:
1. Add an HRULE to the graph template:
set Data Source to "None"
set Graph Item Type to "HRULE"
set Value to blank
set Text Format to a description of the HRULE (e.g. Threshold:) < this will appear on the legend
click save
2. Add a COMMENT to the graph template:
set Data Source to "None"
set Graph Item Type to "COMMENT"
set Value to blank
set Text Format to blank
click save
3. Add a Graph Item Inputs for the HRULE:
set Field Type to Value
set Name to a description of the HRULE (e.g. Value [Threshold])
select Associated Graph Items checkbox for the HRULE created in step 1
click save
4. Add a Graph Item Inputs for the COMMENT:
set Field Type to Text Format
set Name to a description of the COMMENT (e.g. Text Format [Threshold])
select Associated Graph Items checkbox for the COMMENT created in step 2
5. Create or edit a graph template instance:
Now when you create an instance of the template or edit an existing instance of the template using Graph Management, you will be asked the value of the HRULE and the text format of the Comment---set the value to the numerical value of the HRULE and set the text format to the numerical value of the HRULE plus its units (e.g. 10 msec). Note: Other descriptive text can be added here, also. Click save, and view your graphs---the HRULE value will print the [color][description] part of the legend item and the COMMENT text format will print the [value] part of the legend item.
This configuration can be used multiple times on the same graph template for other HRULEs or VRULEs.
Hope this helps!
gm20175
- Attachments
-
- Example of user specified HRULEs with useful legend item.
- graph-hrule-legend.png (19.1 KiB) Viewed 14572 times
-
- Posts: 12
- Joined: Tue Jun 15, 2010 5:30 am
Re: Printing user specified HRULE, VRULE values in legend.
In new version of cacti is not possible this solution because rrdtool want value for HRULE and COMMENT, but you can add HRULE and COMMENT with some strange value. For example for traffic graphs I use default HRULE value 100000000000 (100G) and line is not come, but for specific ports I can edit this HRULE with desired value and for COMMENT is "No limit" or something else...
Who is online
Users browsing this forum: No registered users and 5 guests