As you already know, the syslog-ng Agent is the part of the syslog-ng PE. The agent can send event logs and file logs to syslog-ng via tcp or ssl on Windows-based hosts. But sometimes, agent seems to be working wrong. In this post, I will introduce how to debug it.
How to troubleshoot problems during installation
During installation, the installer will create a log file in your installation directory (by default: C:Program Filessyslog-ng Agent). The name of this file is "install.log". You can see every detail in this file that the installer did. For example:
File: overwriteflag=1, allowskipfilesflag=2, name="C:DOCUME~1pzoleeLOCALS~1Temp1nskFB8.tmpnsExec.dll" File: skipped: "C:DOCUME~1pzoleeLOCALS~1Temp1nskFB8.tmpnsExec.dll" (overwriteflag=1) Jump: 3383 Jump: 3387 Jump: 3394 Call: 2438 Call: 2438 detailprint: syslog-ng Agent for Windows not configured. Not starting service syslog-ng Agent. Jump: 3427
Usually, these messages are not too much understandable for you, but if the installation was failed then you need to check it and perhaps, you will find the reason for the failure (in this example, no agent configuration). Using the built-in debugging parameters of syslog-ng Agent
First of all, agent has various command line options that are used for debugging it. Just execute the following command: "syslog-ng Agent.exe -h" and the agent will display them:
The two most importent options are -e and -d.Using -e option is a simple mode to debug agent. If you start the agent with this option (e.g.: syslog-ng Agent.exe -e), some debug information will be displayed in the Event Viewer/Application container. For example:
TransmitThread : Failed to connect to Primary Server '10.30.0.32'
Although this method is easy, it's not really useful, because your application container will contain a lot of debug messages. The second way is using "-d" option. In this case, you can watch debug logs with the Microsoft's free DebugView utility. Just download and install this program on your host and it will capture the logs automatically after starting. For more details about DebugView, see the DebugView official page: http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
Both of methods can be used from Agent v3.0.1.
Advanced debugging
From 3.0.7 and 3.1.0, there are other powerfull debug methods as well.
Just create and set the HKEY_LOCAL_MACHINESOFTWAREBalaBitsyslog-ng AgentAgentDbgLog registry key to "2" to send debug logs to a text file. syslog_ng_Agent.txt will be created in the agent installation directory that contains the debug messages. For example:
Wed Feb 10 10:59:10 2010 TransmitThread : Trying to connect to host '10.30.0.32' Wed Feb 10 10:59:10 2010 Connected to the Syslog server: 10.30.0.32 Wed Feb 10 11:00:15 2010 Event Entry : PROBADOMAINpzolee: Application EventCreate: [Information] testmessage (EventID 1000)
Watching this file, you can see what the agent does. For example, you whish to use SSL layer, but the agent don't send logs. Watching debug logs, you can see the following few lines in this file:
Wed Feb 10 11:02:47 2010 Event Entry : NT AUTHORITYSYSTEM: Application syslog-ng Agent: [Error] Failed to get certificate with subject; 'wrongcertsubject' (EventID 34) Wed Feb 10 11:02:47 2010 Event Entry : NT AUTHORITYSYSTEM: Application syslog-ng Agent: [Error] Failed to find client certificate (EventID 32)
You already know, your certificate is missing or the subject is not matching and that's the reason for this behaviour.
If you set AgentDbgLog key to "1", you will see debug logs in the output of DebugView instead of a text file (like "-d" option).
Because the agent can also work in domain enviroment, - when the config is coming from Group Policy Objects -, you can also debug it. Create the GpoDbgLog key under the same path and set it to "2". Under GPO refreshing (e.g.: run the gpupdate command), a debug file will be created in your SYSTEM32 directory named syslog_gpext.txt.
This file will contain some information about the received GPO's. For example:
... Wed Feb 10 11:50:59 2010 Changed gpo: {31B2F340-016D-11D2-945F-00C04FB984F9} Wed Feb 10 11:50:59 2010 Reg file not found: \probadomain.balabitsysvolprobadomain.balabitPolicies{31B2F340-016D-11D2-945F-00C04FB984F9}MachineBalaBitsyslog-ngSettings.reg Wed Feb 10 11:50:59 2010 OpenProcessToken() is OK Wed Feb 10 11:50:59 2010 SetPrivilege Wed Feb 10 11:50:59 2010 Using RegRestoreKey instead of reg.exe import Wed Feb 10 11:50:59 2010 Restore Filename: \probadomain.balabitsysvolprobadomain.balabitPolicies{31B2F340-016D-11D2-945F-00C04FB984F9}MachineBalaBitsyslog-ngSettings.reg.bin Wed Feb 10 11:50:59 2010 Can't merge this settings, because the gpo config version (3.1.0) is newer than current agent version(3.0.7) Wed Feb 10 11:50:59 2010 Abort update. Wed Feb 10 11:50:59 2010 Restore ...
You can see the UUID of the received GPO and other built-in debug messages. Because the received GPO is newer than the current agent version in this example, your domain configuration will be empty on this client and the agent will not start.
After debugging, keep in your mind to remove these keys, because the size of these logfiles can grow. Creating core dump
I think, our documentation describes it very well, so I've just copied it to here:
In certain rare cases, you might have to create core dumps of the syslog-ng Agent to investigate a particular problem. When enabled, the syslog-ng Agent for Windows application creates core dumps automatically when it experiences an unexpected shutdown. To enable core dumps, set the HKEY_LOCAL_MACHINE/Software/Balabit/syslog-ng Agent/WriteMinidump registry key to 1. Core dumps are written into the installation folder of the syslog-ng Agent under the syslog-ng-agent.dmp filename.
Reporting a problem
Sometimes, you would like to report a problem but you don't know what information is needed to resolve or fix it.
In the first place, we need the debug logs (in any form) and/or the core dump and the version of your agent. To display this version, just execute "syslog-ng Agent.exe -v" command and copy all the output.
Secondly, the exact description of your problem. For example, what the problem is, how to reproduce, which platform is affected. Please, keep in your mind, the more information the best.
Finally, the agent's configuration also can be necessary. If the agent is using xml configuration, just send us the xml configuration file or if it is using domain or local configuration (which is in the registry), you need to export the complete HKEY_LOCAL_MACHINESOFTWAREBalaBitsyslog-ng Agent registry key to a file.
On Wednesday I did a presentation on Balabit Meetup. I talked about a programming language that?s very close to me, it?s called Ruby. You can check the slides of my presentation below, moreover if you wanna try this brilliant language out, check the tryruby.org!
Sometimes you have a binary file but you would like to see the content of this file as far as possible. I suggest using strings command. usage: strings filename for example, to see the strings that are at-least 32 characters long:
I am happy to announce that we have a new colleague in our German Team in Munich. His name is Frank Mild and has more than 18 years of sales and business development experience. Frank helps Dietmar, our other Sales Manager, to support more and more sales activities in the German speaking countries.
Frank and Dietmar have already been working together as colleagues, therefore Frank was not only a good recomendation for us, but I am also sure that they will be a good team for further successes.
Our aim is to have even stronger sales support in DACH and to be able to reach even more potential business partners and customers, to whom our products can be useful.
We have moved forward again. From 2010 we issue CPE certificates about our trainings. if you need that, just indicate on the traning entry-form. The certificate do not contain CPE points, but hours, that helps everybody counting the points. It can be different for every profession. In addition CPE points are maximized if the training is product specific. The certified hours are 6 netto hours a day, therefore we issue 6 hours for SSB, 12 hours for syslog-ng PE and 6 hours for SCB. Fur further info wisit ISACA website.
It was in November 2007 when the initial commit of X Control Box was pushed to our VC server -- the idea was to create a framework based on the current Shell Control Box codebase that can act as a base for all our future appliance-like products. We took the chance to rewrite everything that needed to be rewritten: we added proper widgeting for our interface elements, cleared up the CSS code and the browser-server communication, the search interfaces, the whole permission system and added detailed changelogging for everything that can be changed on the UI. The resulting codebased proved to be usable: it took only a couple of weeks to create the initial pre-alpha version of syslog-ng Store Box, and ever since then we've really benefited from having a well-usable common framework into which 2630 commits have added 300k+ lines of code and templates by now.
The video below shows this progress from the beginning to the current state using the amazing visualization tool Gource. Make sure you click over to YouTube and watch it in high quality, it really worth it!
Since the last post, I could hack a couple of hours on the plugins branch, which now compiles. The plugin framework is capable for supporting a quite important core functionality: all socket like sources/destinations are now found in an external plugin called "afsocket".
The reason I've started with afsocket is to make syslog-ng a bit less dependant on OpenSSL. A couple of distributions didn't include syslog-ng 3.0 in their current releases, because it uses OpenSSL from /usr, while syslog-ng should remain in the root directory.
By separating afsocket from the syslog-ng core, I can compile afsocket with and without TLS support, which can be put into separate packages. Thus syslog-ng can operate without OpenSSL.
And the same plugin framework will enable me to create a wide variety of plugins. My ideas:
Plugins for all syslog-ng components (source, destination, filter, rewrite, parser)
Python scriptability (a simple correllation engine in Python?)
macro transformation functions, for example: $(stripslashes $macro), usable anywhere in templates and stripslashes a plugin that is invoked whenever such an expansion occurs
Hooks for transforming the log message as it enters syslog-ng (to fix parsing errors for example),
Do you have other ideas? Please post them as comments or as emails to the mailing list.
Again, this functionality is experimental, and I'm still going to rebase the current code and will probably be integrated to syslog-ng 3.2. I got to release 3.1 final first though. :)
Things have been a little rough last couple of months, that's why I haven't posted here. I'm in a rush right now as well, but I just wanted to let you know that I have started working on modularizing syslog-ng.
It is only a preliminary prototype, and as of now it doesn't compile, but the way it's going to work is already visible: each plugin will have its own plugin and with some trickery the large syslog-ng.conf parser will call out to the plugin parser. The user will recognize such a plugin as an integral part of syslog-ng.
E.g. this is a sample configuration file:
@version: 3.0 @module: dummy
...
destination d_dummy { dummy(dummy_opt(yes)); };
...
See the dummy plugin code in my git repository, in the "plugins" branch. Please note that that branch is going to be rebased a couple of times yet, I've released it in the spirit of "release early, release often".
I hope to get some of the recent contributions into plugins, instead of bloating the core syslog-ng code. For example output colorization. I'm also thinking about adding built-in scripting support via Python.
I have just found a bug in syslog-ng OSE 3.1beta2. When you use keep_hostname(yes) in the options, then at those sources where this field is empty (e.g. messages arriving on /dev/log), it eliminates the hostname, somehow this way:
It is well known that people and companies can get very innovative if they wish to cut the costs, and it is especially great if this results in a smart solution.
Making a market survey or buying an existing one is not cheap, and getting one for free can be a large benefit for smaller companies.
I felt handicapped from the start that as a small Hungarian company, we haven't had much information about the global market we were aiming at. Purchasing a global market study cost much more than what we could have afforded.
I was hoping that all this will change when we become a bigger company. And now, although we are still not that big, we could afford to buy a study. But there is always something that seems to be more important and promises imminent benefits. I have realized that we will not spend on that sort of thing until its price is higher than the margin of error in our marketing budgets.
But if everything goes well, this will not even be necessary, because our latest initiative offers free market data for everyone.
Communities have always had high priorities for BalaBit: they are part of our philosophy, our strategy and everyday life. We have always been an active member of the open source software community, and our products are based open formats and open standards.
The Open IT Survey 2010 project offers nothing less than a market survey to be filled by community members who are free to use the results. Participants can complete the anonymous questionnaire in a few minutes, and gain access to global marketing data about IT market trends.
The members of the community have the needed knowledge, we should just collect and share it for everyone's benefit. The open-source movement owes its success to the community, and we are positive that communities are important in shaping the future.
The Open IT Survey wishes to collect the last year's results and this year's expectations, focusing on the performance and trends of the IT and IT security fields. The project has been launched only recently; the first results will be available at the beginning of April at the openITsurvey2010.balabit.com site. According to the organizers, the target group is "everyone who is interested in the results."
The project builds its communication heavily on the community; participants can recommend the project to others on the Facebook Community Portal, as well.
We would like the project to become a regular survey, and gradually collect and share more and more information to everyone, therefore we count on the community's feedback and opinion. Comments and ideas are welcome on the Facebook page.
I start a new series on Hungarian sights to inform you about our country. The first post is about the Cave Bath which is the only thermal cave in Europe. Some weeks ago I was there with my girlfriend and it was really impressive.
The Cave Bath is a thermal bath in a natural cave in Miskolctapolca, which is part of the city of Miskolc, Hungary, and is unique in Europe.
The thermal water (temperature: 30°C, 86°F) is reputed to cure pain in the joints, and since it has lower salt content than most thermal waters (around 1000 mg/litre), people can bathe in it for much longer, practically for an unlimited amount of time. The Cave Bath can be visited all year long except for January.
The cave and the thermal spring have been known since ancient times, but Tapolca became a popular bathing place only after the Ottoman occupation of Hungary (16th-17th century). During this time the area belonged to the Greek Orthodox abbey of Görömböly; the development of Tapolca into a bathing place was the idea of the abbot in 1711. He also brought doctors from Kassa, today Koąice, Slovakia to examine the beneficial effects of the water. Three pools and an inn were constructed in 1723. The cave itself was not used yet, as the pools were outside. The water was colder than it is now, because the cold water springs of Tapolca (now playing an important role in providing Miskolc with drinkable water) were used too. By the mid-18th century, after a short period of popularity, the bath was neglected and by the 1800s the buildings were in ruins.
In 1837 the new abbot of Görömböly had the buildings restored and expanded. He also had the first indoor pool (though still outside the cave) built, but only for wealthy guests.
In the early 20th century the growing city Miskolc bought the area from the Greek Orthodox Church not only because of the thermal water but also because of the drinking water source (which now provides half of the city's water supply).
In the following years, new public baths were built. In 1934 Tapolca was officially recognised as a spa town. In 1939 the construction of a new bathing house began. During the construction several archaeological findings were unearthed, and a new, previously unknown water spring was found with a water temperature of 31.5°C. The thermal bath was opened in 1941 but the Cave Bath itself was opened only on 14 May 1959.
Since then the bath complex has been expanded several times. The outdoor pool and the characteristic, seashell-shaped roof before it were built in 1969. In the 1980s new rooms and corridors were built, and warmer pools (34°C and 36°C) were constructed. The newest expansion of the bath complex started in 1998.