Notices 0.1

General discussion about Plugins for Cacti

Moderators: Moderators, Developers

Author
Message
Joop
Posts: 25
Joined: Thu Apr 26, 2007 5:27 am

#31 Post by Joop » Thu Jun 25, 2009 4:27 am

ivan-impuls wrote:I am getting a error "Wrong RRA" too...
Nothing check in setttings tab for notices plugin...
Also i see the following error in my graphs:

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/share/cacti/site/plugins/notices/load.php on line 103

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/share/cacti/site/plugins/notices/load.php on line 112
I do have that problem too but think I found where it comes from. Printing th rra_id as suggested made me look at the url and saw 'rra_id=all' and 'all' isn't a number so the select is complaining about that.

Edit:
I had line 103 print the select statement and it looks like mysql is right ;-), Notice the empty rra_id= clause

SELECT notice FROM notices WHERE rra_id = AND graph_id =6 AND user_id =1

host_id is probably what you want here.

Regards,

Joop

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

#32 Post by brezel » Thu Jun 25, 2009 4:40 am

the rra_id notices uses is another then the one in the URL ,it a number for each graph like in the image below.

it should be saved in $number in baum.php line 5 and load.php also line 5(from $rra["id"]) it seems that it don't do this
Attachments
rra.JPG
rra.JPG (4.21 KiB) Viewed 18176 times

disH
Posts: 33
Joined: Thu May 22, 2008 2:09 am

#33 Post by disH » Fri Jul 03, 2009 12:38 am

so is there a solution for this problem? im experiencing the same problem
[url=http://forums.cacti.net/viewtopic.php?t=4356]Template: Cisco CatOS[/url]
[url=http://forums.cacti.net/viewtopic.php?t=21785]Mactrack: Netscreen Fw[/url]
[b]_______________[/b]
[b]Cacti Version[/b] - 0.8.7e, [b]Plugin Architecture[/b] - 2.5, [b]Poller Type[/b] - Cact-Spine 0.8.7e
[b]Server Info[/b] - Ubuntu Server 8.10 (2.6.27-7-server), [b]Web Server[/b] - Apache/2.2.9 PHP/5.2.6-2ubuntu4.3 with Suhosin-Patch
[b]PHP[/b] - 5.2.6-2ubuntu4.3, [b]MySQL[/b] - 5.0.67-0ubuntu6-log, [b]RRDTool[/b] - 1.3.1, [b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Thresholds v0.4.1, Login Mod v1.0, Host Info v0.2

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

#34 Post by brezel » Fri Jul 03, 2009 1:33 am

I still can't reproduce it, can someone post the output of the code i posted before? It should look like on the screenshoot above.

ivan-impuls
Posts: 23
Joined: Mon Jun 15, 2009 1:09 am

#35 Post by ivan-impuls » Fri Jul 03, 2009 3:16 am

brezel wrote:Can you add following line in baum.php at line 6? Above the Notices button something like "rra:1 number:1" should appear.

Code: Select all

echo('rra:'.$rra["id"].' number:'.$number);
I done this.
Nothing appear...

[/img]
Attachments
.JPG
.JPG (93.58 KiB) Viewed 18110 times

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

#36 Post by brezel » Fri Jul 03, 2009 3:47 am

can you add

Code: Select all

echo('rra:'.$rra['id']);
in line 120 in setup.php under

Code: Select all

global $config,$rra;
does a number appear then?

ivan-impuls
Posts: 23
Joined: Mon Jun 15, 2009 1:09 am

#37 Post by ivan-impuls » Fri Jul 03, 2009 5:55 am

No, nothing changes.
The same picture.
Sorry for my English.
I'm from Russia...

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

#38 Post by brezel » Fri Jul 03, 2009 7:10 am

Can you post lines 98 and 99 in your graph.php from cacti basedirectory?

I have no clue why $rra["id"] contains no data

ivan-impuls
Posts: 23
Joined: Mon Jun 15, 2009 1:09 am

#39 Post by ivan-impuls » Fri Jul 03, 2009 7:31 am

###98str
<a href='graph.php?action=zoom&local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_zoom.gif' border='0' alt='Zoom Graph' title='Zoom Graph' style='padding: 3px;'></a><br>

###99str
<a href='graph_xport.php?local_graph_id=<?php print $_GET["local_graph_id"];?>&rra_id=<?php print $rra["id"];?>&view_type=<?php print $_REQUEST["view_type"];?>'><img src='images/graph_query.png' border='0' alt='CSV Export' title='CSV Export' style='padding: 3px;'></a><br>

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

#40 Post by brezel » Wed Jul 08, 2009 7:30 am

I won't be able to look for this for 6 weeks, so after changing

Code: Select all

$number = $rra["id"];


(line 5 in load.php and line 5 in baum.php) in

Code: Select all

if(is_numeric($rra["id"]))
{
  $number = $rra["id"];
}
else
{
  $number = 1;
}
the plugin should behave like in 0.2b (only one window for one notice).

Joop
Posts: 25
Joined: Thu Apr 26, 2007 5:27 am

Notices 0.2c and Cacti 0.8.7e and PIA 0.8.7e

#41 Post by Joop » Fri Jul 10, 2009 7:13 am

Hi Brezel,

I don't have the mysql errors with this combination but found two other things:

- you're using <script src="'.$config['url_path'].'/plugins/notices/prototype.js"> in baum.php but that leads to
//plugins/notices/prototype.js which is slowing down pageloads quite a bit.

- when trying to delete a comment it doesn't work. Log entries from Cacti show the delete followed by a (re) insert of the same data

Code: Select all

07/10/2009 02:02:21 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "INSERT INTO notices (host_id, rra_id, user_id, notice) VALUES ('1', '1', '1', '')"
07/10/2009 02:02:21 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "DELETE FROM notices WHERE host_id =1 AND rra_id=1 AND user_id =1" 
Other than that is looks like its is working.

Regards,

Joop

parvedejs
Posts: 5
Joined: Fri Jul 17, 2009 3:00 am

#42 Post by parvedejs » Tue Jul 21, 2009 7:35 am

Hi,

I have same problem , but only @ Graphs -> Tree Mode

:?
Attachments
notice_error.JPG
notice_error.JPG (44.09 KiB) Viewed 17897 times

parvedejs
Posts: 5
Joined: Fri Jul 17, 2009 3:00 am

#43 Post by parvedejs » Tue Jul 21, 2009 8:28 am

I resolve my problem :)
@ begin of load.php
after string >

Code: Select all

$number = $rra["id"];
add

Code: Select all

settype($number, "integer");
p.s. mb not correct, but for me all work fine.
:oops:

megatron_007
Posts: 22
Joined: Sat Dec 08, 2007 3:54 pm

#44 Post by megatron_007 » Sat Sep 05, 2009 6:54 am

Could someone help me to fix this:
(I can't post any remarks, maybe it's a permission issue. )

Image

[/img]

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

#45 Post by brezel » Mon Sep 07, 2009 1:49 am

It looks like the User has no permissions to the Plugin ,have you activated it?

Post Reply