Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

Allow syslog to use rsyslog new tizezone sensitive timestamps instead of legacy date/time #103

Closed cigamit closed 4 years ago

cigamit commented 4 years ago

Both RSYSLOG and SYSLOG-NG support providing timestamps today using the relative timezone offset so that syslog data can be imported into Cacti using the correct timezone automatically. Allow Cacti to leverage the zone settings when consuming log data.

ddb4github commented 4 years ago

Few diff on top of https://github.com/Cacti/plugin_syslog/commit/62426cdeeaba9b25d24273eb48a86deedf80b9cb Move 'logtime' alter SQL out of 'hash' field checking for upgrading from v2.x that support 'hash' field.

--- setup.php   2019-12-26 15:02:56.123333600 +0800
+++ setup.php   2019-12-26 15:25:02.763281500 +0800
@@ -276,13 +276,13 @@
                                'default'  => '',
                                'after'    => 'id')
                        );
+               }

                        if (db_column_exists('syslog_incoming', 'date')) {
                                db_execute("ALTER TABLE syslog_incoming
                                        DROP COLUMN date,
                                        CHANGE COLUMN `time` logtime timestamp default '0000-00-00';");
                        }
-               }

                $alerts = syslog_db_fetch_assoc('SELECT * FROM syslog_alert WHERE hash IS NULL OR hash = ""');
cigamit commented 4 years ago

Oh, thanks for catching that. Going to re-tag the release.