diff --git a/net-mgmt/smartctl_exporter/Makefile b/net-mgmt/smartctl_exporter/Makefile index 272ae47f4a5a..b4142aa20421 100644 --- a/net-mgmt/smartctl_exporter/Makefile +++ b/net-mgmt/smartctl_exporter/Makefile @@ -1,57 +1,57 @@ PORTNAME= smartctl_exporter PORTVERSION= 0.12.0 DISTVERSIONPREFIX= v -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net-mgmt MAINTAINER= delphij@FreeBSD.org COMMENT= Prometheus metrics exporter for smartctl WWW= https://github.com/prometheus-community/smartctl_exporter LICENSE= LGPL3 USES= go:modules USE_GITHUB= yes GH_ACCOUNT= prometheus-community USE_RC_SUBR= smartctl_exporter RUN_DEPENDS+= smartctl:sysutils/smartmontools GO_MODULES= github.com/prometheus-community/smartctl_exporter GO_TARGET= ${PORTNAME}:${PREFIX}/libexec/${PORTNAME} PLIST_FILES= libexec/${PORTNAME} GH_TUPLE= \ alecthomas:kingpin:v2.4.0:alecthomas_kingpin_v2/vendor/github.com/alecthomas/kingpin/v2 \ alecthomas:units:b94a6e3cc137:alecthomas_units/vendor/github.com/alecthomas/units \ beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \ cespare:xxhash:v2.2.0:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \ coreos:go-systemd:v22.5.0:coreos_go_systemd_v22/vendor/github.com/coreos/go-systemd/v22 \ go-kit:log:v0.2.1:go_kit_log/vendor/github.com/go-kit/log \ go-logfmt:logfmt:v0.5.1:go_logfmt_logfmt/vendor/github.com/go-logfmt/logfmt \ go-yaml:yaml:v2.4.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \ golang:appengine:v1.6.7:golang_appengine/vendor/google.golang.org/appengine \ golang:crypto:v0.18.0:golang_crypto/vendor/golang.org/x/crypto \ golang:net:v0.20.0:golang_net/vendor/golang.org/x/net \ golang:oauth2:v0.16.0:golang_oauth2/vendor/golang.org/x/oauth2 \ golang:protobuf:v1.5.3:golang_protobuf/vendor/github.com/golang/protobuf \ golang:sync:v0.5.0:golang_sync/vendor/golang.org/x/sync \ golang:sys:v0.16.0:golang_sys/vendor/golang.org/x/sys \ golang:text:v0.14.0:golang_text/vendor/golang.org/x/text \ jpillora:backoff:v1.0.0:jpillora_backoff/vendor/github.com/jpillora/backoff \ mwitkow:go-conntrack:2f068394615f:mwitkow_go_conntrack/vendor/github.com/mwitkow/go-conntrack \ prometheus:client_golang:v1.19.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \ prometheus:client_model:v0.5.0:prometheus_client_model/vendor/github.com/prometheus/client_model \ prometheus:common:v0.48.0:prometheus_common/vendor/github.com/prometheus/common \ prometheus:exporter-toolkit:v0.11.0:prometheus_exporter_toolkit/vendor/github.com/prometheus/exporter-toolkit \ prometheus:procfs:v0.12.0:prometheus_procfs/vendor/github.com/prometheus/procfs \ protocolbuffers:protobuf-go:v1.32.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf \ tidwall:gjson:v1.17.1:tidwall_gjson/vendor/github.com/tidwall/gjson \ tidwall:match:v1.1.1:tidwall_match/vendor/github.com/tidwall/match \ tidwall:pretty:v1.2.0:tidwall_pretty/vendor/github.com/tidwall/pretty \ xhit:go-str2duration:v2.1.0:xhit_go_str2duration_v2/vendor/github.com/xhit/go-str2duration/v2 pre-patch: ${REINPLACE_CMD} -i '' -e 's|/usr/sbin/smartctl|${LOCALBASE}/sbin/smartctl|g' \ ${WRKSRC}/README.md ${WRKSRC}/main.go .include diff --git a/net-mgmt/smartctl_exporter/files/smartctl_exporter.in b/net-mgmt/smartctl_exporter/files/smartctl_exporter.in index 255d01c78134..5477b36f398d 100644 --- a/net-mgmt/smartctl_exporter/files/smartctl_exporter.in +++ b/net-mgmt/smartctl_exporter/files/smartctl_exporter.in @@ -1,48 +1,48 @@ #!/bin/sh # PROVIDE: smartctl_exporter # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # smartctl_exporter_enable (bool): Set to YES to enable smartctl_exporter, default is NO # smartctl_exporter_user (string): Set user to run as, default is root # smartctl_exporter_syslog (bool): Set to YES to use syslog, default is NO # # Use the following variables to override smartctl_exporter's defaults: # # smartctl_exporter_listen_address (string): Set address to listen on, default is localhost:9633 # smartctl_exporter_devices (string): Shell glob (like /dev/ada[0-9]) for all devices # smartctl_exporter_log_level (string): Only log messages with the given severity or above. One of: [debug, info, warn, error] # smartctl_exporter_log_format (string): Output format of log messages. One of: [logfmt, json] . /etc/rc.subr name=smartctl_exporter rcvar=smartctl_exporter_enable load_rc_config $name : ${smartctl_exporter_enable:="NO"} : ${smartctl_exporter_user:="root"} : ${smartctl_exporter_listen_address:="localhost:9633"} -: ${smartctl_exporter_devices:="$(geom disk status -s | cut -f1 -d\ | sed -e s,^,/dev/,g)"} +: ${smartctl_exporter_devices:="$(geom disk status -s | grep -vE 'cd[0-9]' | awk '{print $1;}' | sed -e s,^,/dev/,g)"} : ${smartctl_exporter_log_level:=""} : ${smartctl_exporter_log_format:=""} pidfile=/var/run/smartctl_exporter.pid command=/usr/sbin/daemon command_args="-c -f -P ${pidfile} \ ${smartctl_exporter_user:+-u "${smartctl_exporter_user}"} \ ${smartctl_exporter_syslog:+-S} \ ${smartctl_exporter_daemon} \ %%PREFIX%%/libexec/smartctl_exporter \ ${smartctl_exporter_listen_address:+--web.listen-address="${smartctl_exporter_listen_address}"} \ ${smartctl_exporter_devices:+$(for diskdev in $(echo "${smartctl_exporter_devices}"); do echo --smartctl.device="${diskdev}"; done | xargs )} \ ${smartctl_exporter_log_level:+--log.level="${smartctl_exporter_log_level}"} \ ${smartctl_exporter_log_format:+--log.format="${smartctl_exporter_log_format}"} \ ${smartctl_exporter_args}" run_rc_command "$1"