# Meta 데이터 저장할 위치 지정.
[meta]
# Where the metadata/raft database is stored
dir = "/var/lib/influxdb/meta"
# 실제 데이터를 저장할 디렉토릴 지정.
[data]
# The directory where the TSM storage engine stores TSM files.
dir = "/var/lib/influxdb/data"
# The directory where the TSM storage engine stores WAL files.
wal-dir = "/var/lib/influxdb/wal"
# Clustering 서비스 설정 통제
[coordinator]
write-timeout = "10s" # write request 가 기다릴시간. 이 시간이 지나면 에러 리턴
max-concurrent-queries = 0 # 최대 동시 쿼리 개수. 0 은 unlimited.
query-timeout = "0" # 시스템이 kill 하기전에 쿼리 수행허용 시간
log-queries-after = "0s" # slow 쿼리를 기록할 한계시간. 0 은 slow 쿼리 로깅을 하지 않음.
max-select-point = 0
max-select-series = 0
max-select-buckets = 0
# 데이터 보관기간 설정.
[retention]
enabled = true # 설정 사용함.
check-interval = "30m" # 보관기간 정책 체크할 인터발 시간. 30분에 한번씩 보관기간 정책 체크.
# 모니터링 데이터를 위한 내부 데이터베이스 생성 설정.
[monitor]
store-enabled = true # 내부 데이터베이스 생성 활성화.
store-database = "_internal" # 저정할 데이터베이스 이름
store-interval = "10s" # 10마다 통계치를 저장.
# Web 기반 관리자 페이지 설정
[admin]
enabled = true
bind-address = ":8083"
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
# HTTP 엔드포인트 설정. 이것은 InfluxDB 에서 데이터를 넣고 빼는데 핵심이 되는 매커니즘이다.
[http]
enabled = true
bind-address = ":8086"
auth-enabled = true
log-enabled = true
write-tracing = false
pprof-enabled = false # 트러블슈팅이나 모니터링에 사용함.
https-enabled = false
https-certificate = "/etc/ssl/influxdb.pem"
### Use a separate private key location.
# https-private-key = ""
max-row-limit = 10000
realm = "InfluxDB"
# 사용하지 않음.
[[graphite]]
enabled = false
# 사용하지 않음.
[[collectd]]
enabled = false
# 사용하지 않음.
[[opentsdb]]
enabled = false
# 사용하지 않음.
[[udp]]
enabled = false
# 지속적인 쿼리. 이 기능은 아주 유용한데, 일단 활성화를 해둔다.
[continuous_queries]
enabled = true
log-enabled = true
run-interval = "5s"
prometheus에 비해 쿼리 작성이 너무 어려워서... 한번 influxdb v1으로 설치해 봅니다.
root@syslogserver:~# apt install influxdb
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음 새 패키지를 설치할 것입니다:
influxdb
0개 업그레이드, 1개 새로 설치, 0개 제거 및 5개 업그레이드 안 함.
0 바이트/54.4 M바이트 아카이브를 받아야 합니다.
이 작업 후 153 M바이트의 디스크 공간을 더 사용하게 됩니다.
Selecting previously unselected package influxdb.
(데이터베이스 읽는중 ...현재 329680개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../influxdb_1.8.10-1_amd64.deb ...
Unpacking influxdb (1.8.10-1) ...
influxdb (1.8.10-1) 설정하는 중입니다 ...
Created symlink /etc/systemd/system/influxd.service → /lib/systemd/system/influxdb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service → /lib/systemd/system/influxdb.service.
Processing triggers for man-db (2.10.2-1) ...
root@syslogserver:~#
root@syslogserver:~# influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show databases
name: databases
name
----
_internal
> create database telegrafdb
> create user telegraf with password 'password0'
>
> grant all on telegrafdb to telegraf
> show databaes
ERR: error parsing query: found databaes, expected CONTINUOUS, DATABASES, DIAGNOSTICS, FIELD, GRANTS, MEASUREMENT, MEASUREMENTS, QUERIES, RETENTION, SERIES, SHARD, SHARDS, STATS, SUBSCRIPTIONS, TAG, USERS at line 1, char 6
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".
> show databases
name: databases
name
----
_internal
telegrafdb
> quit
root@syslogserver:~#
root@syslogserver:~# vi /etc/telegraf/telegraf.conf
#[[outputs.influxdb]]
## The full HTTP or UDP URL for your InfluxDB instance.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
# urls = ["unix:///var/run/influxdb.sock"]
# urls = ["udp://127.0.0.1:8089"]
urls = ["http://192.168.000.000:8086"]
## The target database for metrics; will be created as needed.
## For UDP url endpoint database needs to be configured on server side.
database = "telegrafdb"
## The value of this tag will be used to determine the database. If this
## tag is not set the 'database' option is used as the default.
# database_tag = ""
## If true, the 'database_tag' will not be included in the written metric.
# exclude_database_tag = false
## If true, no CREATE DATABASE queries will be sent. Set to true when using
## Telegraf with a user without permissions to create databases or when the
## database already exists.
# skip_database_creation = false
## Name of existing retention policy to write to. Empty string writes to
## the default retention policy. Only takes effect when using HTTP.
retention_policy = ""
## The value of this tag will be used to determine the retention policy. If this
## tag is not set the 'retention_policy' option is used as the default.
# retention_policy_tag = ""
## If true, the 'retention_policy_tag' will not be included in the written metric.
# exclude_retention_policy_tag = false
## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
## Only takes effect when using HTTP.
# write_consistency = "any"
## Timeout for HTTP messages.
timeout = "5s"
## HTTP Basic Auth
username = "telegraf"
password = "password0"
root@syslogserver:~/.snmp# ls -al
total 8
drwxr-xr-x 2 root root 4096 3월 15 17:04 .
drwx------ 13 root root 4096 3월 15 16:58 ..
lrwxrwxrwx 1 root root 25 3월 15 16:58 mibs -> /usr/share/snmp/mibs/ietf
root@syslogserver:~# snmpwalk -v2c -c test 192.168.000.000 fgSysCpuUsage
MIB search path: mibs
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (IPV6-ICMP-MIB): At line 0 in (none)
Cannot find module (IPV6-MIB): At line 0 in (none)
Cannot find module (IPV6-TCP-MIB): At line 0 in (none)
Cannot find module (IPV6-UDP-MIB): At line 0 in (none)
Cannot find module (IP-FORWARD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
Cannot find module (NET-SNMP-VACM-MIB): At line 0 in (none)
snmpwalk: Unknown host (fgSysCpuUsage) (Resource temporarily unavailable)
root@syslogserver:~#
파일 생성 후
root@syslogserver:~/.snmp# ln -s /etc/snmp/snmp.conf ./snmp.conf
root@syslogserver:~/.snmp# ls -al
total 8
drwxr-xr-x 2 root root 4096 3월 15 17:07 .
drwx------ 13 root root 4096 3월 15 16:58 ..
lrwxrwxrwx 1 root root 25 3월 15 16:58 mibs -> /usr/share/snmp/mibs/ietf
lrwxrwxrwx 1 root root 19 3월 15 17:07 snmp.conf -> /etc/snmp/snmp.conf
root@syslogserver:~/.snmp# snmpwalk -v2c -c test 192.168.000.000 fgSysCpuUsage
/usr/share/snmp/mibs/ietf: No such file or directory
fgSysCpuUsage: Unknown Object Identifier (Sub-id not found: (top) -> fgSysCpuUsage)
root@syslogserver:~/.snmp#