Error with syslog, when recodring on a DB

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Error with syslog, when recodring on a DB

Post by Rno »

Hello,
I have some error using the ommysql to record my syslog message to a DB.
It actually work fine, but I some how I have a INSERT who go with the wrong table name, and I didn't find this call inside any syslog plugin function.

this is the error:

Code: Select all

Nov 30 09:19:00 lslcacp02 rsyslogd: ommysql: db error (1146): Table 'syslog.SystemEvents' doesn't exist  [v8.2208.0]
Nov 30 09:19:00 lslcacp02 rsyslogd: The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (\' The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (\\\' (to root) a_soi_0454 on pts/2\\\', 4, \\\'lslcacp02\\\', 5, \\\'20231130091900\\\', \\\'20231130091900\\\', 1, \\\'su:\\\') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]\', 5, \'lslcacp02\', 3, \'20231130091900\', \'20231130091900\', 1, \'rsyslogd:\') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]', 5, 'lslcacp02', 3, '20231130091900', '20231130091900', 1, 'rsyslogd:') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]
Nov 30 09:19:00 lslcacp02 rsyslogd: action 'action-0-ommysql' (module 'ommysql') message lost, could not be processed. Check for additional error messages before this one. [v8.2208.0 try https://www.rsyslog.com/e/2218 ]
Any one can help to trace where it come from ?

here is my settings for rsyslog daemon:

Code: Select all

module(load="ommysql")
action(type="ommysql" server="server" serverport="3306"
       db="database" uid="username" pwd="password")

$template cacti_syslog,"INSERT INTO syslog_incoming(facility_id, priority_id, program, logtime, host, message) \
  values (%syslogfacility%, %syslogpriority%, '%programname%', '%timegenerated:::date-mysql%', '%HOSTNAME%', TRIM('%msg%'))", SQL

local7.*             >server,database,username,password;cacti_syslog
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: Error with syslog, when recodring on a DB

Post by Rno »

Damn find it!
This line is the one causing the issue:

Code: Select all

action(type="ommysql" server="server" serverport="3306"
       db="database" uid="username" pwd="password")
So without it, it's all good
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Error with syslog, when recodring on a DB

Post by TheWitness »

Figured you would get there.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests