Template Graphs: cannot add graph item

A7V

04-03-2005 10:11:39

I was creating a new template graph and when adding a new graph item I can only see until the Monitor dropdown box with 2 items
- "-Fixed Value-"
- "-Sum of all graph items-"

From there on no more lines, even the Save Changes button (
This happened after migrating to a new machine, and I confirmed it works on the old one. Taking this into account where can I look for DB inconsistencies?

Note I enabled dbdebug and I get no error messages.

silfreed

04-03-2005 10:51:24

You didn't upgrade to PHP 5, did you?
This actually sounds like the PHP script is dying instead of a mysql corruption. You might want to turn set the following in config.php
[code144f2dd955a]error_reporting(E_ALL);
ini_set("display_errors", true);[/code144f2dd955a]
and let us know what is going on.

-Doug

A7V

04-03-2005 11:16:03

I get this
[code14989cf2ae9]
Notice: Undefined variable: PERMIT in /usr/local/var/www/netmrg/webfiles/graph_items.php on line 287[/code14989cf2ae9]

silfreed

04-03-2005 11:25:41

Just above line 287 in graph_items.php, add a line
[code16d074ff437]global $PERMIT;[/code16d074ff437]
and see if it helps. I don't really think this is our error, but..

-Doug

A7V

04-03-2005 11:33:28

The warning disappears, the problem remains.

For the record

Old machine, no problems
[code16f66eb8f6f]
PHP 4.3.5 (cli) (built: May 20 2004 12:51:15)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
[/code16f66eb8f6f]

New machine, with problem
[code16f66eb8f6f]
PHP 4.3.2 (cgi), Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
[/code16f66eb8f6f]

silfreed

04-03-2005 12:05:36

[code1d32634c4a2]ANALYZE TABLE monitors;[/code1d32634c4a2]?

-Doug

A7V

04-03-2005 12:08:28

[code11d75977352]
mysql> ANALYZE TABLE monitors;
+-----------------+---------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-----------------+---------+----------+----------+
| netmrg.monitors | analyze | status | OK |
+-----------------+---------+----------+----------+
1 row in set (0.14 sec)
[/code11d75977352]

silfreed

04-03-2005 12:20:42

[code16a94e026c4]ANALYZE TABLE sub_devices;
ANALYZE TABLE devices;[/code16a94e026c4]

I know you have a huge list of monitors (from other threads) - does this page take a looooong time to display, and then it stops with only those two items?
I think the query that builds this might just be taking too much time.

-Doug

A7V

04-03-2005 12:26:12

[quoteb826b0afda="silfreed"][code1b826b0afda]ANALYZE TABLE sub_devices;
ANALYZE TABLE devices;[/code1b826b0afda]

I know you have a huge list of monitors (from other threads) - does this page take a looooong time to display, and then it stops with only those two items?

I think the query that builds this might just be taking too much time.

-Doug[/quoteb826b0afda]

Yes, I do, 24972 actually 8) and no, it's pretty fast to display the page.
Taking into account that this started to happen only after I moved the database what must I check and compare to see any cause for this to happen?

PS I added you to AIM.

silfreed

04-03-2005 12:30:01

[quote3c0de09b8b="A7V"]Yes, I do, 24972 actually 8) and no, it's pretty fast to display the page.
Taking into account that this started to happen only after I moved the database what must I check and compare to see any cause for this to happen?[/quote3c0de09b8b]

Not sure; you do have quite an odd situation there. There shouldn't really be any problems moving the RRDs or the database as long as the config file is updated. Let me think about it over lunch...

[quote3c0de09b8b="A7V"]PS I added you to AIM.[/quote3c0de09b8b]

Hmm.. I forgot I entered that (not that it was that difficult to guess). Unfortunately my work blocks AIM. Wouldn't happen to have Jabber, would you?

-Doug

A7V

04-03-2005 12:35:20

[quoteedc239051b="silfreed"] Let me think about it over lunch...
[/quoteedc239051b]
Lunch? I'm going for a snack before dinner wink

[quoteedc239051b="silfreed"]
[quoteedc239051b="A7V"]PS I added you to AIM.[/quoteedc239051b]

Hmm.. I forgot I entered that (not that it was that difficult to guess). Unfortunately my work blocks AIM. Wouldn't happen to have Jabber, would you?

-Doug[/quoteedc239051b]
I tried AIM as it's what you have in your profile.
I'm using Trillian and I can have Jabber if I configure an account.
I also have MSN and ICQ

A7V

17-03-2005 12:37:45

As talked I configured the old machine to point to the new DB and go figure it works shock
I can only say the problem is not on the DB but somewhere in Apache, PHP or something cry
I'm using CentOS 3 x86_64. If anyone has a setup somewhat similar and has no problems I need to compare rpm versions.
Anyway, I welcome any ideas.

A7V

04-05-2005 11:53:24

I was doing some upgrades with yum to try solve this issue with no luck.
I (don't ask why) looked at the page source and saw this
[code11499d8cef1]<b>Monitor:</b><br />
<select name="mon_id" >
<option value="-1" SELECTED>-Fixed Value-</option>
<option value="-2">-Sum of all graph items-</option>
<br />
<b>Fatal error</b>: Allowed memory size of 9437240 bytes exhausted (tried to allocate 71 bytes) in <b>/usr/local/var/www/netmrg/lib/database.php</b> on line <b>71</b><br />[/code11499d8cef1]

1st What setting needs to be changed to allow more memory to be allocated?
2nd Why is this on the html code and not displayed by the browser? Being able to see this before would have been very time saving cry

A7V

04-05-2005 12:06:29

1st What setting needs to be changed to allow more memory to be allocated?

Answer Editing memory_limit = 8M in php.ini to 16M resolved the issue
D

silfreed

04-05-2005 12:15:21

[quote432bf460bd="A7V"]2nd Why is this on the html code and not displayed by the browser? Being able to see this before would have been very time saving cry[/quote432bf460bd]

Well, it was displayed in the HTML, but was caught in an <option /> tag so it wasn't displayed properly. Evil, evil.

What we really need to do is figure out why you need more than 8 megs to display that option dialog, and I suspect it's going to be because we pull all the mysql results into an array and then make the HTML. I don't think that's going to come up with an easy fix.

-Doug

A7V

04-05-2005 12:20:33

The resulting page is 1123461 bytes long, so I guess that needs some memory to process wink

silfreed

04-05-2005 12:33:24

[quote0566fabb3e="A7V"]The resulting page is 1123461 bytes long[/quote0566fabb3e]
Yeah, see, that there just shows that we have a process that is broken. There's no way we should have an HTML page that is over a meg in size. Bad developers.

-Doug

A7V

04-05-2005 12:37:07

The problem is that it's allowing me to choose from all available monitors from all the devices we have, and you know we have a lot. How to handle such selection? Limit the 1st selection to the device and then to the monitor?

silfreed

04-05-2005 13:52:19

Yep, something like that. We could go all crazy XMLHttpRequest like Google Suggest and Google Maps, but I imagine it'll be a little more low-tech like select the device, subdevice, then monitors in page refreshes.

-Doug