adding interface description to title

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

Moderators: Developers, Moderators

JudahXIII
Posts: 2
Joined: Sat May 14, 2011 3:22 am

Re:

Post by JudahXIII »

gandalf wrote:Yes. |query_ifDescr| can be added. You can change the behaviour of Interface Traffic Graph Template Title creation:
- goto Data Queries
- pick "SNMP - Interface Statistices"
- pick the correct Graph Template
- change the order of "Suggested Names" for the Graph Titles
This will work only, if the Device returns valid data for the corresponding OID!
Reinhard
Thanks gandalf so much!!!
User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: Re:

Post by willieb »

JudahXIII wrote:
gandalf wrote:Yes. |query_ifDescr| can be added. You can change the behaviour of Interface Traffic Graph Template Title creation:
- goto Data Queries
- pick "SNMP - Interface Statistices"
- pick the correct Graph Template
- change the order of "Suggested Names" for the Graph Titles
This will work only, if the Device returns valid data for the corresponding OID!
Reinhard
Thanks gandalf so much!!!
I second that! Thanks gandalf, as I was manually changing each graph title! After this post I discovered how to modify the suggested values, which saved a lot of time with over 700 graphs lol.
-willieb
User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: adding interface description to title

Post by willieb »

gandalf, or anyone...

Why won't it work if I unchecked the "Use Per-Graph Value (Ignore this Value)" box and change the graph title to "|host_description| - |query_ifAlias| (|query_ifName|) - Traffic"?

Will it query the interface alias and name to create the graph title each time? If this is true we'd never have to reapply suggested names from the data query.

I do understand that this only gives one choice and if it doesn't repond with the ifAlias if it's not set it would have "|query_ifAlias|" in the title. If this is the only drawback I'd accept this and would love to use this for the graph and data source title for certain templates. Please tell me it's so! lol
-willieb
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: adding interface description to title

Post by gandalf »

This should indeed work.
But the recommended method would be to change the sequence of "Suggested Values" for that Graph Template at that Data Query.
Then, for each new graph, it would match your recommended title setting
R.
User avatar
willieb
Cacti User
Posts: 160
Joined: Thu Jan 22, 2009 10:09 am
Location: South GA

Re: adding interface description to title

Post by willieb »

Thanks gandalf. The reason I would like to do this is to avoid having to worry about synchronization of cacti graphs when changes are made to the interface descriptions.

We have several engineers and I must rely on them to tell me to apply suggested names after a change.

So if I was to setup "|host_description| - |query_ifAlias| (|query_ifName|)" for the graph title, does it actually query the device or use cache from a previous query from cacti?

If it pulls it from the cacti query I assume I would just occasionally run the query for each device?
-willieb
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: adding interface description to title

Post by gandalf »

The description and alias stuff is indeed cached. The cache will be refreshed on each reindex operation. You may schedule a "manual" reindex by running the appropriate script each day or redefine the reindex method of the related data query to e.g. "index count changed" or the like. But if descriptions change without interface number change, reindexing won't help
R.
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: adding interface description to title

Post by kjstech »

Ok, how do I get |query_ifAlias| or |query_ifDescr.. to not appear in the graph title if they are not populated for an interface?

We have a Cisco 3750 switch stack and not all ports have descriptions on them. Some do, some don't...

Also if I do the re-apply suggested names, it wipes out the custom graph titles and returns them to the hostname - Traffic - interface name format.
Kimboaticus
Posts: 7
Joined: Sun Feb 16, 2014 9:10 pm

Re: adding interface description to title

Post by Kimboaticus »

Hi Folks,

I have a bit of an issue with this. I followed the steps recommended earlier in this thread and managed to get my In/Out Bytes with Total Bandwidth Data Query set so that the Alias for the port is displayed in the graph. I had trouble getting that working correctly and it didn't show the right title at first but eventually it work but I am not clear why. Now I am looking at using different queries and I want them to show the Alias for the port in the title, same as the In/Out Bytes. So, I added the same string and fields to each of the other Interface data queries and set the ordering as it should be but any graphs I create using these templates still only show the host name and switch port. Seeing as I am not sure how I got this to work for the other graphs in the first place, I cannot figure out why these new changes don't work now. I am running 8.8a. Any suggestions on where to look? Thanks!
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: adding interface description to title

Post by kjstech »

Guys, how can I prevent |query_ifAlias| from displaying if the switchport does not have a description?

Not all ports have a description.

Basically If ifAlias is not defined or returned from the port, then don't display it in the graph name.
Attachments
portslist.PNG
portslist.PNG (8.5 KiB) Viewed 3760 times
ports.PNG
ports.PNG (25.07 KiB) Viewed 3760 times
porzech
Posts: 23
Joined: Sat Apr 14, 2012 5:02 am

Re: adding interface description to title

Post by porzech »

You can do it going to
Data Queries then SNMP - Interface Statistics (at least its the name of the data query in my case)
Then You will see Associated Graph Templates table
Click on the template Your Graph is based on

There You will see Suggested Values table
DataTemplates part stores templates cacti will try to use for naming data sources
Gcaph Template part conatins templates for naming graphs
If i remember right the templates are tried from top to bottom when cacti tries to name new graphs and data templates and if the template line has values that are missing (ie port has no name) cacti treis next template
So You should add a new template ther with just |query_ifAlias| ommited and place it bellow the currently used query
Then go to list of Your graphs select the graph You want to get new name (mark the checkbox next to it) and then select from the combobox Reapply Sugested Names and click Go
Cacti should then skip the rule with |query_ifAlias| and use the next one You just defined and as a result You get graph without |query_ifAlias| in its name

You can mark as many graphs as you want to rename

This new template will be also considered when creating brand new graphs.
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: adding interface description to title

Post by kjstech »

Thanks, that helped for most of them!

Though some and I can't figure out why, they are adding the word "traffic" in them. I don't need the word traffic in them, I know what it is.

Like one says
dcu-core2 - Traffic -Fa2/0/23

But another one says
dcu-core2 - Gi3/0/30
Attachments
graphtemplates.PNG
graphtemplates.PNG (41.02 KiB) Viewed 3758 times
kjstech
Cacti User
Posts: 97
Joined: Thu Feb 28, 2013 2:57 pm

Re: adding interface description to title

Post by kjstech »

Oh i figured out my consistancy issue.

Fa interfaces (100mbps) are tied to In/Out Bits and Gi interfaces (1000mbps) and faster are tied to In/OUt Bits (64-bit Counters).

I fixed the description ordering now for the regular (non 64 bit counter) template and now its consistent. Thank you so much for your help.
voyager
Posts: 21
Joined: Sat Jun 14, 2014 11:01 am

Re: adding interface description to title

Post by voyager »

First of all thanks to contributors in this post. I have applied all the steps but none successful. I then go for reindex method thru cli
and faced the following:

-bash-4.1$ php cli/poller_reindex_hosts.php --id=47 -qid=1
PHP Warning: include(/var/lib/cacti/cli/../include/global.php): failed to open stream: No such file or directory in /var/lib/cacti/cli/poller_reindex_hosts.php on line 34
PHP Warning: include(): Failed opening '/var/lib/cacti/cli/../include/global.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/lib/cacti/cli/poller_reindex_hosts.php on line 34
PHP Notice: Undefined variable: config in /var/lib/cacti/cli/poller_reindex_hosts.php on line 35
PHP Warning: include_once(/lib/snmp.php): failed to open stream: No such file or directory in /var/lib/cacti/cli/poller_reindex_hosts.php on line 35
PHP Warning: include_once(): Failed opening '/lib/snmp.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/lib/cacti/cli/poller_reindex_hosts.php on line 35
PHP Notice: Undefined variable: config in /var/lib/cacti/cli/poller_reindex_hosts.php on line 36
PHP Warning: include_once(/lib/data_query.php): failed to open stream: No such file or directory in /var/lib/cacti/cli/poller_reindex_hosts.php on line 36
PHP Warning: include_once(): Failed opening '/lib/data_query.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/lib/cacti/cli/poller_reindex_hosts.php on line 36
PHP Fatal error: Call to undefined function db_fetch_assoc() in /var/lib/cacti/cli/poller_reindex_hosts.php on line 114



any body if please help me.
0815
Posts: 19
Joined: Sun Jun 07, 2020 2:47 pm

Re: adding interface description to title

Post by 0815 »

Hello,

seems between 0.8 and 1.2 something changed.
Can somebody explain me how I can add interface-name and interface-description to the Traffic-Graph?
Will interfaces descriptions in the meantime automaticaly updated in Graphs (e.g. 1 timex per day)?

thx & br
User avatar
macan
Cacti Guru User
Posts: 1104
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: adding interface description to title

Post by macan »

A lot of changes between 0.8 and actual version.

Go to Console -> templates -> graph -> choose template and use checkboxes near by Title. It allows change name.
Let the Cacti grow!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest