Cacti: No syslog messages

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.

Load the output module, you need to have rsyslog-mysql installed. Verify if you have by doing find / -name, the default path should be /usr/lib/rsyslog/

*.*     :ommysql:,syslog,cactiuser,password

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;
        $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;

Import the sql tables, login as root:

use syslog;
source /var/www/plugins/syslog/syslog.sql;

2 thoughts on “Cacti: No syslog messages

  1. 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

  2. This worked for me:
    in /etc/rsyslog.conf

    commented this
    #*.* :ommysql:,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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s