Coder Social home page Coder Social logo

FreeBSD support about postfix_exporter HOT 2 OPEN

kumina avatar kumina commented on August 11, 2024
FreeBSD support

from postfix_exporter.

Comments (2)

sgohl avatar sgohl commented on August 11, 2024 1

just confirming it works on FreeBSD with the binary copied from another FreeBSD system where I installed pkg install go and run go install github.com/kumina/postfix_exporter@latest so the actual target system does not need to have go installed.

./postfix_exporter --postfix.logfile_path="/var/log/maillog"

I've stolen the rc-script for /usr/local/etc/rc.d/postfix_exporter from node_exporter:

#!/bin/sh

# PROVIDE: postfix_exporter
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# postfix_exporter_enable (bool):          Set to NO by default.
#               Set it to YES to enable postfix_exporter.
# postfix_exporter_user (string):          Set user that postfix_exporter will run under
#               Default is "nobody".
# postfix_exporter_group (string):         Set group that postfix_exporter will run under
#               Default is "nobody".
# postfix_exporter_args (string):          Set extra arguments to pass to postfix_exporter
#               Default is "".
# postfix_exporter_listen_address (string):Set ip:port that postfix_exporter will listen on
#               Default is ":9154".
# postfix_exporter_textfile_dir (string):  Set directory that postfix_exporter will watch
#               Default is "/var/tmp/postfix_exporter".

. /etc/rc.subr

name=postfix_exporter
rcvar=postfix_exporter_enable

load_rc_config $name

: ${postfix_exporter_enable:="NO"}
: ${postfix_exporter_user:="root"}
: ${postfix_exporter_group:="postfix"}
: ${postfix_exporter_listen_address:=":9154"}
: ${postfix_exporter_textfile_dir:="/var/tmp/postfix_exporter"}
: ${postfix_exporter_logfile_path:="/var/log/maillog"}

pidfile=/var/run/postfix_exporter.pid
command="/usr/sbin/daemon"
procname="/usr/local/bin/postfix_exporter"
command_args="-f -p ${pidfile} -T ${name} \
    /usr/bin/env ${procname} \
    --postfix.logfile_path=${postfix_exporter_logfile_path} \
    --web.listen-address=${postfix_exporter_listen_address}"

start_precmd=postfix_exporter_startprecmd

postfix_exporter_startprecmd()
{
    if [ ! -e ${pidfile} ]; then
        install \
            -o ${postfix_exporter_user} \
            -g ${postfix_exporter_group} \
            /dev/null ${pidfile};
    fi
}

load_rc_config $name
run_rc_command "$1"

from postfix_exporter.

Subito avatar Subito commented on August 11, 2024

Yes, as far as I can tell it compiles and runs fine on FreeBSD. A Port is missing so far, but a simple go get github.com/kumina/postfix_exporter should get you started.

from postfix_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.