Bandwidth updates

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

Moderators: Developers, Moderators

Post Reply
Swordfish
Posts: 15
Joined: Tue Feb 21, 2006 9:00 pm
Location: Melbourne, Victoria, Australia

Bandwidth updates

Post by Swordfish »

Hi, I'm new to this, so if there is a post with the answer kindly point me in that direction.

We are using Version 0.8.7a on RHEL Server 5

I can't find the answer to a seemingly obvious issue.

When graphing Interface bits in/out there is a max value discovered in the graph creation. In our case it is 256000.

When upgrading the link recently to 512Kb, I thought it would be easy enough to just re-poll the host via Console|Management|Devices -> '*Create Graphs for this Host' and clicking on the Green Circle.

I have also done this step via the update php script.

This all works fine, but the graph still shows a max of 256Kb.
Looking at Console|Data Sources, I see the interface settings as follows:
Data Source Item Fields [traffic_in] | Maximum Value -> 256000
Data Source Item Fields [traffic_out] | Maximum Value -> 256000

If I update both these to 512000, then all is good and the graph has a max of 512Kb.

Why is this extra step required - or more importantly, is there a way to automate this update?
I have some 80 upgrades (x2 interfaces each) to do and I'm not relishing the idea of clicking through 160 Data Sources.

Thanks, Rob.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Bandwidth updates

Post by gandalf »

Swordfish wrote:Looking at Console|Data Sources, I see the interface settings as follows:
Data Source Item Fields [traffic_in] | Maximum Value -> 256000
Data Source Item Fields [traffic_out] | Maximum Value -> 256000
I really doubt, even if I did not try recently. Cacti is known NOT to update existing rrd files when changing MAX values. You will have to run

Code: Select all

rrdtool tune ... --maximum ...
for each datasource
Reinhard
Swordfish
Posts: 15
Joined: Tue Feb 21, 2006 9:00 pm
Location: Melbourne, Victoria, Australia

Post by Swordfish »

Thanks gandalf,

Searching through things today, I have come to that conclusion, and found that same command.

Going back to the configured maximum within Cacti....
Is there any way to take a newly re-polled data source and pass the newly discovered bandwidth value to be the configured maximum as shown in the 'Data Source Item Fields' - or is that currently not automate-able?

Additionally can you clarify the content/use of the SQL table 'host_snmp_cache'.
It seems to have the newly discovered bandwidth value - I was wondering if I could use that value as a check against the 'data_template_rrd' table and report inconsistencies that could then be fixed.

Rob :-)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Swordfish wrote:Thanks gandalf,

Searching through things today, I have come to that conclusion, and found that same command.

Going back to the configured maximum within Cacti....
Is there any way to take a newly re-polled data source and pass the newly discovered bandwidth value to be the configured maximum as shown in the 'Data Source Item Fields' - or is that currently not automate-able?
No automatism ATM. "Some" new features planned for 088, but that won't help for now.
Additionally can you clarify the content/use of the SQL table 'host_snmp_cache'.
It seems to have the newly discovered bandwidth value - I was wondering if I could use that value as a check against the 'data_template_rrd' table and report inconsistencies that could then be fixed.
That would be an option. This table is updated on each "reindex" processing. But you won't compare only host_snmp_cache to settings of the data source (e.g. the SQL table within cacti) but to the current setting of the real rrd file because they may differ. Would make up a new nice plugin, IMHO. An option to adjust selected datasources/rrd files would make it nearly perfect, you know ... You may want to talk to cigamit, concerning this issue. He's half the way through it, at least in his brain ...
Reinhard
Swordfish
Posts: 15
Joined: Tue Feb 21, 2006 9:00 pm
Location: Melbourne, Victoria, Australia

Post by Swordfish »

Sent this to cigamit:
Hi cigamit,

gandalf suggested I talk to you re:
http://forums.cacti.net/viewtopic.php?p ... e99#130154

I have no idea about writing plugins, and I would have thought an option to reindex/repoll -> save (and update datasources with new maximums) would have been built in, but alas it is not.

So far I researched enough to write a shell or perl script to:

1. SELECT 'id' FROM 'host' where 'description' = 'hostname'
2. SELECT * FROM 'host_snmp_cache' where 'host_id' = ... (save the data for later)
3. run poller_reindex_hosts.php -id=....
4. do #2 again, compare the two and note where 'ifSpeed' is different
take note of the 'snmp_query_id' and 'snmp_index' values.
5. SELECT 'id', 'data_template_id','snmp_query_id','snmp_index' FROM 'data_local' where 'host_id' = ... (and where the above snmp values match)
6. SELECT 'id', 'local_data_id','rrd_maximum' FROM 'data_template_rrd' where 'local_data_id' = {id from #5}
7. SELECT 'id', 'local_data_id', 'data_source_name' FROM 'data_template_rrd' where 'local_data_id' = {id from #5}
8. SELECT 'id','data_source_path' FROM 'data_template_data' where 'local_data_id' = {id from #5} (save the ds_name)
9 SELECT 'id','data_source_path' FROM 'data_template_data' where 'local_data_id' = {id from #5} (save the ds_path)
10. run rrdtool tune {ds_path} --maximum {ds_name}:{new value}
11. and then of course update : 'rrd_maximum' FROM 'data_template_rrd'

I know there will be a way to simplify the above in to less 'selects' - I will be talking to an MYSQL expert today about that.

One flaw in the above process is that if a reindex occurs (uptime goes backward), then there will be no difference @ #4. Maybe I just ignore that , and update all rrds regardless.

Do you see a better / simpler way

(I'd like to see poller_reindex_hosts.php updated to do this for you)

Thanks, Rob
Rob
Swordfish
Posts: 15
Joined: Tue Feb 21, 2006 9:00 pm
Location: Melbourne, Victoria, Australia

Post by Swordfish »

Gandalf,
but to the current setting of the real rrd file because they may differ
why should they differ? - for Bandwidth thy should be the same, graphs of other data might be different.
What scenario do you suggest they would be different?

Rob :-)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

If an interface is discovered lets say being 10 Mbps and later changes to 100MBps (e.g. auto-negotiation), this change will neither be reflected in the data source nor in the rrd file.
The usual workaround is to rrdtool tune the rrd file. Thus, it will differ from the data source definition within cacti, if you do not adjust this one as well.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests