接入配置
配置文件
$MATRIXROOT/conf/toe/toe.toml
配置示例
[toe]
base_dir = "/opt/matrix/var/cache/toe"
log_file = "/opt/matrix/var/logs/toe/log.log"
pid_file = "/opt/matrix/sysinfo/toe.pid"
max_message_size = 65536 # default 64KB
servers = ["nats://user:user@192.168.31.201:4222"]
[PayloadEncoder]
append_newlines = false
[split_n]
type = "TokenSplitter"
[OmniEncoder]
# *job
[JobInput]
type = "JobInput"
[JobOutput]
type = "JobOutput"
encoding = "gbk"
#master = "matrix"
message_matcher = "Logger == 'JobInput'"
encoder = "PayloadEncoder"
# *snmp
#[SnmpInput]
#domain = "default"
#type = "SnmpInput"
#poolsize = 2000
# *icmp
#[IcmpInput]
#domain = "default"
#type = "IcmpInput"
#poolsize = 100
# *rping
#[RpingInput]
#domain = "default"
#type = "RpingInput"
#poolsize = 100
# File csv | json monitoring
# [DemoDataInput]
# type = "LogstreamerInput"
# log_directory = "/opt/tools/data"
# file_match = '(?P<FileName>[^/]+).csv'
# splitter = "split_n"
# differentiator = ["FileName"]
# priority = ["FileName"]
#
# [DemoDataOutput]
# type = "NatsOutput"
# is_streaming = true
# subject = "MATRIX-RULES-DEMO.toe"
# reconnect = true
# message_matcher = "Logger == 'DemoDataInput'"
# encoder = "PayloadEncoder"
# use_protocol = true
# Icmpd
# [IcmpdInput]
# type = "ProcessInput"
# splitter = "split_n"
# stdout = true
# stderr = true
# is_daemon = true
#
# [IcmpdInput.command.0]
# bin = "./icmpd"
# directory = "/opt/matrix/agent/daemon"
# env = ["ETCDPATH_C1=192.168.190.175:2379", "ETCDPATH_C2=192.168.190.175:2379"]
# args = ["--etcd", "/matrix/apps/collector/icmpd/config.json", "--name", "icmpd_matrix", "--debug", "--etcd-source-env", "ETCDPATH_C1,ETCDPATH_C2"]]
#
# [IcmpdOutput]
# type = "LogOutput"
# use_global_logger = true
# console = false
# server_log_name = "icmpd_matrix"
# server_log_type = "daemon"
# server_log_keyspace = "matrix"
# message_matcher = "Logger == 'IcmpdInput'"
# encoder = "PayloadEncoder"
# Snmpd
# [SnmpdInput]
# type = "ProcessInput"
# splitter = "split_n"
# stdout = true
# stderr = true
# is_daemon = true
#
# [SnmpdInput.command.0]
# bin = "./snmpd"
# directory = "/opt/matrix/agent/daemon"
# 支持多中心多活
# env = ["ETCDPATH_C1=192.168.190.175:2379", "ETCDPATH_C2=192.168.190.175:2379"]
#args = ["--etcd", "/matrix/apps/snmpd/config_default.json", "--name", "snmpd_test", "--debug", "--etcd-source-env", "ETCDPATH_C1,ETCDPATH_C2"]
# [SnmpdOutput]
# type = "LogOutput"
# use_global_logger = false
# console = false
# server_log_name = "snmpd_matrix"
# server_log_type = "daemon"
# server_log_keyspace = "matrix"
# message_matcher = "Logger == 'SnmpdInput'"
# encoder = "PayloadEncoder"
# Rpingd
# [RpingdInput]
# type = "ProcessInput"
# splitter = "split_n"
# stdout = true
# stderr = true
# is_daemon = true
#
# [RpingdInput.command.0]
# bin = "./rpingd"
# directory = "/opt/matrix/agent/daemon"
# env = ["ETCDPATH_C1=192.168.190.175:2379", "ETCDPATH_C2=192.168.190.175:2379"]
# args = ["--etcd", "/matrix/apps/collector/rpingd/config.json", "--name", "rpingd_matrix", "--debug", "--etcd-source-env", "ETCDPATH_C1,ETCDPATH_C2"]
#
# [RpingdOutput]
# type = "LogOutput"
# use_global_logger = false
# console = false
# server_log_name = "rpingd_matrix"
# server_log_type = "daemon"
# server_log_keyspace = "matrix"
# message_matcher = "Logger == 'RpingdInput'"
# encoder = "PayloadEncoder"
# Syslog Probe
# [SyslogInput]
# type = "SyslogInput"
# address = "0.0.0.0:514"
# #parts = ["hostname", "client", "severity", "facility", "content", "timestamp"]
# out_type = "omni"
# raw_tmpl = '<no value> <no value> <no value>: <no value>'
# single = true
# #timeout = 100 #millionseconds
# log_file = "/opt/matrix/var/logs/toe/syslog.message"
# log_file_size = 104857600 #100M
# log_file_time = "24h"
#
# [SyslogOutput]
# type = "NatsOutput"
# is_streaming = true
# subject = "MATRIX-RULES-SYSLOGD.toe"
# reconnect = true
# stat_interval = 10
# message_matcher = "Logger == 'SyslogInput'"
# encoder = "PayloadEncoder"
# use_protocol = true
# [SyslogOutput.attr]
# EIF Probe
# [EifInput]
# type = "EIFInput"
# server_location = "0.0.0.0"
# server_port = 9998
# #id = "test"
# #init_recv_buf_size = 4096
# #max_recv_buf_size = 104857600
#
# [EifOutput]
# type = "NatsOutput"
# is_streaming = true
# subject = "MATRIX-RULES-EIF.toe"
# reconnect = true
# message_matcher = "Logger == 'EifInput'"
# encoder = "PayloadEncoder"
# use_protocol = true
# [EifOutput.attr]
# Trap
# [TrapInput]
# type = "TrapInput"
# port = 162
#community = "public" #Default: public
#transport = "udp" #Optional: udp, tcp. Default: udp
#version = 3 #Optional: 1, 2, 3. Default: 3
#[TestTrapInput.security]
#level = "authPriv" #Optional: noAuth, authNoPriv, authPriv. Default: authPriv
#username = "user"
#auth_engine_id = "1234" #Default: 1234
#auth_protocol = "SHA" #Optional: NOAUTH, MD5, SHA, SHA224, SHA256, SHA384, SHA512. Default: SHA
#auth_password = "password" #Default: password
#priv_protocol = "DES" #Optional: NOPRIV, DES, AES, AES192, AES256, AES192C, AES256C. Default: DES
#priv_password = "password" #Default: password
# log_file = "/opt/matrix/var/logs/toe/trap.message"
# log_file_size = 104857600 #100M
# log_file_time = "72h"
# raw_tmpl = 'Version:<no value> Timestamp:<no value> Enterprise:<no value> AgentAddress:<no value>'
# [TrapOutput]
# type = "NatsOutput"
# is_streaming = true
# subject = "MATRIX-RULES-TRAPD.toe"
# reconnect = true
# message_matcher = "Logger == 'TrapInput'"
# encoder = "PayloadEncoder"
# use_protocol = true
# [TrapOutput.attr]
# MIB browser for M3Event.M3MCC
# [MIBBrowserInput]
# type = "ProcessInput"
# splitter = "split_n"
# stdout = true
# stderr = true
# is_daemon = true
#
# [MIBBrowserInput.command.0]
# bin = "./mibbrowser"
# directory = "/opt/matrix/agent/daemon"
# args = []
#
# [MIBBrowserOutput]
# type = "LogOutput"
# use_global_logger = true
# console = false
# server_log_name = "mibbrowser_matrix"
# server_log_type = "daemon"
# server_log_keyspace = "matrix"
# message_matcher = "Logger == 'MIBBrowserInput'"
# encoder = "PayloadEncoder"
# stock
[StockInput]
type = "ProcessInput"
cron = "*/30 * * * * * *"
splitter = "split_n"
stdout = true
stderr = false
[StockInput.command.0]
directory = "/opt/matrix/agent/data/stock"
bin = "cat"
args = ["601398.csv","600900.csv","600036.csv"]
[Stock_splitter]
type = "RegexSplitter"
delimiter = '\n100000'
delimiter_eol = true
[StockOutput]
type = "NatsOutput"
is_streaming = true
subject = "MATRIX-RULES-STOCK-MSGBUS.toe"
reconnect = true
message_matcher = "Logger == 'StockInput'"
encoder = "PayloadEncoder"
use_protocol = true
stat_interval = 10
查看日志
# 消息日志
$MATRIXROOT/var/logs/toe/log.log
# 错误日志
$MATRIXROOT/var/logs/toe/out.log