Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
108 lines (75 sloc) 3.2 KB
PortSystem 1.0
PortGroup github 1.0
github.setup prometheus node_exporter 0.18.1 v
github.tarball_from archive
description Machine-metric exporter for the Prometheus monitoring \
system.
long_description The Prometheus Node Exporter can expose metrics that \
Prometheus can scrape, including a wide variety of \
system, hardware- and kernel-related metrics.
homepage https://prometheus.io/docs/guides/node-exporter
platforms darwin
categories net
license apache
maintainers {gmail.com:herbygillot @herbygillot} openmaintainer
depends_build port:curl \
port:go
build.env GOPATH=${workpath} \
PATH=$env(PATH):${workpath}/bin
build.target build
use_configure no
installs_libs no
use_parallel_build no
checksums \
rmd160 e4043a6345c4650cd99d0cabdceea333bf3bc596 \
sha256 9ddf187c462f2681ab4516410ada0e6f0f03097db6986686795559ea71a07694 \
size 2110072
set svc_name prometheus-node-exporter
set prom_user prometheus
set ne_doc_dir ${prefix}/share/doc/${svc_name}
set ne_share_dir ${prefix}/share/${svc_name}
set ne_log_dir ${prefix}/var/log/${svc_name}
set ne_log_file ${ne_log_dir}/${name}.log
add_users ${prom_user} \
group=${prom_user} \
realname=Prometheus
post-extract {
copy ${filespath}/org.macports.${name}.plist \
${workpath}/org.macports.${name}.plist
reinplace "s|@NAME@|${name}|g" \
${workpath}/org.macports.${name}.plist
reinplace "s|@USER@|${prom_user}|g" \
${workpath}/org.macports.${name}.plist
reinplace "s|@GROUP@|${prom_user}|g" \
${workpath}/org.macports.${name}.plist
reinplace "s|@PREFIX@|${prefix}|g" \
${workpath}/org.macports.${name}.plist
reinplace "s|@LOGFILE@|${ne_log_file}|g" \
${workpath}/org.macports.${name}.plist
}
destroot {
xinstall -m 755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}
xinstall -d -m 755 ${destroot}${ne_doc_dir}
xinstall -d -m 755 ${destroot}${ne_share_dir}
xinstall -d -m 755 -o ${prom_user} -g ${prom_user} ${destroot}${ne_log_dir}
touch ${destroot}${ne_log_file}
file attributes ${destroot}${ne_log_file} \
-owner ${prom_user} -group ${prom_user}
foreach _dir {examples text_collector_examples} {
copy ${worksrcpath}/${_dir} ${destroot}${ne_share_dir}/
}
copy {*}[glob ${worksrcpath}/docs/*] ${destroot}${ne_doc_dir}/
xinstall -d -m 755 \
${destroot}${prefix}/etc/LaunchDaemons/org.macports.${name}
xinstall -m 0644 -o root -W ${workpath} org.macports.${name}.plist \
${destroot}${prefix}/etc/LaunchDaemons/org.macports.${name}
xinstall -d -m 755 ${destroot}/Library/LaunchDaemons
ln -s ${prefix}/etc/LaunchDaemons/org.macports.${name}/org.macports.${name}.plist \
${destroot}/Library/LaunchDaemons/org.macports.${name}.plist
}
notes "
To enable the Prometheus Node Exporter service, use `port load`, as follows:
\$ sudo port load ${name}
When enabled, the service will log to:
${ne_log_file}
"
You can’t perform that action at this time.