Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsyslog with syslog #223

Open
rtty88 opened this issue Jan 23, 2024 · 5 comments
Open

rsyslog with syslog #223

rtty88 opened this issue Jan 23, 2024 · 5 comments
Labels

Comments

@rtty88
Copy link

rtty88 commented Jan 23, 2024

image

I get this Error evey time I follow the artical to install the plugin for syslog

Edit /etc/rsyslog.d/cacti.conf

$ModLoad imudp
$UDPServerRun 514
$ModLoad ommysql

$template cacti_syslog,"INSERT INTO syslog_incoming(facility_id, priority_id, program, logtime, host, message)
values (%syslogfacility%, %syslogpriority%, '%programname%', '%timegenerated:::date-mysql%', '%HOSTNAME%', TRIM('%msg%'))", SQL

. >localhost,my_database,my_user,my_password;cacti_syslog

any solution for that
my version is 1.2.26

@arno-st
Copy link
Contributor

arno-st commented Jan 23, 2024

I have this config without error:

# Provides UDP syslog reception
# for parameters see http://www.rsyslog.com/doc/imudp.html
module(load="imudp") # needs to be done just once
input(type="imudp" port="5544")

module(load="ommysql")

$template cacti_syslog,"INSERT INTO syslog_incoming(facility_id, priority_id, program, logtime, host, message) \
  values (%syslogfacility%, %syslogpriority%, '%programname%', '%timegenerated:::date-mysql%', '%HOSTNAME%', TRIM('%m
sg%'))", SQL

# I'm using local6 a facility to filter with other syslog agent, if don't need it just remove the IF statement.
if $syslogfacility-text == 'local6' then {
# you have to adapt the server IP, and server port for your design
        action(type="ommysql" server="127.0.0.1" serverport="6033" db="syslog_test" uid="USERID" pwd="PASSWORD"
 Template="cacti_syslog" )
        *.* stop
}

I also have some trouble with the old fashion way to write the rule into syslog config file.

@rtty88
Copy link
Author

rtty88 commented Jan 26, 2024

if needed it here is a complete install cacti syslog ova file _ just remove () drive.google(.)com/file/d/12zf5zJkYj78ruEmfUlIIaSQx0XJXjoj8/view?usp=sharing

@TheWitness
Copy link
Member

So, this is resolved then?

@rtty88
Copy link
Author

rtty88 commented Jan 28, 2024

so far yes but am still not able to see the source Hostname in syslog logs , it showing only the IP address

@bmfmancini
Copy link
Member

@rtty88 some devices only report into syslog with IP address and not the hostname
if the Device only reports with the IP and there is no DNS record you will only see the IP in syslog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants