Problems with PHP and cmd.php

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I kind of doubt the 'cmd.php' script could cause a seg fault, so it is most likely the php binary or the snmp support like you mentioned. When you get the seg fault, does 'cmd.php' automatically quit? If anything, I would try and recompiling your php binary to see if that helps. Also, try NOT compling in SNMP support if you are currently doing that. See if that helps at all.

-Ian
supertux
Posts: 14
Joined: Mon Jan 21, 2002 7:00 pm
Location: Munich, Germany
Contact:

Post by supertux »

I have a similar problem with a new installation of cacti 0.6.6

When running the cmd.php command manually I get the following error:

Failed to open byte range locking database
ERROR: Failed to initialise locking database
Segmentation fault

Any idea what can be wrong?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

supertux: what version of PHP/MySQL/OS are you currently using? The error you are getting almost looks like it was generated by MySQL. Either way like I said before, 'cmd.php' cannot segfault since it is not a compiled program. Therefore it has to either be a spawned process or the PHP binary causing it.

Also, does it segfault right away, or does it update a few data sources first (check the log to be sure)?

Curious to see what you come up with.

-Ian
sancho
Posts: 17
Joined: Mon Mar 11, 2002 7:00 pm
Location: Saipan, CNMI, USA

Post by sancho »

Hi,

I'm also having errors when I do php cmd.php. The following is the result.

PHP Warning: Undefined variable: database in /www/htdocs/cacti-0.6.6/include/database.php on line 17
PHP Warning: Undefined variable: do_not_read_config in /www/htdocs/cacti-0.6.6/include/config.php on line 37
PHP Warning: Undefined variable: do_not_read_config in /www/htdocs/cacti-0.6.6/include/config.php on line 37
PHP Warning: Undefined variable: do_not_read_config in /www/htdocs/cacti-0.6.6/include/config.php on line 37
PHP Warning: Undefined variable: database in /www/htdocs/cacti-0.6.6/include/database.php on line 17

What does this mean? Thanks.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Undefined variable errors are usually due to not having these settings in your php.ini file:

register_globals = On
register_argc_argv = On

Also, make note that some php binaries use seperate php.ini files from the apache module version of php (debian is one example of this).

-Ian
supertux
Posts: 14
Joined: Mon Jan 21, 2002 7:00 pm
Location: Munich, Germany
Contact:

Post by supertux »

Hi raX,



I am using mysql 3.23.44 and php 4.0.6 on SuSE Linux 7.3.



The system information is gathered OK but no SNMP data is collected. The error messages only appear after a second or two.

<font size=-1>[ This Message was edited by: supertux on 2002-03-18 15:43 ]</font>
sancho
Posts: 17
Joined: Mon Mar 11, 2002 7:00 pm
Location: Saipan, CNMI, USA

Post by sancho »

Hi raX,

Those two settings are enabled or turned 'On' in my php.ini file. Any other ideas? Thanks.

sancho
On 2002-03-18 10:19, raX wrote:
Undefined variable errors are usually due to not having these settings in your php.ini file:

register_globals = On
register_argc_argv = On

Also, make note that some php binaries use seperate php.ini files from the apache module version of php (debian is one example of this).

-Ian
sancho
Posts: 17
Joined: Mon Mar 11, 2002 7:00 pm
Location: Saipan, CNMI, USA

Post by sancho »

Hi,

Another thing that I'm getting whenever I add Interfaces using the 'SNMP Interface' setting is this:

Interface Number Description Speed Hardware Address IP Address
0 Invalid object identifier: interfaces.ifTable.ifEntry.ifDescr.INTEGER: Error in packet. Reason: There is no such variable name in this MIB. This name doesn't exist: .ccitt.0 Error in packet. Reason: There is no such variable name in this MIB. This name d 2.3E-05 mbit Invalid object identifier: interfaces.ifTable.ifEn

This is all I get every time I try to add a host and community for a device that I would like to graph.

Thanks.

sancho
sancho
Posts: 17
Joined: Mon Mar 11, 2002 7:00 pm
Location: Saipan, CNMI, USA

Post by sancho »

raX,

What I did is I replaced my php.ini from the provided one and things worked out. This can be weird at times, I guess :smile:. Now, I'm having problems with SNMP data. My post is above. Thanks.

sancho
On 2002-03-18 16:32, sancho wrote:
Hi raX,

Those two settings are enabled or turned 'On' in my php.ini file. Any other ideas? Thanks.

sancho
On 2002-03-18 10:19, raX wrote:
Undefined variable errors are usually due to not having these settings in your php.ini file:

register_globals = On
register_argc_argv = On

Also, make note that some php binaries use seperate php.ini files from the apache module version of php (debian is one example of this).

-Ian
<font size=-1>[ This Message was edited by: sancho on 2002-03-18 17:00 ]</font>
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

It seems as if both of you are using PHP 4.0.6 on SuSE Linux 7.3. I doubt your linux distribution is causing it, but the same version of PHP with the same SuSE version may. I highly recommend that you grab the latest copy of PHP and compile a binary (./configure --with-mysql && make). You can also compile in SNMP support at this stage if you want also.

sancho: Your problem seems to be with net-snmp not being able to locate all of its nessesary MIB's.

I am going to make an interm release tonight or tomorrow to address some of these issues and will fix your problem. I am going to assume that you are using builtin SNMP support since your errors were spit back to the browser. You could probably download and install a new copy of net-snmp, then re-compile PHP to fix this.

Ian
sancho
Posts: 17
Joined: Mon Mar 11, 2002 7:00 pm
Location: Saipan, CNMI, USA

Post by sancho »

raX,

I'm using ucd-snmp. I don't hink I compile snmp in php, but I could be wrong. I'll try na do what you suggested. Thanks.

sancho
sancho: Your problem seems to be with net-snmp not being able to locate all of its nessesary MIB's.

I am going to make an interm release tonight or tomorrow to address some of these issues and will fix your problem. I am going to assume that you are using builtin SNMP support since your errors were spit back to the browser. You could probably download and install a new copy of net-snmp, then re-compile PHP to fix this.

Ian
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

You are right; cacti would be using the ucd-snmp binary from the frontend. I almost forget that I have to yet to update this code to use the snmpget() function in PHP. Regardless, if a re-compile/re-install of ucd-snmp does not help; the next version surely will with numeric OID's instead of relying on ucd's MIB files.

-Ian
Guest

Post by Guest »

[quote]
On 2002-03-22 07:52, supertux wrote:
raX,

It´s fixed. Somehow the version of PHP shipped with SuSE 7.3 has a problem with the builtin SNMP functions. I downloaded and installed the latest version (php-4.1.2) from php.net which fixed the problem.

I have now done extensive tests with cacti using SuSE 7.2 and all functions now work on 7.3, so I think SuSE can now also be added to the list of supported OS´s.

Regards
Max
jon@fido.net
Posts: 1
Joined: Tue Aug 20, 2002 6:49 am
Location: Watford
Contact:

Failed to open byte range locking database

Post by jon@fido.net »

I'm running a brand new (1st time) installation of cacti 0.6.8 on a vanilla redhat-7.2 box fully sync'd to rhn.

When running cmd.php I get the following error (and no graphs)

bash-2.05$ php cmd.php
Failed to open byte range locking database
ERROR: Failed to initialise locking database
X-Powered-By: PHP/4.0.6
Content-type: text/html

Any ideas?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest