Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3a0fb7fb5 | |||
| 5e87608587 | |||
| ab7fd107e7 | |||
| 550cd59093 | |||
| a8621d2bb0 | |||
| 4b1d9dc2d3 | |||
| 22769b962e | |||
| feb7909961 | |||
| 2f01e8c8e0 | |||
| 31c2daedf7 |
@@ -31,5 +31,6 @@ COPY --link --from=backendbuild --chmod=755 /go/src/github.com/analogj/scrutiny/
|
|||||||
COPY --link --from=frontendbuild --chmod=644 /go/src/github.com/analogj/scrutiny/dist /opt/scrutiny/web
|
COPY --link --from=frontendbuild --chmod=644 /go/src/github.com/analogj/scrutiny/dist /opt/scrutiny/web
|
||||||
RUN mkdir -p /opt/scrutiny/web && \
|
RUN mkdir -p /opt/scrutiny/web && \
|
||||||
mkdir -p /opt/scrutiny/config && \
|
mkdir -p /opt/scrutiny/config && \
|
||||||
chmod -R ugo+rwx /opt/scrutiny/config
|
chmod -R a+rX /opt/scrutiny && \
|
||||||
|
chmod -R a+w /opt/scrutiny/config
|
||||||
CMD ["/opt/scrutiny/bin/scrutiny", "start"]
|
CMD ["/opt/scrutiny/bin/scrutiny", "start"]
|
||||||
|
|||||||
@@ -104,3 +104,36 @@ You may also configure these values using the following environmental variables
|
|||||||
```
|
```
|
||||||
3. run `docker-compose up`
|
3. run `docker-compose up`
|
||||||
4. visit [http://localhost:9090/custom/web](http://localhost:9090/custom/web) - access the scrutiny container via caddy reverse proxy
|
4. visit [http://localhost:9090/custom/web](http://localhost:9090/custom/web) - access the scrutiny container via caddy reverse proxy
|
||||||
|
|
||||||
|
## Traefik
|
||||||
|
|
||||||
|
Assuming, that you have Traefik up and running with [AutoDiscovery Using Traefik For Docker ](https://doc.traefik.io/traefik/providers/docker/),
|
||||||
|
here is an example of a `docker-compose.yml` file, with labels to enable Traefik reverse proxy and basic auth
|
||||||
|
```yaml
|
||||||
|
version: '3.5'
|
||||||
|
services:
|
||||||
|
scrutiny:
|
||||||
|
container_name: scrutiny
|
||||||
|
image: ghcr.io/analogj/scrutiny:master-omnibus
|
||||||
|
cap_add:
|
||||||
|
- SYS_RAWIO
|
||||||
|
- SYS_ADMIN
|
||||||
|
volumes:
|
||||||
|
- /run/udev:/run/udev:ro
|
||||||
|
- ./config:/opt/scrutiny/config
|
||||||
|
- ./influxdb:/opt/scrutiny/influxdb
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.scrutiny.rule=Host(`example.com`)
|
||||||
|
- traefik.http.services.scrutiny.loadbalancer.server.port=8080
|
||||||
|
# 2 labels below are optional, in case you want basic auth in Traefik:
|
||||||
|
- traefik.http.routers.scrutiny.middlewares=auth
|
||||||
|
- "traefik.http.middlewares.auth.basicauth.users=user:$$2y$$05$$G11Wm/dlWpXHENK..m8se.zxvaE8USJBp1Ws56sSCrOcwWDjsYHni"
|
||||||
|
# Note: when used in docker-compose.yml all dollar signs in the hash need to be doubled for escaping.
|
||||||
|
# To create user:password pair, it's possible to use this command:
|
||||||
|
# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g
|
||||||
|
devices:
|
||||||
|
- "/dev/sda"
|
||||||
|
- "/dev/sdb"
|
||||||
|
- "/dev/nvme0"
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package thresholds
|
package thresholds
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
const AtaSmartAttributeDisplayTypeRaw = "raw"
|
const AtaSmartAttributeDisplayTypeRaw = "raw"
|
||||||
const AtaSmartAttributeDisplayTypeNormalized = "normalized"
|
const AtaSmartAttributeDisplayTypeNormalized = "normalized"
|
||||||
const AtaSmartAttributeDisplayTypeTransformed = "transformed"
|
const AtaSmartAttributeDisplayTypeTransformed = "transformed"
|
||||||
@@ -662,62 +667,84 @@ var AtaMetadata = map[int]AtaAttributeMetadata{
|
|||||||
188: {
|
188: {
|
||||||
ID: 188,
|
ID: 188,
|
||||||
DisplayName: "Command Timeout",
|
DisplayName: "Command Timeout",
|
||||||
DisplayType: AtaSmartAttributeDisplayTypeRaw,
|
DisplayType: AtaSmartAttributeDisplayTypeTransformed,
|
||||||
Ideal: ObservedThresholdIdealLow,
|
Ideal: ObservedThresholdIdealLow,
|
||||||
Critical: true,
|
Critical: true,
|
||||||
Description: "The count of aborted operations due to HDD timeout. Normally this attribute value should be equal to zero.",
|
Description: "The count of aborted operations due to HDD timeout. Normally this attribute value should be equal to zero.",
|
||||||
|
Transform: func(normValue int64, rawValue int64, rawString string) int64 {
|
||||||
|
// Parse Seagate command timeout values if the string contains 3 pieces
|
||||||
|
// and each piece is less than or equal to the next (as a sanity check)
|
||||||
|
// See https://github.com/AnalogJ/scrutiny/issues/522
|
||||||
|
pieces := strings.Split(rawString, " ")
|
||||||
|
if len(pieces) == 3 {
|
||||||
|
int_pieces := make([]int, len(pieces))
|
||||||
|
var err error
|
||||||
|
for i, s := range pieces {
|
||||||
|
int_pieces[i], err = strconv.Atoi(s)
|
||||||
|
if err != nil {
|
||||||
|
return rawValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if int_pieces[2] >= int_pieces[1] && int_pieces[1] >= int_pieces[0] {
|
||||||
|
return int64(int_pieces[2])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rawValue
|
||||||
|
},
|
||||||
ObservedThresholds: []ObservedThreshold{
|
ObservedThresholds: []ObservedThreshold{
|
||||||
{
|
{
|
||||||
Low: 0,
|
Low: 0,
|
||||||
High: 0,
|
// This is set arbitrarily to avoid notifications caused by low
|
||||||
|
// historical numbers of command timeouts (e.g. caused by a bad cable)
|
||||||
|
High: 100,
|
||||||
AnnualFailureRate: 0.024893587674442153,
|
AnnualFailureRate: 0.024893587674442153,
|
||||||
ErrorInterval: []float64{0.020857343769186413, 0.0294830350167543},
|
ErrorInterval: []float64{0.020857343769186413, 0.0294830350167543},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 0,
|
Low: 100,
|
||||||
High: 13,
|
High: 13000000000,
|
||||||
AnnualFailureRate: 0.10044174089362015,
|
AnnualFailureRate: 0.10044174089362015,
|
||||||
ErrorInterval: []float64{0.0812633664077498, 0.1227848196758574},
|
ErrorInterval: []float64{0.0812633664077498, 0.1227848196758574},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 13,
|
Low: 13000000000,
|
||||||
High: 26,
|
High: 26000000000,
|
||||||
AnnualFailureRate: 0.334030592234279,
|
AnnualFailureRate: 0.334030592234279,
|
||||||
ErrorInterval: []float64{0.2523231196342665, 0.4337665082489293},
|
ErrorInterval: []float64{0.2523231196342665, 0.4337665082489293},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 26,
|
Low: 26000000000,
|
||||||
High: 39,
|
High: 39000000000,
|
||||||
AnnualFailureRate: 0.36724705400842445,
|
AnnualFailureRate: 0.36724705400842445,
|
||||||
ErrorInterval: []float64{0.30398009356575617, 0.4397986538328568},
|
ErrorInterval: []float64{0.30398009356575617, 0.4397986538328568},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 39,
|
Low: 39000000000,
|
||||||
High: 52,
|
High: 52000000000,
|
||||||
AnnualFailureRate: 0.29848155926978354,
|
AnnualFailureRate: 0.29848155926978354,
|
||||||
ErrorInterval: []float64{0.2509254838615984, 0.35242890006477073},
|
ErrorInterval: []float64{0.2509254838615984, 0.35242890006477073},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 52,
|
Low: 52000000000,
|
||||||
High: 65,
|
High: 65000000000,
|
||||||
AnnualFailureRate: 0.2203079701535098,
|
AnnualFailureRate: 0.2203079701535098,
|
||||||
ErrorInterval: []float64{0.18366082845676174, 0.26212468677179274},
|
ErrorInterval: []float64{0.18366082845676174, 0.26212468677179274},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 65,
|
Low: 65000000000,
|
||||||
High: 78,
|
High: 78000000000,
|
||||||
AnnualFailureRate: 0.3018169948863018,
|
AnnualFailureRate: 0.3018169948863018,
|
||||||
ErrorInterval: []float64{0.23779746376787655, 0.37776897542831006},
|
ErrorInterval: []float64{0.23779746376787655, 0.37776897542831006},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 78,
|
Low: 78000000000,
|
||||||
High: 91,
|
High: 91000000000,
|
||||||
AnnualFailureRate: 0.32854928239235887,
|
AnnualFailureRate: 0.32854928239235887,
|
||||||
ErrorInterval: []float64{0.2301118782147336, 0.4548506948185028},
|
ErrorInterval: []float64{0.2301118782147336, 0.4548506948185028},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Low: 91,
|
Low: 91000000000,
|
||||||
High: 104,
|
High: 104000000000,
|
||||||
AnnualFailureRate: 0.28488916640649387,
|
AnnualFailureRate: 0.28488916640649387,
|
||||||
ErrorInterval: []float64{0.1366154288236293, 0.5239213202729072},
|
ErrorInterval: []float64{0.1366154288236293, 0.5239213202729072},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ package version
|
|||||||
|
|
||||||
// VERSION is the app-global version string, which will be replaced with a
|
// VERSION is the app-global version string, which will be replaced with a
|
||||||
// new value during packaging
|
// new value during packaging
|
||||||
const VERSION = "0.7.1"
|
const VERSION = "0.7.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user