Syslog plugin errors on latest cacti release (0.8.8f).

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
tbone
Posts: 5
Joined: Wed Oct 28, 2009 1:25 pm
Location: Bucharest / ROmania
Contact:

Syslog plugin errors on latest cacti release (0.8.8f).

Post by tbone »

Hello there,

I've seem to hit some syslog plugin errors while performing a fresh install of the latest cacti release (0.8.8f) on a CentOS 6.

I'm running cacti on the following environment:
- CentOS 6.7
- Apache 2.2.15
- MariaDB 5.5.47
- PHP 5.4.45 ( 5.4 for compatibility with old plugins)

The cacti install went pretty smooth, so I've started installing the plugins I felt attracted to, and ended up with the following so far:
- Aggregate 0.75
- Monitor 1.3
- Errorimage 0.2
- Settings 0.71
- Loginmod 1.0
- Syslog 1.22

The plugins were grabbed from docs.cacti.net and not the git repositories.

When installing the syslog plugin from the plugin management section, my webserver reports the following error:

Code: Select all

[<obfuscated> 2016] [error] [client <obfuscated>] PHP Notice:  Undefined variable: mysqlVersion in <obfuscated>/plugins/syslog/setup.php on line 579, referer: http://<obfuscated>/plugins.php?mode=install&id=syslog
Although it installed and enabled successfully, I thought it was worth mentioning.

Moving along, everything seems to be in order, syslog is running with syslog-ng, the database gets populated by devices, ok so far.

The problem is, when I try to to create alerts, for example. Whenever I add an alert, everything comes up wrapped in single-quotes, and epoch time set to 0:
different_database_as_cacti
different_database_as_cacti
different_database.PNG (43.12 KiB) Viewed 3646 times
...and the following message pops up in my webserver's error log:

Code: Select all

[<obfuscated> 2016] [error] [client <obfuscated>] PHP Notice:  Undefined index: 'messagec' in <obfuscated>/plugins/syslog/syslog_alerts.php on line 738, referer: http://<obfuscated>/plugins/syslog/syslog_alerts.php?action=edit
However, I discovered that if I attempt to use the same database for cacti and syslog (use $use_cacti_db = true; in plugins/syslog/config.php), it seems to work, and no error message pops up:
same_database_as_cacti
same_database_as_cacti
same_database.PNG (43.44 KiB) Viewed 3646 times
Anyone have any clue why this happens ?

I've also tried to clone the latest syslog plugin from git, but whenever I try to install it, in 0.8.8f the webserver reports:

Code: Select all

[<obfuscated> 2016] [error] [client <obfuscated>] PHP Fatal error:  Call to undefined function top_header() in <obfuscated>/plugins/syslog/syslog_alerts.php on line 52, referer: http://<obfuscated>/plugins.php
I'm assuming it's being updated for the beta of cacti-1.0.0 also available on git.

Thank you!

-tbone

Later edit:
Turning on the cacti logger to debug yields what's going on:

Code: Select all

<obfuscated> PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO `syslog`.`syslog` (logtime, priority_id, facility_id, host_id, message) SELECT TIMESTAMP(`date`, `time`), priority_id, facility_id, host_id, message FROM (SELECT date, time, priority_id, facility_id, host_id, message FROM syslog_incoming AS si INNER JOIN syslog_facilities AS sf ON sf.facility=si.facility INNER JOIN syslog_priorities AS sp ON sp.priority=si.priority INNER JOIN syslog_hosts AS sh ON sh.host=si.host WHERE status=44) AS merge'
<obfuscated> PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM `syslog`.`syslog_removed` WHERE logtime < '2015-01-08''
<obfuscated> PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM `syslog`.`syslog` WHERE logtime < '2015-01-08''
<obfuscated> PM - CMDPHP: Poller[0] ERROR: SQL Row Failed!, Error:'1146', SQL:"SHOW CREATE TABLE `syslog`.`syslog`" 
It seems that the "syslog" table didn't get created in the "syslog" database, although there wasn't any problem being created automatically in the "cacti" database. Perhaps because of the mysqlVersion error ?

Even later edit:
Fixed the missing table, but getting the same behavior without any errors in the webserver or cacti logs. Uninstalling / Reinstalling plugin hasn't helped, truncating tables and choosing normal or partitioned table didn't help either.

Will continue using the same table as cacti, but I'm curious if anyone can find the reason for this behavior.

Cheers,
-tbone
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests