How Do You Use DSStats
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17062
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
DSStats collects data into several tables:
Transient Tables
data_source_statistics_hourly_cache
data_source_statistics_hourly_last
Permanent Statistical Tables:
data_source_statistics_hourly
data_source_statistics_daily
data_source_statistics_weekly
data_source_statistics_monthly
data_source_statistics_yearly
The hourly cache and the last tables are memory tables. The hourly cache can bet big, depending on the number of data sources. The last table contains prior measurements of data for counters and derive type RRDfile data sources types.
If you want to get the last sampled data for anything:
If you want to get the max and average for the last hour:
If you want to get the top ten "traffic_in" for the last hour:
As I mentioned in the release notes, this plugin is really an INFRASTRUCTURE plugin, so if you are not a Plugin Developer, it will serve no purpose but to confuse you.
TheWitness
Transient Tables
data_source_statistics_hourly_cache
data_source_statistics_hourly_last
Permanent Statistical Tables:
data_source_statistics_hourly
data_source_statistics_daily
data_source_statistics_weekly
data_source_statistics_monthly
data_source_statistics_yearly
The hourly cache and the last tables are memory tables. The hourly cache can bet big, depending on the number of data sources. The last table contains prior measurements of data for counters and derive type RRDfile data sources types.
If you want to get the last sampled data for anything:
Code: Select all
SELECT value FROM data_source_statistics_hourly_cache
WHERE local_data_id=??? AND rrd_name=???
ORDER BY time DESC
LIMIT 1;
Code: Select all
SELECT average, peak FROM data_source_statistics_hourly
WHERE local_data_id=??? AND rrd_name=???
Code: Select all
SELECT average, peak FROM data_source_statistics_hourly
WHERE rrd_name='traffic_in'
ORDER BY average DESC
LIMIT 10;
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
-
- Posts: 8
- Joined: Thu Aug 06, 2009 1:32 pm
- Location: Germany
I'm trying to write a Superlink Page which diplays this 10 DS/Graphs. Therefor i need the GraphID to build the correct URLs.TheWitness wrote: If you want to get the top ten "traffic_in" for the last hour:
Code: Select all
SELECT average, peak FROM data_source_statistics_hourly WHERE rrd_name='traffic_in' ORDER BY average DESC LIMIT 10;
What would be the best join to select the corresponding GraphID.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
I'd like to know the answer to this too. I know how to do it for a single local_data_id, but not as a join for a list....
Here's how to get a local_graph_id that contains a local_data_id:
So that's the first graph that contains a graph_item that refers to your local_data_id. It all goes a bit wrong once you start adding extra tables to the join though (for me anyway).
Here's how to get a local_graph_id that contains a local_data_id:
Code: Select all
select graph_templates_item.local_graph_id as lgi FROM graph_templates_item,graph_templates_graph,data_template_rrd where graph_templates_graph.local_graph_id = graph_templates_item.local_graph_id and task_item_id=data_template_rrd.id and local_data_id =$local_data_id LIMIT 1;
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
-
- Posts: 8
- Joined: Thu Aug 06, 2009 1:32 pm
- Location: Germany
Howie posted here http://forums.cacti.net/viewtopic.php?p=174235#174235 a Superlink Page which answers this question.
Code: Select all
SELECT
DISTINCTROW dss.rrd_name,
dss.calculated,
graph_templates_graph.local_graph_id,
data_template_rrd.local_data_id,
dtd.name_cache
FROM
graph_templates_item,
graph_templates_graph,
data_template_rrd,
data_template_data dtd,
data_source_stats_hourly_last dss
WHERE
graph_templates_graph.local_graph_id = graph_templates_item.local_graph_id
and dtd.local_data_id = dss.local_data_id
and graph_templates_item.task_item_id=data_template_rrd.id
and dtd.local_data_id = data_template_rrd.local_data_id
and dss.calculated > 0
and (rrd_name='errors_in' or rrd_name='errors_out')
order by name_cache, rrd_name
Graphing a whole lot of Siebel stuff !
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Yeah, I finally figured out where my query was going wrong
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
- phalek
- Developer
- Posts: 2838
- Joined: Thu Jan 31, 2008 6:39 am
- Location: Kressbronn, Germany
- Contact:
My understanding is that DSStats give you just one data item.
E.g. the last error counter of an interface
and averages for hour(?) day week ...
But it does not have all data of today, or a week.
I think that is what the "Transporter" plugin is for, which actually saves the polled data into the mysql database ( which then gets quite hudge ... )
Correct me if I am wrong here
E.g. the last error counter of an interface
and averages for hour(?) day week ...
But it does not have all data of today, or a week.
I think that is what the "Transporter" plugin is for, which actually saves the polled data into the mysql database ( which then gets quite hudge ... )
Correct me if I am wrong here
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
- TheWitness
- Developer
- Posts: 17062
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
It aggregates. So, you have X samples of actual values, Y hours of hourly averages, Z days of daily averages, etc... for every data source there is. The value of Y is configurable.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 2 guests