Articles  
 

How to setup WinSyslog and phpLogCon using a MYSQL Database.

 

Article created 2008-07-04 by Andre Lorbach.

This article will guide you in how to setup WinSyslog and phpLogCon by using a MYSQL database as data source on Windows. This article can also be applied to EventReporter and MonitorWare Agent if you want to view EventLog messages with phpLogCon rather then Syslog messages. However I will focus on viewing Syslog messages in this article.

  • You can download a preconfigured configuration from here, which you can import on your target system. The configuration sample will have comments for better understanding. The WinSyslog Client can import the XML/REG configuration file by using the "Computer Menu".

Receiving Syslog messages is good, storing Syslog message is better, but viewing, searching and filtering them is even better ;)! Receiving and storing can be easily archived with WinSyslog, but to do things like searching and filtering, phpLogCon is needed. phpLogCon is a separated open source project from Adiscon which integrates into our monitoring suite.

 

Table of Contents

1. Requirements
1.1 About the requirements
1.2 Installing and configuring WAMP
1.3 Installing MYSQL ODBC Connector
2. Installing and configuring WinSyslog
2.1 Download and Install WinSyslog
2.2  Setup Basics in WinSyslog
2.3 Create the Database Action in WinSyslog
2.4 Starting WinSyslog and verifying the configuration
3. Install and Setup phpLogCon
3.1 Download and copy phpLogCon to the right location
3.2 Install phpLogCon
Final Thoughts

 

1. Requirements

1.1 About the requirements

If you already have a web server with PHP support and MYSQL Server running, you can skip step 1.1 and 1.2.

So in order to setup phpLogCon later, you will nee a web server with PHP support and a MYSQL Server with an administration interface. For these tasks, we recommend the following open source applications:

You can install and configure all these applications separately, but it is much easier to get WAMP for Windows. WAMP means Apache, MYSQL, PHP on Windows and combines all applications with a default configuration which can be used out of the box. So you do not need to worry about the Apache or MYSQL configuration, you just install WAMP first.

Download the latest WAMP Version from here:
http://www.en.wampserver.com/

Back to Top

 

1.2 Installing and configuring WAMP

After you downloaded WAMP, start the installation and follow the instructions. Make sure you do not have a web server or MYSQL Server already installed because this could result into conflicts.

I will use the default installation location in this article which is C:\wamp.

 Back to Top

 

Once the Installation is finished, a new Icon will appear in the Windows Icon tray. Click it, and choose "Localhost" from the menu to confirm that the installation was performed successfully. If it was, you should see a website looking like this. 

To check if your MYSQL is running, click on the phpMyAdmin Menu button in the WAMP Menu, and login with the username "root" and no password - if you are asked for a login.

Back to Top

1.3 Installing MYSQL ODBC Connector

WinSyslog will need a MYSQL ODBC driver in a later step in order to write into the MYSQL database. These drivers have to be downloaded and installed separately from here:
http://dev.mysql.com/downloads/connector

If your Windows System is a x64 version, it is important to install the x64 Version of the MySQL Connector driver. As the WinSyslog Service runs as a 64bit application itself, it will need the connector to be 64bit as well.

 

 

 

2. Installing and configuring WinSyslog

2.1 Download and Install WinSyslog

So if you haven't done so already, go to www.winsyslog.com and download the latest WinSyslog Version. It is always recommended to use the latest Version of WinSyslog. Once the Download is done, go ahead and install it. You may have to restart after installation, this depends on your System.

 

2.2  Setup Basics in WinSyslog

Start the WinSyslog Client, you will see the default configuration. Change the configuration of the Default Syslog Listener to your needs, or create new Syslog Services. Once you have done this, you can go to the next step.

Back to Top

 

Click on your WAMP Icon, and open the phpMyAdmin. Now Create a new database called "WinSyslog". Do not add any tables yet, this will be done by the WinSyslog Client in the next step.

Back to Top

 

2.3 Create the Database Action in WinSyslog

Get back to the WinSyslog Client and create a new Rule in your default RuleSet called "Database". Then add a new "Write to Database" Action, and name it "MYSQL ODBC" for example. After adding the new action, you should be automatically taken to the actions properties.

Click on the "Data Sources (ODBC)" button to open the System ODBC Administrator. Click on the "System DSN" Tab and add a new Datasource, select "MySQL ODBC 5.1 Driver" as driver. It is important to add a System DSN rather then a User DSN, because User DSN's will not be available for the WinSyslog Service.

Name the new datasource "winsyslog" and use "localhost" as Server, "root" as username and no password. Then you are able to select the database which we created before called "WinSyslog". 

Back to Top

 

Enter the DSN and User-ID into the Database Action configuration form. Then click on the "Create Database" button to initially create the needed tables. Don't forget to choose "MySQL" as database in the new Windows. Then click on the Create button to add the tables into your database.

A note for x64 Systems, this will not work here because the Client actually is a 32Bit application and cannot access 64bit ODBC Data-sources. To workaround the problem please do the following:

  • Copy the content of this text field into your clipboard:


  • Now open phpMyAdmin, select the database "winsyslog" and click on the SQL Tab and insert the SQL commands from your clipboard.
  • Then Click "GO", you should see "Your SQL query has been executed successfully" after that as well as two new tables on the left list called systemevents and systemeventsproperties.

 

Back to Top

 

Check the database logging action again, it should look like in the screenshot. 

Back to Top

 

2.4 Starting WinSyslog and verifying the configuration 

From the WinSyslog configuration point of view, everything is setup now. So kindly start the WinSyslog Service. If you do not have any Syslog devices sending messages to your WinSyslog setup already, use the "Tools->Send Syslog Test Message" function to test the configuration.

 

Back to Top

 

Switch back to phpMyAdmin and browse through the systemevents table. You should see at least one data record in this table now, like in the screenshot sample.

Otherwise please check the Windows Application EventLog for possible error reports from WinSyslog.

 

Back to Top

 

3. Install and Setup phpLogCon

3.1 Download and copy phpLogCon to the right location

If you are using WinSyslog 8.3 or higher, a proper version of phpLogCon can be found in the WinSyslog installation folder. If you are using an older Version of WinSyslog, I recommend to download the latest stable or beta build from here: http://www.phplogcon.org/downloads
In this article I will use phpLogCon Version 2.3.6.

You may will need to download and install third party software like WinRAR to unpack the download phpLogCon tar.gz file.

Open the windows explorer and go to the www folder of your Apache web server, which is the folder where you can place html/php files. By default this will be "C:\wamp\www" if you have installed WAMP into the default installation folder. Create a new folder called phplogcon there.

If you downloaded and unpacked phpLogCon, and copy or move the content of the src folder into the C:\wamp\www\phplogcon folder. If you have WinSyslog 8.3 or higher, you can use and copy the contents of the phpLogCon folder of your WinSyslog installation.

The explorer window should like in the screenshot now.

Back to Top

 

3.2 Install phpLogCon

Open this link to start the phpLogCon installation: hhttp://localhost/phplogcon/

If you do not see a page like in the screenshot, something went wrong in the steps before, please check them in this case.

Otherwise click on "here" on the first page to get to the installation routine of phpLogCon.

Back to Top

 

Follow the first steps in the installation of phpLogCon, once you reach Step 7, switch the source type to "MYSQL Native" and name the Source "WinSyslog Database"

Use "WinSyslog" as Database Name and "root" as Database User. Leave the other configuration variables as they are, see the screenshot for how it should look like.

Then click on the Next button to finish the installation.

Back to Top

 

After clicking on Finish link, you should see a working phpLogCon installation using the MYSQL Server as data source. If you do not see any data, there may is no data in your database yet. Otherwise you will see an error code and message from phpLogCon.

Back to Top

 

Final Thoughts

I hope this article will help you installing and configuring phpLogCon and WinSyslog. Note that this can also be archived with EventReporter and MonitorWare Agent, and used for Event Log analysis. If you have problems or question related to this article, don't hesitate to contact me or our support by email.

 

MonitorWare
 Home
 The Products
MonitorWare Products
Product Comparison
Which one to Purchase?
Order and Pricing
Upgrade Insurance Info
News Releases
Version History
MonitorWare Tools
 Event Repository
 Download
 Reference library
General Information
Step-by-step guides
 - All
 - Installation and Configuration
 - Services related
 - Actions related
 - Central Monitoring
Common Uses
Syslog configuration
Syslog Log Samples
Security Reference
 Help
Support
Manual
FAQ
 - All
 - General questions
 - Configurations related
 - Monitorware Agent
 - Monitorware Console
Articles
Seminars Online
 - All
 - General
 - MonitorWare Console
 - MonitorWare Agent
 - WinSyslog related
 - EventReporter
 Order & pricing
Order now
Product Comparison
Pricing Information
Upgrade Insurance Info
Local Reseller
 Contact Us
 Search
 
 



Printer Version Send this page to a friend

Copyright © 1988-2005 Adiscon GmbH All rights reserved.
Contact us via Secure Web Response | Privacy Policy
Topic Links: syslog | Free Weblinks Directory