pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/databases/postgres_exporter



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Fri May 31 14:42:04 UTC 2019

Added Files:
        pkgsrc/databases/postgres_exporter: DESCR MESSAGE.smf Makefile PLIST
            distinfo
        pkgsrc/databases/postgres_exporter/files: env.conf
        pkgsrc/databases/postgres_exporter/files/smf: manifest.xml
            postgres_exporter.sh

Log Message:
postgres_exporter: Import version 0.4.7.

A PostgresSQL metric exporter for Prometheus.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/postgres_exporter/DESCR \
    pkgsrc/databases/postgres_exporter/MESSAGE.smf \
    pkgsrc/databases/postgres_exporter/Makefile \
    pkgsrc/databases/postgres_exporter/PLIST \
    pkgsrc/databases/postgres_exporter/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/postgres_exporter/files/env.conf
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/databases/postgres_exporter/files/smf/manifest.xml \
    pkgsrc/databases/postgres_exporter/files/smf/postgres_exporter.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/databases/postgres_exporter/DESCR
diff -u /dev/null pkgsrc/databases/postgres_exporter/DESCR:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/DESCR    Fri May 31 14:42:04 2019
@@ -0,0 +1 @@
+A PostgresSQL metric exporter for Prometheus.
Index: pkgsrc/databases/postgres_exporter/MESSAGE.smf
diff -u /dev/null pkgsrc/databases/postgres_exporter/MESSAGE.smf:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/MESSAGE.smf      Fri May 31 14:42:04 2019
@@ -0,0 +1,13 @@
+===========================================================================
+$NetBSD: MESSAGE.smf,v 1.1 2019/05/31 14:42:04 jperkin Exp $
+
+To configure postgres_exporter adjust the environment variables in:
+
+       ${PKG_SYSCONFDIR}/env.conf
+
+Additional queries can be configured in:
+
+       ${PKG_SYSCONFDIR}/queries.yaml
+
+Ensure these files retain appropriately secure permissions.
+===========================================================================
Index: pkgsrc/databases/postgres_exporter/Makefile
diff -u /dev/null pkgsrc/databases/postgres_exporter/Makefile:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/Makefile Fri May 31 14:42:04 2019
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1 2019/05/31 14:42:04 jperkin Exp $
+
+DISTNAME=      postgres_exporter-0.4.7
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=wrouesnel/}
+CATEGORIES=    databases
+GITHUB_PROJECT=        postgres_exporter
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%pkgsrc.org@localhost
+HOMEPAGE=      https://github.com/wrouesnel/postgres_exporter/
+COMMENT=       PostgresSQL metric exporter for Prometheus
+LICENSE=       apache-2.0
+
+GO_DIST_BASE=  ${DISTNAME}
+GO_SRCPATH=    github.com/wrouesnel/postgres_exporter
+
+SMF_METHODS=   ${PKGBASE}
+
+EGDIR=                 share/examples/${PKGBASE}
+PKG_SYSCONFSUBDIR=     ${PKGBASE}
+
+INSTALLATION_DIRS+=    ${EGDIR}
+
+CONF_FILES_PERMS+=     ${EGDIR}/queries.yaml ${PKG_SYSCONFDIR}/queries.yaml \
+                       ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 644
+CONF_FILES_PERMS+=     ${EGDIR}/env.conf ${PKG_SYSCONFDIR}/env.conf \
+                       ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 600
+
+post-build:
+       ${SED} -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g' ${FILESDIR}/env.conf \
+           >${WRKDIR}/.env.conf
+
+post-install:
+       ${INSTALL_DATA} ${WRKSRC}/queries.yaml \
+           ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/queries.yaml
+       ${INSTALL_DATA} ${WRKDIR}/.env.conf \
+           ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/env.conf
+
+.include "../../lang/go/go-package.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/databases/postgres_exporter/PLIST
diff -u /dev/null pkgsrc/databases/postgres_exporter/PLIST:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/PLIST    Fri May 31 14:42:04 2019
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2019/05/31 14:42:04 jperkin Exp $
+bin/postgres_exporter
+share/examples/postgres_exporter/env.conf
+share/examples/postgres_exporter/queries.yaml
Index: pkgsrc/databases/postgres_exporter/distinfo
diff -u /dev/null pkgsrc/databases/postgres_exporter/distinfo:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/distinfo Fri May 31 14:42:04 2019
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2019/05/31 14:42:04 jperkin Exp $
+
+SHA1 (postgres_exporter-0.4.7.tar.gz) = 1fc973ef659b653e4dcfe27e1cb1dd6a38403709
+RMD160 (postgres_exporter-0.4.7.tar.gz) = a0d5acf380fb04b054c3c8090714eceab3a44b84
+SHA512 (postgres_exporter-0.4.7.tar.gz) = 81afce765830a5c16597f0ac9a95d21466edb20e40cff8e26079663db75f0051a6e0eb4ff828eb825b51a6fc52b3b534e0f6ffbb2ecf2c94e2ec8656de4a2ff6
+Size (postgres_exporter-0.4.7.tar.gz) = 3699251 bytes

Index: pkgsrc/databases/postgres_exporter/files/env.conf
diff -u /dev/null pkgsrc/databases/postgres_exporter/files/env.conf:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/files/env.conf   Fri May 31 14:42:04 2019
@@ -0,0 +1,17 @@
+#
+# Configuration file for postgres_exporter.  This file is sourced by the SMF
+# method script, allowing usernames and passwords to be stored here and protected
+# by standard UNIX permissions.
+#
+
+DATA_SOURCE_NAME="postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
+PG_EXPORTER_WEB_LISTEN_ADDRESS=":9187"
+PG_EXPORTER_WEB_TELEMETRY_PATH="/metrics"
+PG_EXPORTER_DISABLE_DEFAULT_METRICS=false
+PG_EXPORTER_DISABLE_SETTINGS_METRICS=false
+PG_EXPORTER_EXTEND_QUERY_PATH="@PKG_SYSCONFDIR@/queries.yaml"
+
+export DATA_SOURCE_NAME
+export PG_EXPORTER_WEB_LISTEN_ADDRESS PG_EXPORTER_WEB_TELEMETRY_PATH
+export PG_EXPORTER_DISABLE_DEFAULT_METRICS PG_EXPORTER_DISABLE_SETTINGS_METRICS
+export PG_EXPORTER_EXTEND_QUERY_PATH

Index: pkgsrc/databases/postgres_exporter/files/smf/manifest.xml
diff -u /dev/null pkgsrc/databases/postgres_exporter/files/smf/manifest.xml:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/files/smf/manifest.xml   Fri May 31 14:42:04 2019
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="export">
+  <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+    <create_default_instance enabled="false"/>
+    <single_instance/>
+    <dependency name="network" grouping="require_all" restart_on="error" type="service">
+      <service_fmri value="svc:/milestone/network:default"/>
+    </dependency>
+    <dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
+      <service_fmri value="svc:/system/filesystem/local"/>
+    </dependency>
+    <method_context>
+      <method_environment>
+        <envvar name="PATH" value="@PREFIX@/sbin:@PREFIX@/bin:/sbin:/usr/sbin:/usr/bin"/>
+      </method_environment>
+    </method_context>
+    <exec_method type="method" name="start" exec="@PREFIX@/@SMF_METHOD_FILE.postgres_exporter@ start" timeout_seconds="60"/>
+    <exec_method type="method" name="refresh" exec=":kill -HUP" timeout_seconds="60"/>
+    <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
+    <property_group name="startd" type="framework">
+      <propval name="duration" type="astring" value="child"/>
+      <propval name="ignore_error" type="astring" value="core,signal"/>
+    </property_group>
+    <template>
+      <common_name>
+        <loctext xml:lang="C">Prometheus exporter for PostgreSQL server metrics</loctext>
+      </common_name>
+    </template>
+  </service>
+</service_bundle>
Index: pkgsrc/databases/postgres_exporter/files/smf/postgres_exporter.sh
diff -u /dev/null pkgsrc/databases/postgres_exporter/files/smf/postgres_exporter.sh:1.1
--- /dev/null   Fri May 31 14:42:04 2019
+++ pkgsrc/databases/postgres_exporter/files/smf/postgres_exporter.sh   Fri May 31 14:42:04 2019
@@ -0,0 +1,27 @@
+#!@SMF_METHOD_SHELL@
+#
+# $NetBSD: postgres_exporter.sh,v 1.1 2019/05/31 14:42:04 jperkin Exp $
+#
+# Init script for postgres_exporter.  This is non-standard, but required so
+# that we can source a configuration file and pass environment variables that
+# include the database password to the program.
+#
+# As we need to use it anyway, we use it for everything, rather than splitting
+# configuration between the config file and SMF variables.
+#
+
+. /lib/svc/share/smf_include.sh
+
+. @PKG_SYSCONFDIR@/env.conf
+
+case "$1" in
+start)
+       @LOCALBASE@/bin/postgres_exporter
+       ;;
+*)
+       echo "Usage: $0 start" >&2
+       exit 1
+       ;;
+esac
+
+exit ${SMF_EXIT_OK}



Home | Main Index | Thread Index | Old Index