Skip to content

Commit

Permalink
feat: enhance the demo with syslog telemetries
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin222004 <[email protected]>
  • Loading branch information
Kevin222004 committed Jul 4, 2024
1 parent eba1aba commit 76d273a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
curl --fail http://127.0.0.1:9091/api/v1/query?query=disk_used_percent | grep disk_used_percent
curl --fail http://127.0.0.1:9091/api/v1/query?query=netstat_tcp_listen | grep netstat_tcp_listen
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
curl --fail http://127.0.0.1:9091/api/v1/query?query=syslog_version | grep syslog_version
- name: Logs
if: always()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ curl --fail http://127.0.0.1:9091/api/v1/query?query=redfish_thermal_fans_readin
curl --fail http://127.0.0.1:9091/api/v1/query?query=disk_used_percent | grep disk_used_percent
curl --fail http://127.0.0.1:9091/api/v1/query?query=netstat_tcp_listen | grep netstat_tcp_listen
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
curl --fail http://127.0.0.1:9091/api/v1/query?query=syslog_version | grep syslog_version
```

## Running example
Expand Down
10 changes: 10 additions & 0 deletions config/rsyslog.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$ActionQueueType LinkedList # use asynchronous processing
$ActionQueueFileName srvrfwd # set file name, also enables disk mode
$ActionResumeRetryCount -1 # infinite retries on insert failure
$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down

# forward over tcp with octet framing according to RFC 5425
*.* @@(o)localhost:6514;RSYSLOG_SyslogProtocol23Format

# uncomment to use udp according to RFC 5424
# *.* @127.0.0.1:6514;RSYSLOG_SyslogProtocol23Format
3 changes: 3 additions & 0 deletions config/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
servers = ["8.8.8.8"]
include_fields = ["all_ips"]

[[inputs.syslog]]
server = "tcp://syslog:6514"

[[outputs.file]]
files = ["stdout"]
data_format = "influx"
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ services:
timeout: 10s
retries: 5

syslog:
image: docker.io/rsyslog/syslog_appliance_alpine:8.36.0-3.7
volumes:
- ./config/rsyslog.conf:/etc/rsyslog.conf
ports:
- "6514:6514/tcp"
networks:
- opi

volumes:
influxdb-storage:

Expand Down

0 comments on commit 76d273a

Please sign in to comment.