Syslog plugin issue.

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
trungmv
Cacti User
Posts: 87
Joined: Wed Feb 15, 2012 10:32 pm

Syslog plugin issue.

Post by trungmv »

Hi all,

I am using Rsyslog and Cacti on the same server with Centos5.9
Cacti Version 0.8.8a
SNMP Version NET-SNMP version: 5.3.2.2
RRDTool Version RRDTool 1.4.x
PHP Version 5.3.23
Apache Version Apache/2.2.3 (CentOS).
Database: Mysql Server version: 5.5.30-cll

Code: Select all

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| Syslog             |
| cacti              |
| mysql              |
| performance_schema |
| test               |
+--------------------+
6 rows in set (0.00 sec)

All steps to enable syslog plugin are fine as below but not gethering log event from Rsyslog:
Image
Plugin management:
Image
On phpmyadmin:
Image

Edit plugin/syslog/config.php:

Code: Select all

/* revert if you dont use the Cacti database */
$use_cacti_db = false;

if (!$use_cacti_db) {
        $syslogdb_type     = 'mysql';
        $syslogdb_default  = 'cacti';
        $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;
At Rsyslog side:
Edit /etc/rsyslog.conf

Code: Select all

$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
*.*             >localhost,syslog,cactiuser,password;cacti_syslog

# Store all log files in MySQL DB  :
*.*       :ommysql:127.0.0.1,Syslog,rsyslog,password0
I also used:

Code: Select all

mysql> source /usr/share/cacti/site/plugins/syslog/syslog.sql;
to import sql from syslog plugin and result:
Image
Each time when i restart rsyslog, i always received the error from rsyslog:
Image
But syslog plugin still empty.
If i change:

Code: Select all

$use_cacti_db = false;

if (!$use_cacti_db) {
        $syslogdb_type     = 'mysql';
        $syslogdb_default  = 'cacti';
        $syslogdb_hostname = 'localhost';
        $syslogdb_username = 'cactiuser';
        $syslogdb_password = 'password';
        $syslogdb_port     = 3306;
to

Code: Select all

$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;
The Cacti can not access:
Image
What and where the step i am wrong?
Any help is appreciated,

Best regards,
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest