Linux

cacti syslog plugin install

Naan 2019. 8. 29. 18:09
320x100

https://docs.cacti.net/plugin:syslog.config

 

 

plugin:syslog.config - Cacti Docs

Prior to configuring your syslog server, you must first choose whether you are going to use the Cacti database, or you are going to use a external database. This section covers the configuration of your central logger to log its messages to the database. E

docs.cacti.net

----------- server -----------

 

위 사이트에서 plugin 다운

 

압축 풀고

# tar -xvf syslog-v1.22-2.tar

# mv syslog /usr/share/cacti/plugin/

# cd /usr/share/cacti/plugin/syslog/template

cp cacti_graph_template_localhost_syslog_messages.xml /usr/share/cacti/resource/snmp_queries/

 

 

mysql DB 생성

create database syslog character set utf8;
grant all on syslog.* to cactiuser@localhost identified by "cactiuser";
flush privileges;

# mysql -u root -p -A syslog < /usr/share/cacti/plugin/syslog/syslog.sql  <- 아까 plugin 압축푼 폴더에 있음

db 설정 정보 입력

# vi /usr/share/cacti/plugins/syslog/config.php

/* 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 = 'cactiuser';
        $syslogdb_password = 'cactiuser';
        $syslogdb_port     = 3306;

rsyslog 설정

# vi /etc/rsyslog.conf

$ModLoad imtcp
$InputTCPServerRun 514

$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,cactiuser,cactiuser;cacti_syslog

 

 

# service rsyslog restart

# service httpd restart

 

----------- client -----------
# yum install rsyslog -y
# vi /etc/rsyslog.conf

*.*     @IP:514

 

# service rsyslog restart

 

하면 서버에 위에 syslog 가 뜨고 들어가보면 client 들이 보일것 이다 

만약에 안보인다면 동기화 시간을 1분으로 변경 해서 기다려보자

만약 문제가 있다면 /var/log/messages 로그 확인

320x100

'Linux' 카테고리의 다른 글

google-authenticator ssh otp 적용[google otp]  (0) 2019.09.05
mount: wrong fs type, bad option, bad superblock on /data  (0) 2019.09.03
sendmail from to  (0) 2019.08.06
apache 로그 예외 처리  (0) 2019.08.02
roundcube install for centos  (0) 2019.07.18