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.

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;
Advertisements
This entry was posted in Network Maintenance and tagged , , . Bookmark the permalink.

2 Responses to Cacti: No syslog messages

  1. titi piratu says:

    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. tiy says:

    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

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s