Rsyslogd Template modification to insert in database

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
bpablo
Posts: 6
Joined: Tue Feb 15, 2011 8:47 am
Location: Buenos Aires, Argentina

Rsyslogd Template modification to insert in database

Post by bpablo »

Hello!

I dont know if anybody has this issue. I've seen that my registers are being inserted in the database with the priority field as "1" "2", etc, and not with the names of the table "syslog_priorities".

I've searched for this in the browser, but i have not found anything, so I do this post.

The cause appears to be an error on the installation doc, that says:

$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
*.* >{mysql_server},{db_name},{db_users},{db_pass};cacti_syslog


I've replaced this with 'syslogpriority-text' (don't forget the ' '), and now i'm getting the correct pri on the tables.

Now, i have a trouble with the background color of the events.

Thanks! :lol:
k8k
Posts: 1
Joined: Thu Aug 02, 2012 5:07 am

Re: Rsyslogd Template modification to insert in database

Post by k8k »

bpablo wrote:Hello!

I dont know if anybody has this issue. I've seen that my registers are being inserted in the database with the priority field as "1" "2", etc, and not with the names of the table "syslog_priorities".

I've searched for this in the browser, but i have not found anything, so I do this post.

The cause appears to be an error on the installation doc, that says:

$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
*.* >{mysql_server},{db_name},{db_users},{db_pass};cacti_syslog


I've replaced this with 'syslogpriority-text' (don't forget the ' '), and now i'm getting the correct pri on the tables.

Now, i have a trouble with the background color of the events.

Thanks! :lol:
Totally agree with you.
I had the same issue but in addition I changed the syslogfacility to text.
However, I don't have any issue with colors now.
In my case it was necessary to use fromhost-ip while I added the syslogtag.

$template cacti_syslog,"INSERT INTO syslog_incoming(facility, priority, date, time, host, message) values ('%syslogfacility-text%', '%syslogpriority-text%', '%timereported:::date-mysql%', '%timereported:::date-mysql%', '%fromhost-ip%', '%syslogtag% %msg%')", SQL
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests