Cacti / plugin_syslog

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

CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'date' in 'field list' #118

Closed stevemorgan83 closed 4 years ago

stevemorgan83 commented 4 years ago

os - centos 8 x86_64 cacti - 1.2.9 php - 7.2.11 mariadb-server - 10.3.17

CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'date' in 'field list' CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[469]:syslog_db_execute(), /plugins/syslog/database.php[52]:db_execute(), /lib/database.php[210]:db_execute_prepared())

These are my syslog_incoming table columns:

+-------------+-------------+---------+---------------------+--------+-----------------------------------------------------------------+------+--------+ | facility_id | priority_id | program | logtime | host | message | seq | status | +-------------+-------------+---------+---------------------+--------+-----------------------------------------------------------------+------+--------+ | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | user-runtime-dir@48.service: Unit not needed anymore. Stopping. | 2704 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopping User Manager for UID 48... | 2705 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped target Default. | 2706 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped target Basic System. | 2707 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped target Paths. | 2708 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped target Sockets. | 2709 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Closed D-Bus User Message Bus Socket. | 2710 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Reached target Shutdown. | 2711 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Starting Exit the Session... | 2712 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped target Timers. | 2713 | 0 | | 10 | 6 | systemd | 2020-03-10 11:50:02 | syslog | pam_unix(systemd-user:session): session closed for user apache | 2714 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | user-runtime-dir@48.service: Unit not needed anymore. Stopping. | 2715 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped User Manager for UID 48. | 2716 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | user-runtime-dir@48.service: Unit not needed anymore. Stopping. | 2717 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Removed slice User Slice of UID 48. | 2718 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopping /run/user/48 mount wrapper... | 2719 | 0 | | 3 | 6 | systemd | 2020-03-10 11:50:02 | syslog | Stopped /run/user/48 mount wrapper. | 2720 | 0 | +-------------+-------------+---------+---------------------+--------+-----------------------------------------------------------------+------+--------+

I'm using cacti's database and the default syslog config:

/* field in the incomming table */ $syslog_incoming_config['timeField'] = 'logtime'; $syslog_incoming_config['priorityField'] = 'priority_id'; $syslog_incoming_config['facilityField'] = 'facility_id'; $syslog_incoming_config['hostField'] = 'host_id'; $syslog_incoming_config['textField'] = 'message'; $syslog_incoming_config['id'] = 'seq';

Any ideas?

TheWitness commented 4 years ago

Update to the latest develop branch. Issue will be resolved.

TheWitness commented 4 years ago

Closing as duplicate.

stevemorgan83 commented 4 years ago

I updated the the latest development by using:

git clone --branch develop

I reinstalled the plugin into a fresh database I had to update to cacti 1.2.10 after that. Once I did this I was able to install the plugin but I'm getting the error:

CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'date' in 'field list' CMDPHP SQL Backtrace: (/plugins/syslog/syslog_process.php[469]:syslog_db_execute(), /plugins/syslog/database.php[52]:db_execute(), /lib/database.php[210]:db_execute_prepared())

TheWitness commented 4 years ago

@stevemorgan83, you must have an out of date syslog still cause that line number does not line up with the latest develop.