Report plugin ''ReportIt" - v0.7.5a (released 23/12/11)

General discussion about Plugins for Cacti

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
browniebraun
Developer
Posts: 788
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

Report plugin ''ReportIt" - v0.7.5a (released 23/12/11)

#1 Post by browniebraun » Sat Dec 23, 2006 6:49 pm

Current version of ReportIt is available under Sourceforge!

Hi Cacti community!

Here is my new report plugin "reportit" for all linux users (till now).
I've written the first release during my degree dissertation and now i've added some functions. So, it's time to make it public.

You can calculate the traffic, utilization or exception reportings of data items by using sliding time frames
or static ones on demand. It's possible to define working days, working time and a seperate timezone
for every data item. Your results can be exported to a CSV-file.
Now i'm just writing the scheduling functionality that will be included in the next release.

Unfortunately cacti's rrdfetch is too slow for this calculation, so i've to choose the way with the php-binding (for rrdtool) for the first time.
You will have to install it additionally. To install this plugin use the traditional way (config.pph: add plugins[] = "reportit") and go to "realm permissions".

Without the php-binding you can test its handling (Linux and Windows), but the calculation will not run. UPDATE: v0.3 supports Linux and Windows.

To get an overview take a look at the little powerpoint presentation i've added.




- Marry Christmas & Happy New Year -

Best regards

Andreas
(alias Browniebraun)
Attachments
report_threshold.PNG
report_threshold.PNG (36.99 KiB) Viewed 140586 times
csv_excel.PNG
csv_excel.PNG (74.78 KiB) Viewed 140585 times
Last edited by browniebraun on Sun Nov 28, 2010 2:30 am, edited 25 times in total.
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list

raddy
Posts: 24
Joined: Thu Oct 27, 2005 8:47 pm
Location: Sydney, Australia

#2 Post by raddy » Sun Dec 24, 2006 5:14 am

Nice work and Merry Xmas

jgisler
Cacti User
Posts: 63
Joined: Wed Sep 28, 2005 1:12 pm

#3 Post by jgisler » Tue Dec 26, 2006 10:16 pm

Thanks for the plugin, looks nice.

After installation, I am getting the following errors:

12/26/2006 07:07:47 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT a.*, b.user_id, b.description AS template_description FROM reportit_reports AS a LEFT JOIN reportit_templates AS b ON b.id = a.template_id ORDER BY b.user_id, a.description"
12/26/2006 07:07:33 PM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "CREATE TABLE reportit_rrdlist_0 ( id INT PRIMARY KEY, start_day VARCHAR(255) NOT NULL DEFAULT 'Monday', end_day VARCHAR(255) NOT NULL DEFAULT 'Sunday', start_time TIME NOT NULL DEFAULT '00:00:00', end_time TIME NOT NULL DEFAULT '23:55:00', timezone VARCHAR(255) NOT NULL DEFAULT 'GMT' )TYPE=MyISAM"
12/26/2006 07:07:20 PM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "CREATE TABLE reportit_rrdlist_0 ( id INT PRIMARY KEY, start_day VARCHAR(255) NOT NULL DEFAULT 'Monday', end_day VARCHAR(255) NOT NULL DEFAULT 'Sunday', start_time TIME NOT NULL DEFAULT '00:00:00', end_time TIME NOT NULL DEFAULT '23:55:00', timezone VARCHAR(255) NOT NULL DEFAULT 'GMT' )TYPE=MyISAM"
12/26/2006 07:06:35 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT a.*, b.user_id, b.description AS template_description FROM reportit_reports AS a LEFT JOIN reportit_templates AS b ON b.id = a.template_id ORDER BY b.user_id, a.description"
12/26/2006 07:06:32 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT a.id, a.description, a.start_date, a.end_date, a.last_run, b.user_id, b.description AS template_description, c.type FROM reportit_reports AS a JOIN reportit_templates AS b ON b.id = a.template_id JOIN reportit_types AS c ON c.id = b.type_id WHERE a.public = 'on' AND a.last_run != 0"
12/26/2006 07:06:12 PM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "CREATE TABLE reportit_rrdlist_0 ( id INT PRIMARY KEY, start_day VARCHAR(255) NOT NULL DEFAULT 'Monday', end_day VARCHAR(255) NOT NULL DEFAULT 'Sunday', start_time TIME NOT NULL DEFAULT '00:00:00', end_time TIME NOT NULL DEFAULT '23:55:00', timezone VARCHAR(255) NOT NULL DEFAULT 'GMT' )TYPE=MyISAM"

12/26/2006 07:04:13 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT b.id FROM reportit_templates AS a LEFT JOIN reportit_reports AS b ON b.template_id = a.id WHERE a.id = 1"
12/26/2006 07:03:30 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT b.id FROM reportit_templates AS a LEFT JOIN reportit_reports AS b ON b.template_id = a.id WHERE a.id = 1"
12/26/2006 07:03:17 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "SELECT b.id FROM reportit_templates AS a LEFT JOIN reportit_reports AS b ON b.template_id = a.id WHERE a.id = 1"


I am running:

mysql-5.0.22
httpd-2.2.3
php-5.2.0
installed the php_binding, it's loads no problems reported. I see the module loaded.

Any ideas? I will continue to debug.

jgisler
Cacti User
Posts: 63
Joined: Wed Sep 28, 2005 1:12 pm

#4 Post by jgisler » Tue Dec 26, 2006 10:40 pm

has to do with this table creation

CREATE TABLE reportit_reports (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
description VARCHAR(255) NOT NULL,
template_id INT NOT NULL,
preset_timespan VARCHAR(255) NOT NULL,
last_run DATETIME NOT NULL,
runtime INT NOT NULL,
public VARCHAR(3) NOT NULL,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
ds_description VARCHAR(255) NOT NULL,
result_description VARCHAR(255) NOT NULL,
dynamic BOOL NOT NULL DEFAULT 'FALSE',
present BOOL NOT NULL DEFAULT 'FALSE',
scheduled BOOL NOT NULL DEFAULT 'FALSE',
frequency VARCHAR(225) NOT NULL
)TYPE=MyISAM;";

All of the BOOL portions of the statement trigger the following error.

Invalid default value for 'dynamic'

User avatar
browniebraun
Developer
Posts: 788
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

#5 Post by browniebraun » Wed Dec 27, 2006 2:12 am

Good morning!

Ok, my server has no problem with this sql syntax (mysql 4.0.24), but you are right.
The word "DYNAMIC" is reserved, so we should put it into backticks.


Change the following line in setup.php:

old: dynamic BOOL NOT NULL DEFAULT 'FALSE',
new: `dynamic` BOOL NOT NULL DEFAULT 'FALSE',

Drop the invalid tables (all tables with zero at the end) or delete them all (reportit_*). Then start again.

I hope that there are not to many subsequent errors. :-?




Best regards

Andreas

jgisler
Cacti User
Posts: 63
Joined: Wed Sep 28, 2005 1:12 pm

#6 Post by jgisler » Wed Dec 27, 2006 4:32 am

I changed

dynamic BOOL NOT NULL DEFAULT 'FALSE',
present BOOL NOT NULL DEFAULT 'FALSE',
scheduled BOOL NOT NULL DEFAULT 'FALSE',

to

dynamic BOOL NOT NULL DEFAULT '0',
present BOOL NOT NULL DEFAULT '0',
scheduled BOOL NOT NULL DEFAULT '0',

which then resolved the issue.

Thanks for the prompt reply.

dagonet
Cacti User
Posts: 89
Joined: Sat Oct 29, 2005 4:05 pm
Location: Wuerzburg

#7 Post by dagonet » Wed Jan 03, 2007 6:34 am

Hi,
very nice plugin!
One issue I have: Is it possible to additional datasources? I think of disk space and so on.

regards
Dagonet

User avatar
browniebraun
Developer
Posts: 788
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

#8 Post by browniebraun » Wed Jan 03, 2007 2:21 pm

Hi dagonet,
thank you for the laurels.

Sorry, but at this moment it isn't easily to add data sources. :(
Its a question whether you want to specify new measurement categories to calculate your "hard disk" report or to use the standard calculation functions instead. At this moment the standard functions are not flexible enough. So, I'll have to improve them as soon as possible.
But the existing functions (calc_min / max / average and threshold) have all the same interfaces. I've made this because its easier to add new functions.
For an special solution you'll have to add your function to calculations.php and integrate it by updating the tables 'reportit_functions' and 'reportit_types'. I think the "data source" you meant is the data source type of the template configuration that will filter the list of possible data items.

I propose that you write me an email with your ideas and I'll put it on the wish list.
Last week I've written some bug fixes and today the scheduling functionality has been finished. So, I'll post a beta release of "reportit V0.3" in a few days.

Best regards

Andreas


CU @ 1.CCC.eu :wink:

User avatar
browniebraun
Developer
Posts: 788
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

#9 Post by browniebraun » Fri Jan 05, 2007 11:01 am

Hi CACTI community!

Here is the beta release of "reportit V0.3" i've promised to you.
I've made some bug fixes and add-ons and so it's possible to use the schedule function by using crontab.

for example:
#Daily
0 0 * * * /thishost/unix/cen/php/bin/php /thishost/unix/cen/cacti/plugins/reportit/runtime.php -d > /dev/null 2>&1
(#Weekly: 10 0 * * 0 #Monthly 20 0 1 * * #Quarterly 30 0 1 1,4,7,10 #Yearly 40 0 1 1 *)

Warnings and errors during the scheduled reporting will be written into Cacti log File, also an status information.
Give me your feedback.


Best regards

Andreas


CU @ 1.CCC.eu
Attachments
reportit_v0.3.2.tar
Plugin 'reportit' v0.3.2 (03/03/07)
(200 KiB) Downloaded 4466 times
php_bindings.tar
PHP bindings for RRDtool
(50 KiB) Downloaded 5406 times
warn.PNG
warn.PNG (5.91 KiB) Viewed 139950 times
scheduled2.png
scheduled2.png (18.64 KiB) Viewed 139950 times
Last edited by browniebraun on Thu Mar 15, 2007 11:53 pm, edited 7 times in total.
Hat das Blümchen einen Knick, war der Schmetterling zu dick! ;)
reportit v0.7.5a
SNMPAgent v0.2.3
Download ReportIt | Download SNMPAgent | ReportIt SVN | ReportIt Templates | Wish list

User avatar
egarnel
Cacti Pro User
Posts: 703
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

#10 Post by egarnel » Fri Jan 05, 2007 11:51 am

Hmmm... after creating a report template and then a report.
and adding a data item

I get the following output when trying to run a report

Code: Select all

 REPORTIT ERROR: PHP modul for RRDtool is not available.
and nothing in cacti.log
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey

User avatar
browniebraun
Developer
Posts: 788
Joined: Tue Jun 13, 2006 1:17 am
Location: Cologne, Germany

#11 Post by browniebraun » Fri Jan 05, 2007 12:17 pm

Please notice: You 'll have to install the php-bindings for RRDtool. (only available for Linux!).

The logging is only for scheduled reporting!

Best regards

Andreas

User avatar
egarnel
Cacti Pro User
Posts: 703
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

#12 Post by egarnel » Fri Jan 05, 2007 12:47 pm

hmmm.... can't seem to find an rpm for rrdtool-php for either CentOs 4.x or RHEL 4.x.. & a manual config requires altering php confs..

I prefer rpms for ease of package maintenance, but if need be, I will compile it by hand.

I may forgo this plugin for the time being....
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey

tbaror
Cacti User
Posts: 55
Joined: Mon Jun 05, 2006 6:54 am

Report It

#13 Post by tbaror » Sun Jan 07, 2007 8:01 am

HI,

First let me write that this plug-in is a must have.

Since I choose to cacti run on windows because the need for ease WMI monitoring i can

tbaror
Cacti User
Posts: 55
Joined: Mon Jun 05, 2006 6:54 am

Report It for windows

#14 Post by tbaror » Sun Jan 07, 2007 8:08 am

Hi,

I choose run cacti under windows because the need for ease WMI monitoring.
I can't have Reportit Plug-in runing under windows is there a way or planing to make it run under windows (xp,2k3).

Thanks in advanced

User avatar
TheWitness
Developer
Posts: 14817
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#15 Post by TheWitness » Sun Jan 07, 2007 11:16 am

If someone can e-mail Phillip Simonet, he might be willing to compile the module for Windows.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Post Reply