Ad Widget

Collapse

Blank Webinterface after Installation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kai Ehlig
    Junior Member
    • Aug 2007
    • 8

    #1

    Blank Webinterface after Installation

    Hi

    I have installed zabbix 1.4 on SUSE Linux 10.2 with MySQL
    The Installation works fine and without problems.
    But now the only thing I can see on http://localhost/~zabbix/ is a blank page

    I had changed the httpd.conf

    Code:
    <Directory /home/*/public_html>
      AllowOverride FileInfo AuthConfig Limit Indexes
      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
      <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
      </Limit>
      <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
      </LimitExcept>
    </Directory>

    This is my httpd.conf
    Code:
    #
    # /etc/apache2/httpd.conf 
    #
    # This is the main Apache server configuration file.  It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs-2.2/> for detailed information about
    # the directives.
    
    # Based upon the default apache configuration file that ships with apache,
    # which is based upon the NCSA server configuration files originally by Rob
    # McCool. This file was knocked together by Peter Poeml <[email protected]>.
    
    # If possible, avoid changes to this file. It does mainly contain Include
    # statements and global settings that can/should be overridden in the
    # configuration of your virtual hosts.
    
    # Quickstart guide:
    # /usr/share/doc/packages/apache2/README.QUICKSTART
    
    
    # Overview of include files, chronologically:
    #
    # httpd.conf
    #  | 
    #  |-- uid.conf  . . . . . . . . . . . . . .  UserID/GroupID to run under
    #  |-- server-tuning.conf  . . . . . . . . .  sizing of the server (how many processes to start, ...)
    #  |-- sysconfig.d/loadmodule.conf . . . . .[*] load these modules
    #  |-- listen.conf . . . . . . . . . . . . .  IP adresses / ports to listen on
    #  |-- mod_log_config.conf . . . . . . . . .  define logging formats
    #  |-- sysconfig.d/global.conf . . . . . . .[*] server-wide general settings
    #  |-- mod_status.conf . . . . . . . . . . .  restrict access to mod_status (server monitoring)
    #  |-- mod_info.conf . . . . . . . . . . . .  restrict access to mod_info
    #  |-- mod_usertrack.conf  . . . . . . . . .  defaults for cookie-based user tracking
    #  |-- mod_autoindex-defaults.conf . . . . .  defaults for displaying of server-generated directory listings
    #  |-- mod_mime-defaults.conf  . . . . . . .  defaults for mod_mime configuration
    #  |-- errors.conf . . . . . . . . . . . . .  customize error responses
    #  |-- ssl-global.conf . . . . . . . . . . .  SSL conf that applies to default server _and all_ virtual hosts
    #  |
    #  |-- default-server.conf . . . . . . . . .  set up the default server that replies to non-virtual-host requests
    #  |    |--mod_userdir.conf  . . . . . . . .  enable UserDir (if mod_userdir is loaded)
    #  |    `--conf.d/apache2-manual?conf  . . .  add the docs ('?' = if installed)
    #  |
    #  |-- sysconfig.d/include.conf  . . . . . .[*] your include files 
    #  |                                             (for each file to be included here, put its name 
    #  |                                              into APACHE_INCLUDE_* in /etc/sysconfig/apache2)
    #  |
    #  `-- vhosts.d/ . . . . . . . . . . . . . .  for each virtual host, place one file here
    #       `-- *.conf . . . . . . . . . . . . .     (*.conf is automatically included)
    #
    #
    # Files marked[*] are created from sysconfig upon server restart: instead of
    # these files, you edit /etc/sysconfig/apache2
    
    
    
    #  Filesystem layout:
    #
    # /etc/apache2/
    #  |-- charset.conv  . . . . . . . . . . . .  for mod_auth_ldap
    #  |-- conf.d/
    #  |   |-- apache2-manual.conf . . . . . . .  conf that comes with apache2-doc
    #  |   |-- mod_php4.conf . . . . . . . . . .  (example) conf that comes with apache2-mod_php4
    #  |   `-- ... . . . . . . . . . . . . . . .  other configuration added by packages
    #  |-- default-server.conf
    #  |-- errors.conf
    #  |-- httpd.conf  . . . . . . . . . . . . .  top level configuration file
    #  |-- listen.conf
    #  |-- magic
    #  |-- mime.types -> ../mime.types
    #  |-- mod_autoindex-defaults.conf
    #  |-- mod_info.conf
    #  |-- mod_log_config.conf
    #  |-- mod_mime-defaults.conf
    #  |-- mod_perl-startup.pl
    #  |-- mod_status.conf
    #  |-- mod_userdir.conf
    #  |-- mod_usertrack.conf
    #  |-- server-tuning.conf
    #  |-- ssl-global.conf
    #  |-- ssl.crl/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Revocation Lists (CRL)
    #  |-- ssl.crt/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificates
    #  |-- ssl.csr/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Signing Requests
    #  |-- ssl.key/  . . . . . . . . . . . . . .  PEM-encoded RSA Private Keys
    #  |-- ssl.prm/  . . . . . . . . . . . . . .  public DSA Parameter Files
    #  |-- sysconfig.d/  . . . . . . . . . . . .  files that are created from /etc/sysconfig/apache2
    #  |   |-- global.conf
    #  |   |-- include.conf
    #  |   `-- loadmodule.conf
    #  |-- uid.conf
    #  `-- vhosts.d/ . . . . . . . . . . . . . .  put your virtual host configuration (*.conf) here
    #      |-- vhost-ssl.template
    #      `-- vhost.template
    
    
    
    ### Global Environment ######################################################
    #
    # The directives in this section affect the overall operation of Apache,
    # such as the number of concurrent requests.
    
    # run under this user/group id
    Include /etc/apache2/uid.conf
    
    # - how many server processes to start (server pool regulation)
    # - usage of KeepAlive
    Include /etc/apache2/server-tuning.conf
    
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    ErrorLog /var/log/apache2/error_log
    
    # generated from APACHE_MODULES in /etc/sysconfig/apache2
    Include /etc/apache2/sysconfig.d/loadmodule.conf
    
    # IP addresses / ports to listen on
    Include /etc/apache2/listen.conf
    
    # predefined logging formats
    Include /etc/apache2/mod_log_config.conf
    
    # generated from global settings in /etc/sysconfig/apache2
    Include /etc/apache2/sysconfig.d/global.conf
    
    # optional mod_status, mod_info
    Include /etc/apache2/mod_status.conf
    Include /etc/apache2/mod_info.conf
    
    # optional cookie-based user tracking
    # read the documentation before using it!!
    Include /etc/apache2/mod_usertrack.conf
    
    # configuration of server-generated directory listings
    Include /etc/apache2/mod_autoindex-defaults.conf
    
    # associate MIME types with filename extensions
    TypesConfig /etc/apache2/mime.types
    DefaultType text/plain
    Include /etc/apache2/mod_mime-defaults.conf
    
    # set up (customizable) error responses
    Include /etc/apache2/errors.conf
    
    # global (server-wide) SSL configuration, that is not specific to 
    # any virtual host
    Include /etc/apache2/ssl-global.conf
    
    # forbid access to the entire filesystem by default
    
    <Directory /home/*/public_html>
      AllowOverride FileInfo AuthConfig Limit Indexes
      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
      <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
      </Limit>
      <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
      </LimitExcept>
    </Directory>
    
    
    
    
    # use .htaccess files for overriding,
    AccessFileName .htaccess
    # and never show them
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    
    # List of resources to look for when the client requests a directory
    DirectoryIndex index.html index.html.var
    
    ### 'Main' server configuration #############################################
    #
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition.  These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    #
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    #
    Include /etc/apache2/default-server.conf
    
    
    # Another way to include your own files
    #
    # The file below is generated from /etc/sysconfig/apache2,
    # include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
    # APACHE_CONF_INCLUDE_DIRS
    Include /etc/apache2/sysconfig.d/include.conf
    
    
    ### Virtual server configuration ############################################
    #
    # VirtualHost: If you want to maintain multiple domains/hostnames on your
    # machine you can setup VirtualHost containers for them. Most configurations
    # use only name-based virtual hosts so the server doesn't need to worry about
    # IP addresses. This is indicated by the asterisks in the directives below.
    #
    # Please see the documentation at
    # <URL:http://httpd.apache.org/docs-2.2/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your virtual host
    # configuration.
    #
    #Include /etc/apache2/vhosts.d/*.conf
    
    
    # Note: instead of adding your own configuration here, consider 
    #       adding it in your own file (/etc/apache2/httpd.conf.local)
    #       putting its name into APACHE_CONF_INCLUDE_FILES in 
    #       /etc/sysconfig/apache2 -- this will make system updates 
    #       easier :)
    Can somebody tell me my failure?
  • Kai Ehlig
    Junior Member
    • Aug 2007
    • 8

    #2
    Can sb help me?
    The MYSQL Database is filled with the mysql.sql and data.sql Information

    And the db.inc.php is also configured

    Code:
    
    <?php
    
    //	 $DB_TYPE ="MYSQL";
    	 $DB_SERVER ="localhost";
     $DB_PORT,
    	 $DB_DATABASE="zabbix";
    	 $DB_USER="root";
    	 $DB_PASSWORD="";
    
    	function	DBconnect(&$error)
    	{
    		$result = true;
    		
    		global $DB, $DB_TYPE="MYSQL", $DB_SERVER="localhost", $DB_PORT, $DB_DATABASE="zabbix", $DB_USER="root", $DB_PASSWORD="";
    
    		$DB = null;
    
    //SDI('type: '.$DB_TYPE.'; server: '.$DB_SERVER.'; port: '.$DB_PORT.'; db: '.$DB_DATABASE.'; usr: '.$DB_USER.'; pass: '.$DB_PASSWORD);
    
    		if(!isset($DB_TYPE))
    		{
    			$error = "Unknown database type.";
    			$result = false;
    		}
    		else
    		{
    			switch($DB_TYPE)
    			{
    				case "MYSQL":
    					$mysql_server = $DB_SERVER.( !empty($DB_PORT) ? ':'.$DB_PORT : '');
    
    					if ( !($DB = mysql_pconnect($mysql_server,$DB_USER,$DB_PASSWORD)))
    					{
    						$error = "Error connecting to database [".mysql_error()."]";
    						$result = false;
    					}
    					else
    					{
    						if ( !mysql_select_db($DB_DATABASE) )
    						{
    							$error = 'Error database selection ['.mysql_error().']';
    							$result = false;
    						}
    					}
    					break;
    				case "POSTGRESQL":
    					$pg_connection_string = 
    						( !empty($DB_SERVER) ? 'host=\''.$DB_SERVER.'\' ' : '').
    						'dbname=\''.$DB_DATABASE.'\' '.
    						( !empty($DB_USER) ? 'user=\''.$DB_USER.'\' ' : '').
    						( !empty($DB_PASSWORD) ? 'password=\''.$DB_PASSWORD.'\' ' : '').
    						( !empty($DB_PORT) ? 'port='.$DB_PORT : '');
    SDI($pg_connection_string);
    					$DB=pg_pconnect($pg_connection_string);
    					if(!$DB)
    					{
    						$error = 'Error connecting to database';
    						$result = false;
    					}
    					break;
    				case "ORACLE":
    					$DB = ocilogon($DB_USER, $DB_PASSWORD, $DB_DATABASE);
    					//$DB = ocilogon($DB_USER, $DB_PASSWORD, "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$DB_SERVER)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=$DB_DATABASE)))");
    					if(!$DB)
    					{
    						$error = "Error connecting to database";
    						$result = false;
    					}
    					break;
    				case "SQLITE3":
    					if(!function_exists('init_db_access'))
    					{
    						function init_db_access()
    						{
    							global $DB_DATABASE, $ZBX_SEM_ID;
    
    							$ZBX_SEM_ID = false;
    							if(function_exists('ftok') && function_exists('sem_get') &&
    								file_exists($DB_DATABASE))
    							{
    								$ZBX_SEM_ID = sem_get(ftok($DB_DATABASE, 'z'), 1);
    							}
    						}
    					}
    
    					if(!function_exists('lock_db_access'))
    					{
    						function lock_db_access()
    						{
    							global $ZBX_SEM_ID;
    
    							if($ZBX_SEM_ID && function_exists('sem_acquire'))
    							{
    								sem_acquire($ZBX_SEM_ID);
    							}
    						}
    					}
    
    					if(!function_exists('unlock_db_access'))
    					{
    						function unlock_db_access()
    						{
    							global $ZBX_SEM_ID;
    
    							if($ZBX_SEM_ID && function_exists('sem_release'))
    								sem_release($ZBX_SEM_ID);
    						}
    							global $ZBX_SEM_ID;
    
    							if($ZBX_SEM_ID && function_exists('sem_remove'))
    								sem_remove($ZBX_SEM_ID);
    
    							$ZBX_SEM_ID = false;
    						}
    					}
    
    
    					if(file_exists($DB_DATABASE))
    					{
    						$DB = sqlite3_open($DB_DATABASE);
    						if(!$DB)
    						{
    							$error = "Error connecting to database";
    							$result = false;
    						}
    					}
    					else
    					{
    						$error = "Missed database";
    						$result = false;
    					}
    
    					init_db_access();
    					break;
    				default:
    					$error = "Unsupported database";
    					$result = false;
    			}
    		}
    		if( false == $result )
    			$DB = null;
    
    		return $result;
    	}
    
    	function	DBclose()
    	{
    		global $DB, $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD;
    
    		$result = false;
    
    		if( isset($DB) && !empty($DB) )
    		{
    			switch($DB_TYPE)
    			{
    				case "MYSQL":		$result = mysql_close($DB);	break;
    				case "POSTGRESQL":	$result = pg_close($DB);	break;
    				case "ORACLE":		$result = ocilogoff($DB);	break;
    				case "SQLITE3":		
    					$result = true; 
    					sqlite3_close($DB);	
    					free_db_access();
    					break;
    				default:		break;
    			}
    		}
    
    		unset(
    			$GLOBALS['DB'],
    			$GLOBALS['DB_TYPE'],
    			$GLOBALS['DB_SERVER'],
    			$GLOBALS['DB_PORT'],
    			$GLOBALS['DB_DATABASE'],
    			$GLOBALS['DB_USER'],
    			$GLOBALS['DB_PASSWORD']
    			);
    		
    		return $result;
    	}
    
    	function	DBloadfile($file, &$error)
    	{
    		global $DB_TYPE;
    
    		if(!file_exists($file))
    		{
    			$error = 'DBloadfile. Missing file['.$file.']';
    			return false;
    		}
    		
    		$fl = file($file);
    		
    		foreach($fl as $n => $l) if(substr($l,0,2)=='--') unset($fl[$n]);
    		
    		$fl = explode(";\n", implode("\n",$fl));
    		unset($fl[count($fl)-1]);
    		
    		foreach($fl as $sql)
    		{
    			if(empty($sql)) continue;
    
    			if(!DBexecute($sql,0))
    			{
    				$error = '';
    				return false;
    			}
    		}
    		return true;
    	}
    
    	function	DBstart()
    	{
    		/* TODO *//* start transaction */
    		// lock_db_access(); /* check DBselect & DBexecute */
    	}
    	
    	function	DBend($result)
    	{
    		/* end transaction *//* TODO */
    
    		if($result)
    		{ // OK
    			/* commit TODO */
    		}
    		else
    		{ // FAIL
    			/* rollback  TODO */
    		}
    		// unlock_db_access(); /* check DBselect & DBexecute */
    	}
    
    	/* NOTE:
    		LIMIT and OFFSET records
    		
    		Example: select 6-15 row.
    
    		MySQL:	
    			SELECT a FROM tbl LIMIT 5,10
    			SELECT a FROM tbl LIMIT 10 OFFSET 5
    		PostgreSQL:
    			SELECT a FROM tbl LIMIT 10 OFFSET 5
    		Oracle:
    			SELECT a FROM tbe WHERE ROWNUM < 15 // ONLY < 15
    			SELECT * FROM (SELECT ROWNUM as RN, * FROM tbl) WHERE RN BETWEEN 6 AND 15
    	*/
    
    	function	&DBselect($query, $limit='NO')
    	{
    		global $DB, $DB_TYPE;
    
    COpt::savesqlrequest($query);
    
    		$result = false;
    		if( isset($DB) && !empty($DB) )
    		switch($DB_TYPE)
    		{
    			case "MYSQL":
    				if(is_numeric($limit))
    				{
    					$query .= ' limit '.intval($limit);
    				}
    				$result=mysql_query($query,$DB);
    				if(!$result)
    				{
    					error("Error in query [$query] [".mysql_error()."]");
    				}
    				break;
    			case "POSTGRESQL":
    				if(is_numeric($limit))
    				{
    					$query .= ' limit '.intval($limit);
    				}
    				if(!($result = pg_query($DB,$query)))
    				{
    					error("Error in query [$query] [".pg_last_error()."]");
    				}
    				break;
    			case "ORACLE":
    				if(is_numeric($limit))
    				{
    					$query = 'select * from ('.$query.') where rownum<'.intval($limit);
    				}
    
    				$stid=OCIParse($DB,$query);
    				if(!$stid)
    				{
    					$e=@ocierror();
    					error("SQL error [".$e["message"]."] in [".$e["sqltext"]."]");
    				}
    				$result=@OCIExecute($stid);
    				if(!$result)
    				{
    					$e=ocierror($stid);
    					error("SQL error [".$e["message"]."] in [".$e["sqltext"]."]");
    				}
    				else
    				{
    					$result = $stid;
    				}
    				break;
    			case "SQLITE3":
    				lock_db_access();
    				if(!($result = sqlite3_query($DB,$query)))
                                    {
                                            error("Error in query [$query] [".sqlite3_error($DB)."]");
                                    }
    				else
    				{
    					$data = array();
    
    					while($row = sqlite3_fetch_array($result))
    					{
    						foreach($row as $id => $name)
    						{
    							if(!strstr($id,'.')) continue;
    							$ids = explode('.',$id);
    							$row[array_pop($ids)] = $row[$id];
    							unset($row[$id]);
    						}
    						$data[] = $row;
    					}
    
    					sqlite3_query_close($result);
    
    					$result = &$data;
    				}
    				unlock_db_access();
    				break;
    		}
    		
    		return $result;
    	}
    
    	function	DBexecute($query, $skip_error_messages=0)
    	{
    		global $DB,$DB_TYPE;
    
    COpt::savesqlrequest($query);
    
    		$result = false;
    
    		if( isset($DB) && !empty($DB) )
    		switch($DB_TYPE)
    		{
    			case "MYSQL":
    				$result=mysql_query($query,$DB);
    
    				if(!$result)
    				{
    					error("Error in query [$query] [".mysql_error()."]");
    				}
    				break;
    			case "POSTGRESQL":
    				if(!($result = pg_query($DB,$query)))
    				{
    					error("Error in query [$query]

    Comment

    • Kai Ehlig
      Junior Member
      • Aug 2007
      • 8

      #3
      the end of the db.inc.php
      Code:
      [".pg_last_error()."]");
      				}
      				break;
      			case "ORACLE":
      				$result = DBselect($query);
      				if(!$result)
      				{
      					$e = ocierror($stid);
      					error("SQL error [".$e["message"]."] in [".$e["sqltext"]."]");
      				}
      				break;
      			case "SQLITE3":
      				lock_db_access();
      				$result = sqlite3_exec($DB, $query);
      				if(!$result)
      				{
      					error("Error in query [$query] [".sqlite3_error($DB)."]");
      				}
      				unlock_db_access();
      				break;
      		}
      
      		return $result;
      	}
      
      	function	DBfetch(&$cursor)
      	{
      		global $DB, $DB_TYPE;
      	
      		$result = false;
      		
      		if( isset($DB) && !empty($DB) )
      		switch($DB_TYPE)
      		{
      			case "MYSQL":
      				$result = mysql_fetch_array($cursor);
      				break;
      			case "POSTGRESQL":
      				$result = pg_fetch_array($cursor);
      				break;
      			case "ORACLE":
      				if(ocifetchinto($cursor, $row, OCI_ASSOC+OCI_NUM+OCI_RETURN_NULLS))
      				{
      					$result = array();
      					$keys = (array_keys($row));
      					foreach ($keys as $k)		$result[strtolower($k)] = $row[$k];
      				} 
      				break;
      			case "SQLITE3":
      				if($cursor)
      				{
      					$result = array_shift($cursor);
      
      					if(is_null($result)) $result = false;
      
      				}
      				break;
      		}
      
      		return $result;
      	}
      	
      
      /* string value prepearing */
      if(isset($DB_TYPE) && $DB_TYPE == "ORACLE") {	
      	function	zbx_dbstr($var)	{
      		return "'".ereg_replace('\'','\'\'',$var)."'";	
      	}
      } else {			
      	function	zbx_dbstr($var)	{
      		return "'".addslashes($var)."'";
      	}
      }
      
      	function	zbx_dbconcat($params)
      	{
      		global $DB_TYPE;
      
      		switch($DB_TYPE)
      		{
      			case "SQLITE3":
      				return implode(' || ',$params);
      			default:
      				return 'CONCAT('.implode(',',$params).')';
      		}
      	}
      
      	function DBid2nodeid($id_name)
      	{
      		global $DB_TYPE;
      
      		switch($DB_TYPE)
      		{
      			case "MYSQL":
      				$result = '('.$id_name.' div 100000000000000)';
      				break;
      			case "ORACLE":
      				$result = 'round('.$id_name.'/100000000000000)';
      				break;
      			default:
      				$result = '('.$id_name.'/100000000000000)';
      		}
      		return $result;
      	}
      
      	function id2nodeid($id_var)
      	{
      		return (int)bcdiv("$id_var","100000000000000");
      	}
      
      	function	get_dbid($table,$field)
      	{
      		global	$ZBX_CURNODEID;
      
      		if(!isset($ZBX_CURNODEID))	init_nodes();
      /*		$row=DBfetch(DBselect("select max($field) as id from $table where ".DBid2nodeid($field)." in (".$ZBX_CURNODEID.")"));
      		if($row && !is_null($row["id"]))
      		{
      			return	bcadd($row["id"],1);
      		}
      		else
      		{
      			return bcadd(bcmul($ZBX_CURNODEID,"100000000000000"),1);
      		}*/
      
      
      		$found = false;
      		do
      		{
      			$row = DBfetch(DBselect("select nextid from ids where nodeid=$ZBX_CURNODEID and table_name='$table' and field_name='$field'"));
      			if(!$row || is_null($row["nextid"]))
      			{
      				$row=DBfetch(DBselect("select max($field) as id from $table where ".DBid2nodeid($field)." in (".$ZBX_CURNODEID.")"));
      				if(!$row || is_null($row["id"]))
      				{
      					DBexecute("insert into ids (nodeid,table_name,field_name,nextid) values ($ZBX_CURNODEID,'$table','$field',".bcadd(bcmul($ZBX_CURNODEID,"100000000000000"),1).")");
      				}
      				else
      				{
      					DBexecute("insert into ids (nodeid,table_name,field_name,nextid) values ($ZBX_CURNODEID,'$table','$field',".$row["id"].")");
      				}
      				continue;
      			}
      			else
      			{
      				$ret1 = $row["nextid"];
      	
      				DBexecute("update ids set nextid=nextid+1 where nodeid=$ZBX_CURNODEID and table_name='$table' and field_name='$field'");
      	
      				$row = DBfetch(DBselect("select nextid from ids where nodeid=$ZBX_CURNODEID and table_name='$table' and field_name='$field'"));
      				if(!$row || is_null($row["nextid"]))
      				{
      					/* Should never be here */
      					continue;
      				}
      				else
      				{
      					$ret2 = $row["nextid"];
      					if(bccomp(bcadd($ret1,1),$ret2) ==0)
      					{
      						$found = true;
      					}
      				}
      			}
      		}
      		while(false == $found);
      
      		return $ret2;
      	}
      ?>

      Comment

      • Kai Ehlig
        Junior Member
        • Aug 2007
        • 8

        #4
        This is my Apache Error Log

        Code:
        [Tue Aug 21 09:58:42 2007] [notice] caught SIGTERM, shutting down
        [Tue Aug 21 10:01:14 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
        [Tue Aug 21 10:01:14 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
        [Tue Aug 21 10:01:22 2007] [notice] Apache/2.2.3 (Linux/SUSE) configured -- resuming normal operations
        [Tue Aug 21 10:20:15 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:23:18 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:23:22 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:27:47 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:34:14 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:38:31 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:46:11 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 10:46:28 2007] [error] [client 127.0.0.1] client denied by server configuration: /home/zabbix/public_html/include/db.inc.php
        [Tue Aug 21 10:46:39 2007] [error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/zabbix
        [Tue Aug 21 10:46:46 2007] [error] [client 127.0.0.1] client denied by server configuration: /home/zabbix/public_html/include/db.inc.php
        [Tue Aug 21 10:47:33 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 11:09:47 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected '=', expecting ',' or ';' in /home/zabbix/public_html/include/db.inc.php on line 22
        [Tue Aug 21 11:19:08 2007] [error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/zabbix
        [Tue Aug 21 11:19:20 2007] [error] [client 127.0.0.1] script '/srv/www/htdocs/index.php' not found or unable to stat
        [Tue Aug 21 11:21:17 2007] [error] [client 127.0.0.1] script '/srv/www/htdocs/phpinfo.php' not found or unable to stat

        Comment

        Working...