Reporting: Top Talkers, busiest servers - PLUGIN AVAILABLE

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Sorry I haven't replied in a bit, its been a long week for me.

First of all, nice work converting it to a plugin. Basically the exact same way I did most everything. I would recommend putting the "Report Settings" link under the normal "Settings" link under "Configuration" since that seems a more approriate place, almost. Or maybe just have the Reports heading before the Utility heading, so that its not below the Logout link. Should be fairly simple to do.

Code: Select all

        $temp = $menu['Utilities'];
        unset($menu['Utilities']);
        $menu["Reports"]['plugins/reports/report_settings.php'] = "Report Settings";
        $menu['Utilities'] = $temp;
Also, you need to use the config['url_path'] on the images for deleting or duplicating from the report from Report Settings. (EDIT: and the ALT text should be Yes / No just like the images)


There is also still the issue with disappearing reports after first creating them. If you only select a Data Template and not a Graph Template, it doesn't show up in the list, but the report will still run.

Overall, nicely done. I am still testing things out and will let you know if I find anything else!
asmoranomar
Posts: 4
Joined: Fri Jan 13, 2006 8:15 am

Post by asmoranomar »

Does this work with windows?
I tried loading all the perl modules I needed, but I am getting RRD parse errors as an output, and no data in the reports.

Any advice for non-linux users on getting this to work?
bradley
Posts: 38
Joined: Fri Dec 02, 2005 7:02 am
Location: United Kingdom
Contact:

Post by bradley »

Sorry I dont have a cacti installation on windows.

If any body has any fixes that need to be made for it to run on windows please let me
know and I'll try and incorporate them.

--
Brad.
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Post by twelzy »

bradley,

I've just run the runReports.pl via the command line (without errors):

Code: Select all

perl runReports.pl 1 --start
Using Data Template ID: 64 at runReports.pl line 547.
Using Data Template ID: 148 at runReports.pl line 547.
Using Data Template ID: 117 at runReports.pl line 547.
Using Data Template ID: 139 at runReports.pl line 547.
Using Data Template ID: 140 at runReports.pl line 547.
, but all the reports generated are from 2006/03/21 21:00h to 2006/03/22 20:00h!!!

These report templates were configured with:
  • - RRA: Daily
    - Start Hour: 00:00
    - End Hour: 23:00
    - Start Day: Monday
    - End Day: Sunday
What I'm missing?!

Thanks in advance!
(...and sorry for my poor English!)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
bradley
Posts: 38
Joined: Fri Dec 02, 2005 7:02 am
Location: United Kingdom
Contact:

Post by bradley »

The start/end day/hour only determines what data is included in the report, not what time
the report is run.

This means that you can run the report (normally at midnight via CRON) to produce
daily/weekly AVERAGES of data COLLECTED during the start/end day/hour.

If you add '--start' to runReports.pl when you run it, then it will adjust its times as if it were run from midnight at the begining of the previous DAY/WEEK/MONTH/YEAR.

--
Brad.
User avatar
twelzy
Cacti User
Posts: 83
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

Post by twelzy »

bradley,

I configured the daily report to run at 15:00h:

Code: Select all

0 15 * * * perl /opt/cacti/cacti-0.8.6g/plugins/reports/runReports.pl 1
So I would expect all daily reports to be generated from 2006/03/22 15:00h to 2006/03/23 15:00h (or 14:59h)! (Right?!)

It seems that the runReports.pl isn't including the full Stop Hour!
Look a report that was generated:

Thanks in advance!
(...and sorry for my poor English!) [/img]
Attachments
graph.gif
graph.gif (59.24 KiB) Viewed 9952 times
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
henryd31
Posts: 30
Joined: Wed Apr 13, 2005 3:11 pm

No reports being displayed ?

Post by henryd31 »

I have got this installed and running by hand it seems to be completing properly, no errors, but no reports are being displayed. I checked the mysql and it seems the tables were created. Can someone help on why I get no reports ?

-bash-3.00$ perl runReports.pl 1
Using Data Template ID: 27 at runReports.pl line 546.
Using Data Template ID: 91 at runReports.pl line 546.
Using Data Template ID: 128 at runReports.pl line 546.

mysql> show tables;
| plugin_report_definitions |
| plugin_report_items |
| plugin_reports |

Running 0.8.6h
Attachments
reports.gif
reports.gif (35.56 KiB) Viewed 9900 times
flavour
Posts: 15
Joined: Wed Sep 28, 2005 9:37 am

Post by flavour »

I've switched to the latest plugin version (many thanks for this!)

However I'm not getting any results when I run it.
bradley wrote:Hmm... Strange that you're not getting any reports after you run it...

My logic for choosing between Data Template and Graph Template was as follows:

If *only* a data template is selected, then only report on items within that data template.

If *only* a graph template is selected, then only report on items that are plotted on the graph, regardless of which data template they are from.

If *both* data template and graph template are supplied then only report on items that are A) on the graph and B) part of the data template.

I dont know if it fully works like that in practice but I know that if you specify BOTH then you should get results because thats what I used on the screenshots I supplied.
I have both Data & Graph specified.

If I specify only one of them then the Report isn't listed on the Settings page :/ (either way round) although it is selectable from the dropdown on the Reports tab.

I get this error when running runReports.pl:
"Can't locate object method "last_insert_id" via package "DBI::db" at /var/www/cacti/plugins/reports/runReports.pl line 207"
I'm running MySQL-3.23.58-16.RHEL3.1, perl-DBI-1.32-9, perl-DBD-MySQL-2.1021-3.

F
flavour
Posts: 15
Joined: Wed Sep 28, 2005 9:37 am

Realtime?

Post by flavour »

Would it be possible to get a 'Realtime' view, rather than just the averaged daily views?
Something which was updated every 5 minutes & looked at data from those 5 minutes.

I see this as a bit like the Weathermap in that it gives a quick view of the busiest links in realtime:
http://wotsit.thingy.com/haj/cacti/php-weathermap

F
bradley
Posts: 38
Joined: Fri Dec 02, 2005 7:02 am
Location: United Kingdom
Contact:

Post by bradley »

Falvour, in short, update DBI and DBD::mysql to the latest versions:

DBI is available here:
http://search.cpan.org/~timb/DBI-1.50/

DBD::mysql is available here:
http://search.cpan.org/~capttofu/DBD-mysql-3.0002/

This could also be the reason why other users are not getting their reports.

last_insert_id() is a DBI function which should be implemented by the DBD - I think this function in particular is quite new tho. For the other users that are not able to see the reports, can you confirm that the relationship between the plugin_reports and plugin_report_items table is correct (for those having problems the report_id column of the plugin_report_items table will be NULL when it should not be. Can you confirm this?

Also, the problem with providing real-time results is that there are potentially a *lot* of RRD's to go through so doing this will not scale for really large sites with lots of devices/data-sources etc.

Regards
--
Brad.
chadd
Cacti User
Posts: 382
Joined: Thu Mar 24, 2005 3:53 pm
Location: Ocoee, Florida

Post by chadd »

Just a little suggestion from my experience. When installing these two things via CPAN, I got all kinds of errors installing the DBD::mysql. I reinstalled bundle::DBI instead of just DBI and installed Bundle::DBD::mysql instead of the DBD::mysql, and it worked fine.

Also, great work on this plugin!!

I wish it could be realtime as well, but I can see what you are saying.. Maybe, if there were a "current" value stored in mysql that you could do a "current" computation on, just for "realtime" results... where does thold get it's "current" value from in it's display?... Maybe I will investigate..
henryd31
Posts: 30
Joined: Wed Apr 13, 2005 3:11 pm

Post by henryd31 »

Here is what I get, does that tell you anything ? I am running on a FC3 and all the packages are rather old, they're running most updated ones available thru packages, but this being fc3 does not mean much...

mysql> show columns from plugin_reports;
+----------------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| report_definition_id | int(11) | | MUL | 0 | |
| date_processed | int(11) | | | 0 | |
+----------------------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

mysql> show columns from plugin_report_items;
+---------------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+--------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| report_id | int(11) | | MUL | 0 | |
| local_graph_id | int(11) | | | 0 | |
| consolidation_function_id | int(11) | | | 0 | |
| graph_item_name | varchar(255) | | | | |
| graph_item_units | varchar(255) | | | | |
| graph_item_value | double | YES | | NULL | |
+---------------------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)


bradley wrote:Falvour, in short, update DBI and DBD::mysql to the latest versions:


"for those having problems the report_id column of the plugin_report_items table will be NULL when it should not be. Can you confirm this?"

Brad.
bradley
Posts: 38
Joined: Fri Dec 02, 2005 7:02 am
Location: United Kingdom
Contact:

Post by bradley »

henryd31, it’s not the structure of the tables that matters (because MySQL does not by default support referential integrity).

It’s the data within these tables that you should post - just a sample should be enough.

Regards
--
Brad.
henryd31
Posts: 30
Joined: Wed Apr 13, 2005 3:11 pm

Post by henryd31 »

Is this what you're looking for ?

mysql> SELECT * FROM plugin_reports;
+----+----------------------+----------------+
| id | report_definition_id | date_processed |
+----+----------------------+----------------+
| 1 | 1 | 1143124113 |
| 2 | 1 | 1143127471 |
| 3 | 2 | 1143127471 |
| 4 | 1 | 1143127478 |
| 5 | 2 | 1143127478 |
| 6 | 1 | 1143127485 |
| 7 | 2 | 1143127485 |
| 8 | 1 | 1143210456 |
| 9 | 2 | 1143210456 |
| 10 | 1 | 1143210530 |
| 11 | 2 | 1143210530 |
| 12 | 3 | 1143210530 |
| 13 | 1 | 1143211295 |
| 14 | 2 | 1143211295 |
| 15 | 3 | 1143211295 |
| 16 | 1 | 1143472167 |
| 17 | 2 | 1143472167 |
| 18 | 3 | 1143472167 |
| 19 | 1 | 1143472960 |
| 20 | 2 | 1143472960 |
| 21 | 3 | 1143472960 |
| 22 | 1 | 1143472965 |
| 23 | 2 | 1143472965 |
| 24 | 3 | 1143472965 |
| 25 | 1 | 1143473610 |
| 26 | 2 | 1143473610 |
| 27 | 3 | 1143473610 |
+----+----------------------+----------------+
27 rows in set (0.00 sec)

mysql> SELECT * FROM plugin_report_items;
Empty set (0.00 sec)

mysql> SELECT * FROM plugin_report_definitions;
+----+-------------------------+------------------+-------------------+--------+------------------------------+----------------------------+-----------------------------+---------------------------+
| id | report_name | data_template_id | graph_template_id | rra_id | include_data_from_start_hour | include_data_from_end_hour | include_data_from_start_day | include_data_from_end_day |
+----+-------------------------+------------------+-------------------+--------+------------------------------+----------------------------+-----------------------------+---------------------------+
| 1 | Test-cisco_cpu | 27 | 18 | 1 | 0 | 23 | 0 | 6 |
| 2 | Test-cisco_active_calls | 91 | 67 | 1 | 0 | 23 | 0 | 6 |
| 3 | Test-top-pgw | 128 | 101 | 1 | 0 | 23 | 0 | 6 |
+----+-------------------------+------------------+-------------------+--------+------------------------------+----------------------------+-----------------------------+---------------------------+
3 rows in set (0.00 sec)


bradley wrote:henryd31, it’s not the structure of the tables that matters (because MySQL does not by default support referential integrity).

It’s the data within these tables that you should post - just a sample should be enough.

Regards
--
Brad.
knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

Post by knobdy »

My "Updates" plugin is telling me there's an updated version of this (reports) plugin... where can I get it? :)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests