I am using rsyslogd and I have not been able to get any messages in my cacti syslog plugin. I checked the contents in /var/log/syslog
there were messages stored inside.
rsyslog.conf
Load the output module, you need to have rsyslog-mysql
installed. Verify if you have ommysql.so
by doing find / -name ommysql.so
, the default path should be /usr/lib/rsyslog/ommysql.so
$ModLoad ommysql.so *.* :ommysql:127.0.0.1,syslog,cactiuser,password
config.php
Next you need to modify the how the plugin can read from mysql.
I install my cacti syslog plugin to /var/www/plugins/syslog
, open the config.php
$use_cacti_db = false; if (!$use_cacti_db) { $syslogdb_type = 'mysql'; $syslogdb_default = 'syslog'; $syslogdb_hostname = 'localhost'; $syslogdb_username = 'cactiuser'; $syslogdb_password = 'password'; $syslogdb_port = 3306; }else{ $syslogdb_type = $database_type; $syslogdb_default = $database_default; $syslogdb_hostname = $database_hostname; $syslogdb_username = $database_username; $syslogdb_password = $database_password; $syslogdb_port = $database_port; }
You need to create database for syslogging as well.
Login to the mysql database with root account
mysql -u root -p
Create database named syslog
create database syslog; grant all on syslog.* to 'cactiuser'@'localhost' identified by 'password'; flush privileges; quit;
Import the sql tables, login as root:
use syslog; source /var/www/plugins/syslog/syslog.sql; quit;
i don’t see how this is solved. i did the exact same verifs and I still get no info in the Cacti Syslog plugin
This worked for me:
in /etc/rsyslog.conf
commented this
#*.* :ommysql:127.0.0.1,syslog,cactiuser,password
added this
$template cacti_syslog,”INSERT INTO syslog_incoming(facility, priority, date, time, host, message) values (%syslogfacility%, %syslogpriority%, ‘%timereported:::date-mysql%’, ‘%timereported:::date-mysql%’, ‘%HOSTNAME%’, ‘%msg%’)”, SQL
*.* >{mysql_server},{db_name},{db_users},{db_pass};cacti_syslog
replace db_name and db_pass as per your setup