I am new cacti user, I want to separate syslog to another server, I setup 2 VMs with Ubuntu 14.04, VM1(192.168.10.1) is cacti server, VM2(192.168.10.2) is central log server. in the Vm1 the /etc/rsyslog.conf is:
Code: Select all
$ModLoad ommysql
$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
*.* >192.168.10.2,Syslog,cacti,!QA2ws3ed;cacti_syslog
*.* >192.168.10.2
Code: Select all
global $config, $database_type, $database_default, $database_hostname;
global $database_username, $database_password, $database_port;
/* revert if you dont use the Cacti database */
$use_cacti_db = false;
if (!$use_cacti_db) {
$syslogdb_type = 'mysql';
$syslogdb_default = 'Syslog';
$syslogdb_hostname = 'localhost';
$syslogdb_username = 'cacti';
$syslogdb_password = '!QA2ws3ed';
$syslogdb_port = 3306;
in the VM2, I configured /etc/rsyslog.conf
Code: Select all
$ModLoad ommysql
$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,cacti,!QA2ws3ed;cacti_syslog
# Load modules
module(load=imtcp) # For TCP input support
module(load=ommysql) # For MySQL output support
#### RULES ####
# Create a ruleset
ruleset(name=.rsRemoteTCP.) {
*.* action(
type=ommysql
server=localhost
serverport=4403
db=Syslog
uid=cacti
pwd=!QA2ws3ed
)
}
# Bind the ruleset to tcp input
input(
type=imtcp
port=514
ruleset=rsRemoteTCP
)
BR//LP