|
|
| Author |
Message |
cigamit Developer
Joined: 07 Apr 2005 Posts: 978 Location: B/CS Texas
|
Posted: Thu Mar 23, 2006 11:07 am Post subject: |
|
|
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: | $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!
|
|
| Back to top |
|
 |
asmoranomar
Joined: 13 Jan 2006 Posts: 4
|
Posted: Thu Mar 23, 2006 11:57 am Post subject: |
|
|
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?
|
|
| Back to top |
|
 |
bradley
Joined: 02 Dec 2005 Posts: 38 Location: United Kingdom
|
Posted: Thu Mar 23, 2006 12:08 pm Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
twelzy Cacti User
Joined: 30 Mar 2005 Posts: 74 Location: BRAZIL/Brasilia
|
Posted: Thu Mar 23, 2006 12:14 pm Post subject: |
|
|
bradley,
I've just run the runReports.pl via the command line (without errors):
| Code: | 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!)
|
|
| Back to top |
|
 |
bradley
Joined: 02 Dec 2005 Posts: 38 Location: United Kingdom
|
Posted: Thu Mar 23, 2006 12:27 pm Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
twelzy Cacti User
Joined: 30 Mar 2005 Posts: 74 Location: BRAZIL/Brasilia
|
Posted: Thu Mar 23, 2006 1:31 pm Post subject: |
|
|
bradley,
I configured the daily report to run at 15:00h:
| Code: | | 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]
| Description: |
|
| Filesize: |
59.24 KB |
| Viewed: |
3946 Time(s) |

|
|
|
| Back to top |
|
 |
henryd31
Joined: 13 Apr 2005 Posts: 30
|
Posted: Fri Mar 24, 2006 9:49 am Post subject: No reports being displayed ? |
|
|
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
| Description: |
|
| Filesize: |
35.56 KB |
| Viewed: |
3894 Time(s) |

|
|
|
| Back to top |
|
 |
flavour
Joined: 28 Sep 2005 Posts: 15
|
Posted: Sat Mar 25, 2006 10:21 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
flavour
Joined: 28 Sep 2005 Posts: 15
|
Posted: Sat Mar 25, 2006 10:38 am Post subject: Realtime? |
|
|
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
|
|
| Back to top |
|
 |
bradley
Joined: 02 Dec 2005 Posts: 38 Location: United Kingdom
|
Posted: Sun Mar 26, 2006 11:37 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
chadd Cacti User
Joined: 24 Mar 2005 Posts: 194 Location: Ocoee, Florida
|
Posted: Mon Mar 27, 2006 8:54 am Post subject: |
|
|
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..
|
|
| Back to top |
|
 |
henryd31
Joined: 13 Apr 2005 Posts: 30
|
Posted: Mon Mar 27, 2006 10:32 am Post subject: |
|
|
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. |
|
|
| Back to top |
|
 |
bradley
Joined: 02 Dec 2005 Posts: 38 Location: United Kingdom
|
Posted: Mon Mar 27, 2006 11:19 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
henryd31
Joined: 13 Apr 2005 Posts: 30
|
Posted: Mon Mar 27, 2006 11:26 am Post subject: |
|
|
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. |
|
|
| Back to top |
|
 |
knobdy Cacti User
Joined: 28 Sep 2005 Posts: 495
|
Posted: Mon Mar 27, 2006 11:55 am Post subject: |
|
|
My "Updates" plugin is telling me there's an updated version of this (reports) plugin... where can I get it?
|
|
| Back to top |
|
 |
|