Notices 0.1

General discussion about Plugins for Cacti

Moderators: Moderators, Developers

Author
Message
brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

Notices 0.1

#1 Post by brezel » Fri Feb 13, 2009 9:47 am

Hello,

i tried to build a new plugin which shall add a small textarea for notices next to the graphs.

I haven' that much idea of PHP so i would be happy if someone would look over it and say whether it works as described. I tested it only on a Linux machine.

To get it working you have to enter the path to your cacti folder and reenter your database password in add_notice.php and load.php.

I would be happy about some help^^
Last edited by brezel on Thu Feb 19, 2009 6:18 am, edited 1 time in total.

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

#2 Post by browniebraun » Fri Feb 13, 2009 11:47 am

Hello Brezel! (Are you from Munich?)

First off.. your plugin "works" under Windows too.
Even though there are several checks missing and a lot of notices will occur if the right permission id has not been set. And another issues if you zoom into a graph.
I like the base idea, but I advise to use Cacti's database functions instead of your own ones.
From my point of view it would also make sense to save the notices user-dependent in a separate table instead of creating some raw files.

If you need help or you've some more questions then send me a pm. :wink:

Best regards
-Andreas-
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

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#3 Post by brezel » Thu Feb 19, 2009 6:25 am

Hello.

I think the Plugin should work the right way now. :)
Please tell me if it doesn't.
Attachments
open.PNG
open.PNG (33.79 KiB) Viewed 119048 times
Last edited by brezel on Fri Feb 20, 2009 2:43 am, edited 1 time in total.

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

mod to Notices

#4 Post by egarnel » Thu Feb 19, 2009 9:52 am

I really like this plugin. It comes in handy for us with temporary port labeling.

I hope you don't mind, but I made some modifications to it

1) created N.JPG
2) repackaged tar with notices directory & Images subdirectory
3) changed "Notizen" to "Notices"


I am not much of a coder, as I have proven many times in this forum :lol:
but I am thinking about how to incorporate a mouse-over or use overlib to display previously written notes.

There is a lot of potential with this plugin that I can see:
History of notices, similar to the function in nagios
email notification from notices
html capability within the notes field
resize/properties mod of notices window.

Again, this is a great plugin! Thank you so much for creating it!
Attachments
notice_mod.tar
My modded notices plugin
(30 KiB) Downloaded 2402 times
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

Bingobango
Posts: 6
Joined: Mon Dec 17, 2007 2:39 am
Location: Terra Firma

Bug in baum.php

#5 Post by Bingobango » Mon Feb 23, 2009 8:42 am

I noticed a bug in baum.php:

The path to add_notice.php is hardcoded 2 places to '/cacti/plugins/...'
Which means people who have moved the cacti install to a different directory are out of luck...

Change into this to fix it:

</td></tr><tr><td><form action="'.$config['url_path'].'plugins/notices/add_notice.php? .. etc.


And now I just have to beat my head against a wall, while trying to find out why it still won't work on my box....

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#6 Post by brezel » Mon Feb 23, 2009 12:46 pm

And now I just have to beat my head against a wall, while trying to find out why it still won't work on my box....
What does it say? If you use Opera, it has issues with the display attribute.

Bingobango
Posts: 6
Joined: Mon Dec 17, 2007 2:39 am
Location: Terra Firma

#7 Post by Bingobango » Mon Feb 23, 2009 4:26 pm

brezel wrote:
And now I just have to beat my head against a wall, while trying to find out why it still won't work on my box....
What does it say? If you use Opera, it has issues with the display attribute.
No, just me looking in the wrong place and forgetting to activate the permission under users for the plugin... :oops:

Works alright now!

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#8 Post by brezel » Wed Mar 04, 2009 10:33 am

I removed some bugs in it.

Should work now better, please tell me any bugs.
Last edited by brezel on Fri Apr 24, 2009 6:06 am, edited 1 time in total.

r_chetanjain
Cacti User
Posts: 83
Joined: Fri Aug 22, 2003 4:33 am

error

#9 Post by r_chetanjain » Wed Mar 18, 2009 4:16 am

Hi,

I am getting the below mentioned error in my httpd logs.... i have installed 0.2 with 8.7d with PA 2.4

[Wed Mar 18 04:16:51 2009] [error] [client 10.1.100.114] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti_new/plugins/notices/load.php on line 67, referer: http://netmgr.monitor.com:8080/cacti_new/settings.php
[Wed Mar 18 04:16:51 2009] [error] [client 10.1.100.114] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti_new/plugins/notices/load.php on line 67, referer: http://netmgr.monitor.com:8080/cacti_new/settings.php


Chetan

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#10 Post by brezel » Thu Mar 19, 2009 5:21 am

Does the error occur with per Host and per Graph settings?
Can you look up whether the notices table exists in the cacti database?

r_chetanjain
Cacti User
Posts: 83
Joined: Fri Aug 22, 2003 4:33 am

#11 Post by r_chetanjain » Thu Mar 19, 2009 12:08 pm

No, i don't have the notices tables under the database... i just did a usual plugin setup

looks like the load.php is trying to access the database with root user and no password...

Chetan

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#12 Post by brezel » Fri Mar 20, 2009 6:44 am

I think it can't create the table where it stores the notices. Try to import this into the cacti db. (maybe you need to change the extension to .sql)

r_chetanjain
Cacti User
Posts: 83
Joined: Fri Aug 22, 2003 4:33 am

worked

#13 Post by r_chetanjain » Mon Mar 23, 2009 12:46 am

Its working now...

Request : Is it possible to make the notice available on the graph or as a description on the graph page so it will make more sense... As of now i think we need to click on notice and look at the comment...

chetan

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#14 Post by brezel » Thu Mar 26, 2009 4:11 am

How do you mean your request exactly? Shall the notice appear as a part of the graph or at another position or shall it just be opened without clicking on the button.

brezel
Posts: 27
Joined: Thu Oct 30, 2008 6:42 am

#15 Post by brezel » Fri Apr 24, 2009 6:06 am

here's a new version:

1.) Possibility to use Ajax.
2.) Possibility to print the Notice as a Comment on the Graph (up to 100 Sings).
3.) Possibilty to open the table without clicking on the button.

Please tell me Any bugs :)
Attachments
comment.JPG
comment.JPG (37.58 KiB) Viewed 117796 times

Post Reply