Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jan 19, 2019 9:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Notices 0.1
PostPosted: Fri Feb 13, 2009 9:47 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 13, 2009 11:47 am 
Offline
Developer
User avatar

Joined: Tue Jun 13, 2006 1:17 am
Posts: 788
Location: Cologne, Germany
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 6:25 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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 117642 times ]


Last edited by brezel on Fri Feb 20, 2009 2:43 am, edited 1 time in total.
Top
 Profile  
 
 Post subject: mod to Notices
PostPosted: Thu Feb 19, 2009 9:52 am 
Offline
Cacti Pro User
User avatar

Joined: Thu Nov 21, 2002 8:55 am
Posts: 703
Location: Austin, TX
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:
File comment: My modded notices plugin
notice_mod.tar [30 KiB]
Downloaded 1738 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
Top
 Profile  
 
 Post subject: Bug in baum.php
PostPosted: Mon Feb 23, 2009 8:42 am 
Offline

Joined: Mon Dec 17, 2007 2:39 am
Posts: 6
Location: Terra Firma
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....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 12:46 pm 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
Quote:
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 4:26 pm 
Offline

Joined: Mon Dec 17, 2007 2:39 am
Posts: 6
Location: Terra Firma
brezel wrote:
Quote:
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!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 04, 2009 10:33 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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.

Top
 Profile  
 
 Post subject: error
PostPosted: Wed Mar 18, 2009 4:16 am 
Offline
Cacti User

Joined: Fri Aug 22, 2003 4:33 am
Posts: 83
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 5:21 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
Does the error occur with per Host and per Graph settings?
Can you look up whether the notices table exists in the cacti database?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 12:08 pm 
Offline
Cacti User

Joined: Fri Aug 22, 2003 4:33 am
Posts: 83
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 20, 2009 6:44 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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)


Top
 Profile  
 
 Post subject: worked
PostPosted: Mon Mar 23, 2009 12:46 am 
Offline
Cacti User

Joined: Fri Aug 22, 2003 4:33 am
Posts: 83
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 4:11 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 24, 2009 6:06 am 
Offline

Joined: Thu Oct 30, 2008 6:42 am
Posts: 27
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 116390 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group