Skip to content

Commit 03f7465

Browse files
committed
Merge branch 'develop' into 'main'
updated resources/README.md for service installation documentation. updated... See merge request bwhitehead.golang/plex_monitor!6
2 parents 55534ba + 1697245 commit 03f7465

File tree

5 files changed

+131
-14
lines changed

5 files changed

+131
-14
lines changed

.github/workflows/govuln.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
name: govulncheck
12
on: [push]
23

34
jobs:
45
govulncheck_job:
56
runs-on: ubuntu-latest
6-
name: Run govulncheck
7+
name: Run govulnchecks
78
steps:
89
- id: govulncheck
910
uses: golang/govulncheck-action@v1

.github/workflows/pre-release.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Create Pre-Release and Assets
2+
on:
3+
push:
4+
# Sequence of patterns matched against refs/tags
5+
tags:
6+
- 'v*-rc*' # Push events to matching v*-rc*, i.e. v1.0.0-rc.1 (v 1.0.0 release candidate 1)
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
create-github-release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@master
19+
- name: Create Release
20+
id: create_release
21+
uses: actions/create-release@latest
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
24+
with:
25+
tag_name: ${{ github.ref }}
26+
release_name: Release ${{ github.ref }}
27+
body: |
28+
Changes in this Release
29+
- First Change
30+
- Second Change
31+
draft: false
32+
prerelease: true
33+
34+
releases-matrix:
35+
name: Release Go Binary
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
# build and publish in parallel: "darwin/amd64","freebsd/amd64","freebsd/arm64","freebsd/arm","linux/amd64","linux/arm","linux/arm64","openbsd/amd64","openbsd/arm64","openbsd/arm","windows/amd64"
40+
goos: [linux, windows, darwin, freebsd, openbsd]
41+
goarch: [amd64, arm64, arm]
42+
exclude:
43+
- goarch: arm64
44+
goos: windows
45+
- goarch: arm
46+
goos: windows
47+
- goarch: arm64
48+
goos: darwin
49+
- goarch: arm
50+
goos: darwin
51+
steps:
52+
- uses: actions/checkout@v3
53+
- uses: wangyoucao577/go-release-action@v1
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
goos: ${{ matrix.goos }}
57+
goarch: ${{ matrix.goarch }}
58+
goarm: 7
59+
goversion: "1.21.1"
60+
#binary_name: "plex_monitor-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix-goarch }}"
61+
extra_files: LICENSE README.md
62+
compress_assets: auto

.github/workflows/release.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
# .github/workflows/release.yaml
2-
1+
name: Create Release and Assets
32
on:
4-
release:
5-
types: [created]
3+
push:
4+
# Sequence of patterns matched against refs/tags
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
67

78
permissions:
89
contents: write
910
packages: write
1011

1112
jobs:
13+
create-github-release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@master
19+
- name: Create Release
20+
id: create_release
21+
uses: actions/create-release@latest
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
24+
with:
25+
tag_name: ${{ github.ref }}
26+
release_name: Release ${{ github.ref }}
27+
body: |
28+
Changes in this Release
29+
- First Change
30+
- Second Change
31+
draft: false
32+
prerelease: false
33+
1234
releases-matrix:
1335
name: Release Go Binary
1436
runs-on: ubuntu-latest
@@ -33,6 +55,8 @@ jobs:
3355
github_token: ${{ secrets.GITHUB_TOKEN }}
3456
goos: ${{ matrix.goos }}
3557
goarch: ${{ matrix.goarch }}
36-
goversion: "https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz"
37-
binary_name: "test-binary"
38-
extra_files: LICENSE README.md
58+
goarm: 7
59+
goversion: "1.21.1"
60+
#binary_name: "plex_monitor-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix-goarch }}"
61+
extra_files: LICENSE README.md
62+
compress_assets: auto

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
# Plex Monitor
22

3-
plex_monitor is a simple status monitor for Plex written in Go that polls the Plex API to return the following data:
3+
[![gitleaks](https://github.com/bwhitehead0/plex_monitor/actions/workflows/gitleaks.yaml/badge.svg)](https://github.com/bwhitehead0/plex_monitor/actions/workflows/gitleaks.yaml) [![govulncheck](https://github.com/bwhitehead0/plex_monitor/actions/workflows/govuln.yaml/badge.svg)](https://github.com/bwhitehead0/plex_monitor/actions/workflows/govuln.yaml)
4+
<hr>
45

5-
- Request Duration - Time elapsed for polling Plex API endpoint
6-
- Request Time - Timestamp for the request
7-
- Status - Up or Down
8-
- Version - Plex version reported by API
6+
plex_monitor is a simple status monitor for Plex written in Go.
7+
8+
It polls the Plex API to return the following data:
9+
10+
- **Request Duration** - Time elapsed in milliseconds for polling Plex API endpoint
11+
- **Request Time** - Timestamp for the request from `plex_monitor` to Plex API
12+
- **Status** - Up or Down
13+
- **Version** - Plex version reported by API
914

1015
This application polls API endpoint `/identity`, for example https://your.plexserver.com:32400/identity
1116

@@ -79,4 +84,4 @@ go build main.go -o plex_monitor plex_monitor
7984

8085
- Accept parameters in lieu of config file.
8186
- Find new flag package for easier extensibility and more flexibility.
82-
- Provide more user friendly help output with `-h` flag
87+
- Provide more user friendly help output with `-h` flag (dependent on new flag package)

resources/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Installing as a service
2+
3+
The systemd unit file `plex_monitor.service` should suffice as a functional service for most use cases.
4+
5+
Simply copy the file to `/etc/systemd/system/` and, after, updating the binary and config file locations for `ExecStart`, start the service.
6+
7+
Service logs will be written to `/var/log/plex_monitor.log`.
8+
9+
Manage the service with typical `systemctl` commands.
10+
11+
```
12+
bwhitehead@log01:~$ sudo systemctl status plex_monitor.service
13+
● plex_monitor.service - Plex Monitor
14+
Loaded: loaded (/etc/systemd/system/plex_monitor.service; enabled; vendor preset: enabled)
15+
Active: active (running) since Wed 2023-10-04 15:26:49 UTC; 2s ago
16+
Docs: https://github.com/bwhitehead0/plex_monitor
17+
Main PID: 24271 (plex_monitor)
18+
Tasks: 8 (limit: 9347)
19+
Memory: 1.3M
20+
CPU: 9ms
21+
CGroup: /system.slice/plex_monitor.service
22+
└─24271 /usr/local/bin/plex_monitor --config.file=/etc/plex_monitor.yaml
23+
24+
Oct 04 15:26:49 log01.fw.home systemd[1]: Started Plex Monitor.
25+
```

0 commit comments

Comments
 (0)