Syslog forward
Syslog forward
- kgschlosser
- Site Admin
- Posts: 3595
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Syslog forward
or you can use this plugin to send text messages to your cell phone when specific events take place
viewtopic.php?f=9&t=9660
Re: Syslog forward
I would like to have the entire log, in realtime mirrored to a syslog server where I can keep an backup. Simply as a security protocol.
I was for a bief moment considering writing a python-script to do this but I realized quickly I would end up creating a loop as it would show up in the log.
Any ideas?
I use EventGhost 24/7 and consider it a great tool.
Cheers!
- kgschlosser
- Site Admin
- Posts: 3595
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Syslog forward
I do not know much about the syslog protocol I can take a look tho.
Re: Syslog forward
- kgschlosser
- Site Admin
- Posts: 3595
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Syslog forward
Re: Syslog forward
Because this is a first version, there may/will still be bugs. Currently no error checking is done. I've tested it with a syslogd on my Synology NAS.
Just add the plugin and configure it. As long as the plugin is enabled it will send the log messages to the server.
- Attachments
-
- Log2Syslog_0_0_1.egplugin
- (4.51 KiB) Downloaded 66 times
- kgschlosser
- Site Admin
- Posts: 3595
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Syslog forward
if you look at the code i posted here it will give you a means to identify the different log entries
viewtopic.php?f=10&t=9811
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: Syslog forward
thanks for this new cool plugin!
I tested it on two machines and it is working!
A few notes and one error message I did find though:
Code: Select all
09:16:24 Traceback (most recent call last) (0.5.0-rc4):
09:16:24 File "wx\_core.pyc", line 16766, in <lambda>
09:16:24 File "C:\Program Files (x86)\EventGhost\eg\Classes\Log.py", line 254, in _WriteLine
09:16:24 listener.WriteLine(line, icon, wRef, when, indent)
09:16:24 File "C:\ProgramData\EventGhost\plugins\Log2Syslog\__init__.py", line 193, in WriteLine
09:16:24 MSG += line.encode('utf-8')
09:16:24 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 42: ordinal not in range(128)
One more thing: There is this log redirector plugin which is writing the log to a file. If it is enabled Log2Syslog will not work which is kind of expected.
Maybe the plugins could be combined into one?
- Attachments
-
- mmhtpc.log
- (93.37 KiB) Downloaded 37 times
Re: Syslog forward
Code: Select all
.encode('utf-8')
Code: Select all
MSG += line.encode('utf-8')
Code: Select all
MSG += line
Regarding the other plugin: What are your settings for the other plugin? I've tested it and both together works for me.
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: Syslog forward
Ok, thanks. Did what you said and it is looking good!topix wrote:Please edit the plugin file and in line 192 removefromCode: Select all
.encode('utf-8')
so you have onlyCode: Select all
MSG += line.encode('utf-8')
It looks like the contents of 'line' is already in unicode and i doubled the encoding.Code: Select all
MSG += line
I have set it up like this:topix wrote:Regarding the other plugin: What are your settings for the other plugin? I've tested it and both together works for me.
[cannot upload screenshot atm. Don't know whats wrong]
Second radio button is set to enable standard eg log and the file.
File commit is set to 2 sec.
File is stripped at 2MB to 1MB.
If I log have Log2Syslog before log redirector in the autostart I will get log entries in the syslog server until the log redirector plugin is loaded.
- Luca Brasi
- Experienced User
- Posts: 262
- Joined: Sat Oct 11, 2008 12:39 pm
Re: Syslog forward
I had some strange behavior on my htpc lately. Whenever I used eg to connect my sys to a vpn-server eg stalled and had to be restarted. Even after the start it got stuck from time to time. I noticed that this would only happen if the vpn connection was still active. So I thought about which plugin is using network and Log2Sylog came to my mind and I deactivated it. Eg with Vpn was working again. So it seems that Log2Sylog brings eg to stall whenever the syslog server can't be found.
I can of course set up the vpn in a way that the local syslog server is still accessible but I don't think that's the right way to go. On other systems this might not be acceptable for security reasons and there might be other reasons for not having the syslog server accessible and eg would crash in that case as well.
Would be great if you could take this into account for future development.
Thanks