problems installing syslog plugin

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
rvkoenemann
Posts: 3
Joined: Mon Nov 26, 2018 9:49 am

problems installing syslog plugin

Post by rvkoenemann »

Hi there,

I'm currently migrating the old cacti 0.8.8 environment to a new server on ubuntu 18.04.
I use the syslog plugin from github on version 2.1
Cacti version is 1.1.38
rsyslogd version is 8.32.0

I'm running into problems starting rsyslogd. The errormessage is

Code: Select all

 error during parsing file /etc/rsyslog.d/cacti.conf, on or before line 15: errors occured in file '/etc/rsyslog.d/cacti.conf' around line 15 [v8.32.0 try http://www.rsyslog.com/e/2207 ]

The mentioned line in the config file is the last one of this snippet, i merely omitted some comments and newlines

contents of /etc/rsyslog.d/cacti.conf

Code: Select all

$ModLoad imudp   
$UDPServerRun 514
$ModLoad ommysql
$template cacti_syslog,"INSERT INTO syslog_incoming(facility_id, priority_id, program,date, time, host, message) \
values (%syslogfacility%, %syslogpriority%, '%programname%', '%timereported:::date-mysql%', '%timereported:::date-mysql%', '%HOSTNAME%', TRIM('%msg%'))", SQL 
# all > server, table, user, password; template
*.*>localhost,syslog,cacti,password;cacti_syslog
does anybody have an idea on why this doesn't work? what is wrong with that line?

contents of config.php

Code: Select all

        $syslogdb_type     = 'mysql';
$syslogdb_default  = 'syslog';
$syslogdb_hostname = 'localhost';
$syslogdb_username = 'cacti';
$syslogdb_password = 'password';
$syslogdb_port     = 3306;
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: problems installing syslog plugin

Post by netniV »

I'm pretty sure that has been answered either on these forums or on the plugin_syslog GitHub issues section.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
rvkoenemann
Posts: 3
Joined: Mon Nov 26, 2018 9:49 am

Re: problems installing syslog plugin

Post by rvkoenemann »

Well, there's this guy, who mentions a similar problem.
viewtopic.php?f=14&t=59315&sid=770e4331 ... acf9717aa0
The suggested solution, changing localhost to 127.0.0.1, doesn't help in my case. Maybe i should have mentioned that i already tried. My bad.

On the Github Issue tracker, there is no issue whawtsoever with the same kind of problem.

So please, kindly, answer the question, since you seem to know the answer.
Thank you.


EDIT: added link
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: problems installing syslog plugin

Post by netniV »

Actually I don't. I just recall reading it somewhere. If that answer was not what you were after, or did not work for you, then I could be equally rude and say search harder.

Instead, all I will say is that I don't personally use that plugin, but I have tried to help people out and this post may help you:
https://github.com/Cacti/plugin_syslog/ ... -415304630

Alex suggested a config that worked for him. Whether that will work for you, I know not.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
rvkoenemann
Posts: 3
Joined: Mon Nov 26, 2018 9:49 am

Re: problems installing syslog plugin

Post by rvkoenemann »

Hello NetniV, thank you for pointing me to that issue.

However, that config didn't work for me and i went and configured it myself in a way that works.

I'll post the config below, in case somebody else has a similar problem.

Code: Select all

 $ModLoad imudp
 $UDPServerRun 514
 module (load="ommysql")
 template(name="cacti_syslog" type="list" option.sql="on") {
         constant(value="INSERT INTO syslog_incoming(facility_id, priority_id, program, date, time, host, message)")
                 constant(value="values ('")
                 property(name="syslogfacility")
                 constant(value="' , '")
                 property(name="syslogpriority")
                 constant(value="' , '")
                 property(name="programname")
                 constant(value="' , '")
                 property(name="timereported" dateFormat="mysql")
                 constant(value="' , '")
                 property(name="timereported" dateFormat="mysql")
                 constant(value="' , '")
                 property(name="hostname")
                 constant(value="' , '")
                 property(name="msg")
                 constant(value="')")
                 }
 *.* action(type="ommysql" server="127.0.0.1" serverport="3306" db="syslog" uid="syslog" pwd="password" template="cacti_syslog")
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: problems installing syslog plugin

Post by netniV »

Looks good. One of these days I may actually get around to trying this out. Just need a large block of time to wade for proper testing / implementation as no doubt something will peak my attention with looking out of place.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests