From 410d329f0f1e17b30df2c1e785ac4f07eda1c914 Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Tue, 30 May 2023 23:29:37 +0700 Subject: [PATCH] Fix grafana, promtail log reader --- .github/workflows/main.yml | 3 ++- Makefile | 2 +- README.md | 2 +- pkg-descr | 2 ++ src/opnsense/scripts/syslog/logformats/grafana.py | 1 + src/opnsense/scripts/syslog/logformats/promtail.py | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f2635f..60396c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,4 +37,5 @@ jobs: - uses: ncipollo/release-action@v1 with: artifacts: "*.pkg" - generateReleaseNotes: true \ No newline at end of file + generateReleaseNotes: true + makeLatest: true \ No newline at end of file diff --git a/Makefile b/Makefile index c9965be..e0780f6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= opn-monitor PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Grafana loki promtail stack PLUGIN_MAINTAINER= oxycoder@gmail.com PLUGIN_DEVEL= diff --git a/README.md b/README.md index 7d76522..17a34ac 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ More can be found here: [demos](https://github.com/oxycoder/opn-repo/blob/main/i ## Install plugin ``` -rsync -av ./src/ root@opnsenseIP:/usr/local/ +pkg add https://github.com/oxycoder/opn-monitor/releases/latest/download/os-opn-monitor-1.0_1.pkg ``` ## Install grafana, loki, promtail (build form source) diff --git a/pkg-descr b/pkg-descr index c23485e..3ee5e83 100644 --- a/pkg-descr +++ b/pkg-descr @@ -3,4 +3,6 @@ Provide support for Grafana, Loki and Promtail Plugin Changelog ================ +1.0_1 Fix Grafana and promtail log reader + 1.0 Initial release \ No newline at end of file diff --git a/src/opnsense/scripts/syslog/logformats/grafana.py b/src/opnsense/scripts/syslog/logformats/grafana.py index cbe883f..d684de0 100644 --- a/src/opnsense/scripts/syslog/logformats/grafana.py +++ b/src/opnsense/scripts/syslog/logformats/grafana.py @@ -6,6 +6,7 @@ class GrafanaLogFormat(NewBaseLogFormat): def __init__(self, filename): super().__init__(filename) self._priority = 200 + self._parts = list() def match(self, line): # need to check file name here otherwise it will fallback to another LogFormater diff --git a/src/opnsense/scripts/syslog/logformats/promtail.py b/src/opnsense/scripts/syslog/logformats/promtail.py index c6e2fd1..1cf2e01 100644 --- a/src/opnsense/scripts/syslog/logformats/promtail.py +++ b/src/opnsense/scripts/syslog/logformats/promtail.py @@ -6,6 +6,7 @@ class PromtailLogFormat(NewBaseLogFormat): def __init__(self, filename): super().__init__(filename) self._priority = 200 + self._parts = list() def match(self, line): # need to check file name here otherwise it will fallback to another LogFormater