Syslog-Plugin not processing messages

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
Talon_Karrde
Posts: 28
Joined: Mon Sep 17, 2007 4:41 am
Location: Kamp-Lintfort, Germany

Syslog-Plugin not processing messages

Post by Talon_Karrde »

Hello,

I have Cacti 1.2.10 with syslog-plugin 2.9 on Ubuntu 18.04.
In mysql I can see syslog messages arriving the syslog_incoming table. But nothing is moved to syslog_logs and so I cant see anything in syslog-tab.
I have some log entries which maybe indicate some malfunctioning.

Thanks in advance.

Code: Select all

2020/04/01 13:48:30 - SYSTEM SYSLOG STATS: Time:0.02 Deletes:0 Incoming: Removes:0 XFers:0 Alerts:0 Alarms:0 Reports:0
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[510]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[503]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[261]:syslog_remove_items(), /plugins/syslog/functions.php[234]:syslog_db_fetch_cell(), /plugins/syslog/database.php[77]:db_fetch_cell(), /lib/database.php[383]:db_fetch_cell_prepared(), /lib/database.php[399]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[236]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[228]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[221]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[187]:db_fetch_cell(), /lib/database.php[383]:db_fetch_cell_prepared(), /lib/database.php[399]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'seq' in 'field list'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[180]:syslog_db_execute(), /plugins/syslog/database.php[57]:db_execute(), /lib/database.php[210]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'status' in 'where clause'
2020/04/01 13:48:30 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[169]:syslog_db_fetch_cell(), /plugins/syslog/database.php[77]:db_fetch_cell(), /lib/database.php[383]:db_fetch_cell_prepared(), /lib/database.php[399]:db_execute_prepared())
2020/04/01 13:48:30 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'status' in 'where clause'
There is more happiness in giving than there is in receiving.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Syslog-Plugin not processing messages

Post by TheWitness »

Looks like your upgrade missed some tables. You can try this:

DROP TABLE syslog_incoming;
CREATE TABLE `syslog_incoming` (
`facility_id` int(10) unsigned DEFAULT NULL,
`priority_id` int(10) unsigned DEFAULT NULL,
`program` varchar(40) DEFAULT NULL,
`logtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`host` varchar(64) DEFAULT NULL,
`message` varchar(1024) NOT NULL DEFAULT '',
`seq` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`status` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`seq`),
KEY `program` (`program`),
KEY `status` (`status`)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
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?
User avatar
Talon_Karrde
Posts: 28
Joined: Mon Sep 17, 2007 4:41 am
Location: Kamp-Lintfort, Germany

Re: Syslog-Plugin not processing messages

Post by Talon_Karrde »

Thanks for your reply.
This was no upgrade. I completely removed old syslog plugin and did a new install.

I dropped the table as you mentioned, but I can't create a new because of:
ERROR 1067 (42000): Invalid default value for 'logtime'

I changed it to: `logtime` timestamp NOT NULL DEFAULT '1970-01-01 19:00:01',
and table creation worked.

That solved the log processing - Thank you very much!

But I still have lots of log errors:

Code: Select all

2020/04/01 14:28:06 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/syslog/syslog.php[101]:syslog_messages(), /plugins/syslog/syslog.php[1638]:syslog_row_color(), /plugins/syslog/functions.php[569]:CactiErrorHandler())
2020/04/01 14:28:06 - ERROR PHP NOTICE in Plugin 'syslog': Undefined variable: class in file: /data/cacti-1.2.10/plugins/syslog/functions.php on line: 569
2020/04/01 14:28:06 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/syslog/syslog.php[101]:syslog_messages(), /plugins/syslog/syslog.php[1638]:syslog_row_color(), /plugins/syslog/functions.php[569]:CactiErrorHandler())
2020/04/01 14:28:06 - ERROR PHP NOTICE in Plugin 'syslog': Undefined variable: class in file: /data/cacti-1.2.10/plugins/syslog/functions.php on line: 569
2020/04/01 14:28:06 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/syslog/syslog.php[101]:syslog_messages(), /plugins/syslog/syslog.php[1638]:syslog_row_color(), /plugins/syslog/functions.php[569]:CactiErrorHandler())
2020/04/01 14:28:06 - ERROR PHP NOTICE in Plugin 'syslog': Undefined variable: class in file: /data/cacti-1.2.10/plugins/syslog/functions.php on line: 569
2020/04/01 14:28:06 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/syslog/syslog.php[101]:syslog_messages(), /plugins/syslog/syslog.php[1638]:syslog_row_color(), /plugins/syslog/functions.php[569]:CactiErrorHandler())
2020/04/01 14:28:06 - ERROR PHP NOTICE in Plugin 'syslog': Undefined variable: class in file: /data/cacti-1.2.10/plugins/syslog/functions.php on line: 569
2020/04/01 14:28:06 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/syslog/syslog.php[101]:syslog_messages(), /plugins/syslog/syslog.php[1638]:syslog_row_color(), /plugins/syslog/functions.php[569]:CactiErrorHandler())
2020/04/01 14:28:06 - ERROR PHP NOTICE in Plugin 'syslog': Undefined variable: class in file: /data/cacti-1.2.10/plugins/syslog/functions.php on line: 569
There is more happiness in giving than there is in receiving.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Syslog-Plugin not processing messages

Post by TheWitness »

What mysql version? Is this the same database as Cacti? Looks like your are getting a log class that is not known to normal syslog, or you have some issues with your template.
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?
rJIaB
Posts: 2
Joined: Tue Apr 21, 2020 7:59 am

Re: Syslog-Plugin not processing messages

Post by rJIaB »

Similar situation. Fresh installation of Cacti, fresh installation of syslog plugin
#service rsyslog status
● rsyslog.service - System Logging Service
Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-04-21 15:52:39 MSK; 1min 18s ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Main PID: 5282 (rsyslogd)
Tasks: 5 (limit: 4660)
CGroup: /system.slice/rsyslog.service
└─5282 /usr/sbin/rsyslogd -n

Apr 21 15:53:23 cacti rsyslogd[5282]: ommysql: db error (1054): Unknown column 'date' in 'field list' [v8.32.0]
Apr 21 15:53:23 cacti rsyslogd[5282]: The error statement was: INSERT INTO syslog_incoming(facility_id, priority_id, program, date, time, host, message) values (5, 3, 'rsyslogd', '20200421155323', '20200421155323', 'cacti', TRIM(' The e
Apr 21 15:53:23 cacti rsyslogd[5282]: action 'action 8' (module 'ommysql') message lost, could not be processed. Check for additional error messages before this one. [v8.32.0 try http://www.rsyslog.com/e/2218 ]
Apr 21 15:53:23 cacti rsyslogd[5282]: ommysql: db error (1054): Unknown column 'date' in 'field list' [v8.32.0]
Apr 21 15:53:23 cacti rsyslogd[5282]: The error statement was: INSERT INTO syslog_incoming(facility_id, priority_id, program, date, time, host, message) values (5, 3, 'rsyslogd', '20200421155323', '20200421155323', 'cacti', TRIM(' actio
Apr 21 15:53:23 cacti rsyslogd[5282]: action 'action 8' (module 'ommysql') message lost, could not be processed. Check for additional error messages before this one. [v8.32.0 try http://www.rsyslog.com/e/2218 ]
Apr 21 15:53:23 cacti rsyslogd[5282]: ommysql: db error (1054): Unknown column 'date' in 'field list' [v8.32.0]
Apr 21 15:53:23 cacti rsyslogd[5282]: The error statement was: INSERT INTO syslog_incoming(facility_id, priority_id, program, date, time, host, message) values (5, 3, 'rsyslogd', '20200421155323', '20200421155323', 'cacti', TRIM(' ommys
Apr 21 15:53:23 cacti rsyslogd[5282]: action 'action 8' (module 'ommysql') message lost, could not be processed. Check for additional error messages before this one. [v8.32.0 try http://www.rsyslog.com/e/2218 ]
Apr 21 15:53:23 cacti rsyslogd[5282]: ommysql: db error (1054): Unknown column 'date' in 'field list' [v8.32.0]

Looks like a cacti database was not prepared for syslog
Syslog tables are created automatically when you create the cacti database, or do they need to be specially created somehow?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Syslog-Plugin not processing messages

Post by TheWitness »

No, if you are using the latest syslog, you did not read the updated installation instructions. You need to modify your /etc/rsyslog.d/cacti.conf template for the latest syslog.
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 0 guests