Error Code 14 on new installation

You need additional help with phplogcon, then write into this forum.

Error Code 14 on new installation

Postby amirshakoor » Thu Feb 19, 2009 11:23 pm

I receive the following error on a new installation of phpLogCon 2.5.24: No syslog records found - Error Details: Invalid datafield mappings

I looked at the KB article and i did not find a resolution for the issue or any other discussion.

I setup phpLogCon to connect to an existing mysql database for my rsyslog server. This is a Centos 5 machine with rsyslog 2.0.

Here is the rsyslog.conf
Code: Select all
$ModLoad MySQL
*.*       >mysql-server,syslog,syslog_writer,password


Here is the create statement for the systemevents table:
Code: Select all
CREATE TABLE  `syslog`.`systemevents` (
  `ID` int(10) unsigned NOT NULL auto_increment,
  `CustomerID` bigint(20) default NULL,
  `ReceivedAt` datetime default NULL,
  `DeviceReportedTime` datetime default NULL,
  `Facility` smallint(6) default NULL,
  `Priority` smallint(6) default NULL,
  `FromHost` varchar(60) default NULL,
  `Message` text,
  `NTSeverity` int(11) default NULL,
  `Importance` int(11) default NULL,
  `EventSource` varchar(60) default NULL,
  `EventUser` varchar(60) default NULL,
  `EventCategory` int(11) default NULL,
  `EventID` int(11) default NULL,
  `EventBinaryData` text,
  `MaxAvailable` int(11) default NULL,
  `CurrUsage` int(11) default NULL,
  `MinUsage` int(11) default NULL,
  `MaxUsage` int(11) default NULL,
  `InfoUnitID` int(11) default NULL,
  `SysLogTag` varchar(60) default NULL,
  `EventLogType` varchar(60) default NULL,
  `GenericFileName` varchar(60) default NULL,
  `SystemID` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=15240 DEFAULT CHARSET=latin1;


What do I need to do to get the data fields mapped correctly?
amirshakoor
New
 
Posts: 3
Joined: Thu Feb 19, 2009 11:13 pm

phpLogCon professional services

  • Custom phpLogCon configuration?
  • Maintenance Contract?
  • Installation support?

Re: Error Code 14 on new installation

Postby amirshakoor » Thu Feb 19, 2009 11:29 pm

Here is my config.php file:
Code: Select all
<?php
/*
        *********************************************************************
        * phpLogCon - http://www.phplogcon.org
        * -----------------------------------------------------------------
        * Main Configuration File
        *
        * -> Configuration need variables for the Database connection
        *
        * Copyright (C) 2008 Adiscon GmbH.
        *
        * This file is part of phpLogCon.
        *
        * PhpLogCon is free software: you can redistribute it and/or modify
        * it under the terms of the GNU General Public License as published by
        * the Free Software Foundation, either version 3 of the License, or
        * (at your option) any later version.
        *
        * PhpLogCon is distributed in the hope that it will be useful,
        * but WITHOUT ANY WARRANTY; without even the implied warranty of
        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        * GNU General Public License for more details.
        *
        * You should have received a copy of the GNU General Public License
        * along with phpLogCon. If not, see <http://www.gnu.org/licenses/>.
        *
        * A copy of the GPL can be found in the file "COPYING" in this
        * distribution.
        *********************************************************************
*/

// --- Avoid directly accessing this file!
if ( !defined('IN_PHPLOGCON') )
{
        die('Hacking attempt');
        exit;
}
// ---

// --- UserDB options
/*      If UserDB is enabled, all options will and have to be configured in the database.
*       All Options below the UserDB options here will not be used, unless a setting
*       is missing in the database.
*/
$CFG['UserDBEnabled'] = false;
$CFG['UserDBServer'] = 'localhost';
$CFG['UserDBPort'] = 3306;
$CFG['UserDBName'] = 'phplogcon';
$CFG['UserDBPref'] = 'logcon_';
$CFG['UserDBUser'] = 'root';
$CFG['UserDBPass'] = '';
$CFG['UserDBLoginRequired'] = false;
// ---

// --- Misc Options
$CFG['MiscShowDebugMsg'] = 0;                           // if enabled, you will get additional output on certain places
$CFG['MiscDebugToSyslog'] = 0;                          // if enabled, debug messages from phpLogCon will be send to syslog on linux, and into the EventLog on Windows
$CFG['MiscShowDebugGridCounter'] = 0;           // Only for debugging purposes, will add a counter column into the grid!
$CFG["MiscShowPageRenderStats"] = 1;            // If enabled, you will see Pagerender Settings
$CFG['MiscEnableGzipCompression'] = 1;          // If enabled, phplogcon will use gzip compression for output, we recommend
                                                                                        // to have this option enabled, it will highly reduce bandwith usage.
$CFG['MiscMaxExecutionTime'] = 30;                      // phpLogCon will try to overwrite the default script timeout with this value during runtime!
                                                                                        // This can of course only work if phpLogCon is allowed to changed the script timeout.
$CFG['DebugUserLogin'] = 0;                                     // if enabled, you will see additional informations on failed logins
// ---

// --- Default Frontend Options
$CFG['PrependTitle'] = "";                                      // If set, this text will be prepended withint the title tag
$CFG['ViewUseTodayYesterday'] = 1;                      // If enabled, the date from today and yesterday is displayed as "today" and "yesterday"
$CFG['ViewMessageCharacterLimit'] = 80;         // Default character limit for the message gets trunscated! 0 means NO trunscation.
$CFG['ViewStringCharacterLimit'] = 30;          // Default character limit for all other string type fields before they get trunscated! 0 means NO trunscation.
$CFG['ViewEntriesPerPage'] = 50;                        // Default number of syslog entries shown per page
$CFG['ViewEnableDetailPopups'] = 1;                     // If enabled, you will see additional Details for each syslog message on mouse over.
$CFG['ViewDefaultTheme'] = "default";           // This sets the default theme the user is going to see when he opens phplogcon the first time.
                                                                                        // Currently only "default" and "dark" are available.
$CFG['ViewDefaultLanguage'] = "en";                     // Sets the default display language
$CFG['ViewEnableAutoReloadSeconds'] = 0;        // If "ViewEnableAutoReloadSeconds" is set to anything higher the 0 (which means disabled), this means auto reload is enabled by default.

$CFG['SearchCustomButtonCaption'] = "I'd like to feel sad";     // Default caption for the custom fast search button
$CFG['SearchCustomButtonSearch'] = "error";                                     // Default search string for the custom search button

$CFG['EnableIPAddressResolve'] = 1;                     // If enabled, IP Addresses inline messages are automatically resolved and the result is added in brackets {} behind the IP Address
$CFG['SuppressDuplicatedMessages'] = 0;         // If enabled, duplicated messages will be suppressed in the main display.
$CFG['TreatNotFoundFiltersAsTrue'] = 0;         // If you filter / search for messages, and the fields you are filtering for is not found, the filter result is treaten as TRUE!
$CFG['PopupMenuTimeout'] = 3000;                        // This variable defines the default timeout value for popup menus in milliseconds. (those menus which popup when you click on the value of a field.
$CFG['PhplogconLogoUrl'] = "";                          // Put an Url to a custom toplogo you want to use.
// ---

// --- Custom HTML Code
$CFG['InjectHtmlHeader'] = "";                          // Use this variable to inject custom html into the html <head> area!
$CFG['InjectBodyHeader'] = "";                          // Use this variable to inject custom html into the begin of the <body> area!
$CFG['InjectBodyFooter'] = "";                          // Use this variable to inject custom html into the end of the <body> area!
// ---

// --- Define which fields you want to see
//$CFG['ShowMessage'] = true;                                   // If enabled, the Message column will be appended to the columns list.
//Eventlog based fields: $CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, /*SYSLOG_EVENT_CATEGORY, */SYSLOG_EVENT_ID, SYSLOG_MESSAGE );
//$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE );
$CFG['DefaultViewsID'] = "";
// ---

// --- Predefined Searches!
$CFG['Search'][] = array ( "DisplayName" => "Syslog Warnings and Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3%2C4&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "Syslog Errors", "SearchQuery" => "filter=severity%3A0%2C1%2C2%2C3&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from the last hour", "SearchQuery" => "filter=datelastx%3A1&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 12 hours", "SearchQuery" => "filter=datelastx%3A2&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 24 hours", "SearchQuery" => "filter=datelastx%3A3&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 7 days", "SearchQuery" => "filter=datelastx%3A4&search=Search" );
$CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "SearchQuery" => "filter=datelastx%3A5&search=Search" );
// $CFG['Search'][] = array ( "DisplayName" => "", "SearchQuery" => "" );
// ---

// --- Predefined Charts!
$CFG['Charts'][] = array ( "DisplayName" => "Top Hosts", "chart_type" => CHART_BARS_HORIZONTAL, "chart_width" => 400, "chart_field" => SYSLOG_HOST, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 );
$CFG['Charts'][] = array ( "DisplayName" => "SyslogTags", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_SYSLOGTAG, "maxrecords" => 10, "showpercent" => 0, "chart_enabled" => 1 );
$CFG['Charts'][] = array ( "DisplayName" => "Severity Occurences", "chart_type" => CHART_BARS_VERTICAL, "chart_width" => 400, "chart_field" => SYSLOG_SEVERITY, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 );
$CFG['Charts'][] = array ( "DisplayName" => "Usage by Day", "chart_type" => CHART_CAKE, "chart_width" => 400, "chart_field" => SYSLOG_DATE, "maxrecords" => 10, "showpercent" => 1, "chart_enabled" => 1 );
// ---

// --- Source Options
/* Example for DiskType Source:
        $CFG['Sources']['Source1']['ID'] = "Source1";
        $CFG['Sources']['Source1']['Name'] = "Syslog Disk File";
        $CFG['Sources']['Source1']['Description'] = "More details you want to see about this source";
        $CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;
        $CFG['Sources']['Source1']['LogLineType'] = "syslog";
        $CFG['Sources']['Source1']['MsgParserList'] = "";
        $CFG['Sources']['Source1']['MsgNormalize'] = 0;
        $CFG['Sources']['Source1']['DiskFile'] = "/var/log/syslog";
        $CFG['Sources']['Source1']['ViewID'] = "SYSLOG";

        $CFG['Sources']['Source2']['ID'] = "Source5";
        $CFG['Sources']['Source2']['Name'] = "WinSyslog DB";
        $CFG['Sources']['Source1']['Description'] = "";
        $CFG['Sources']['Source2']['SourceType'] = SOURCE_DB;
        $CFG['Sources']['Source1']['MsgParserList'] = "";
        $CFG['Sources']['Source2']['DBTableType'] = "winsyslog";
        $CFG['Sources']['Source2']['DBType'] = DB_MYSQL;
        $CFG['Sources']['Source2']['DBServer'] = "localhost";
        $CFG['Sources']['Source2']['DBName'] = "phplogcon";
        $CFG['Sources']['Source2']['DBUser'] = "root";
        $CFG['Sources']['Source2']['DBPassword'] = "";
        $CFG['Sources']['Source2']['DBTableName'] = "systemevents";
        $CFG['Sources']['Source2']['ViewID'] = "SYSLOG";
*/

$CFG['DefaultSourceID'] = 'Source1';

$CFG['Sources']['Source1']['ID'] = 'Source1';
$CFG['Sources']['Source1']['Name'] = 'My Syslog Source';
$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG';
$CFG['Sources']['Source1']['SourceType'] = SOURCE_PDO;
$CFG['Sources']['Source1']['DBTableType'] = 'syslog';
$CFG['Sources']['Source1']['DBType'] = DB_MYSQL;
$CFG['Sources']['Source1']['DBServer'] = 'mysql-SERVER';
$CFG['Sources']['Source1']['DBName'] = 'syslog';
$CFG['Sources']['Source1']['DBUser'] = 'syslog_reader';
$CFG['Sources']['Source1']['DBPassword'] = 'password';
$CFG['Sources']['Source1']['DBTableName'] = 'systemevents';
$CFG['Sources']['Source1']['DBEnableRowCounting'] = false;

// ---

?>
amirshakoor
New
 
Posts: 3
Joined: Thu Feb 19, 2009 11:13 pm

Re: Error Code 14 on new installation

Postby alorbach » Fri Feb 20, 2009 11:48 am

In your config.php, change this:
Code: Select all
$CFG['Sources']['Source1']['DBTableType'] = 'syslog';


into this:
Code: Select all
$CFG['Sources']['Source1']['DBTableType'] = 'monitorware';


For more details what values are supported as DBTableType right now, see step 4.5 of the installation document:
http://www.phplogcon.org/module-Static_ ... html.phtml


best regards,
Andre Lorbach
User avatar
alorbach
Site Admin
 
Posts: 1129
Joined: Thu Feb 13, 2003 11:55 am

Re: Error Code 14 on new installation

Postby amirshakoor » Fri Feb 20, 2009 2:16 pm

That help resolve the issue.

I also changed
Code: Select all
$CFG['Sources']['Source1']['SourceType'] = SOURCE_PDO;

to
Code: Select all
$CFG['Sources']['Source1']['SourceType'] = SOURCE_DB;

and it worked perfectly after that.

Thank you.
amirshakoor
New
 
Posts: 3
Joined: Thu Feb 19, 2009 11:13 pm

Re: Error Code 14 on new installation

Postby alorbach » Fri Feb 20, 2009 2:46 pm

Hehe, to clarify "SOURCE_DB" is a native MYSQL database driver, where SOURCE_PDO is a generic database driver using php pdo functions, and can also be used on MSSQL or postgresql databases for example.
User avatar
alorbach
Site Admin
 
Posts: 1129
Joined: Thu Feb 13, 2003 11:55 am

Google Ads



Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron