dot

packages and services management
Log | Files | Refs | README

commit caa5d803c95da72f9faaec542dec4a75491a39fe
parent 1e5f31a77fa40ebac9a5e1f8767ae1f722089d75
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Mon, 24 Jul 2017 16:09:47 +0200

dma: fixed build and added some configuration

Diffstat:
Mbin/monitor | 14+++++++-------
Mdma/build | 20++++++++++++++++++--
Adma/dma.conf | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 91 insertions(+), 9 deletions(-)

diff --git a/bin/monitor b/bin/monitor @@ -20,26 +20,26 @@ esac vmstat 2 2 | awk -v mem="$mem" -v cpu="$cpu" -v bi="$bi" -v bo="$bo" ' BEGIN { - "date +%Y-%m-%d-%H-%M" | getline date - "hostname" | getline host - "uptime" | getline load + "date +%s" | getline date + "hostname" | getline host + "uptime" | getline load sub(/.*[Ll]oad[^0-9]*/, "", load) sub(/[^0-9.].*/, "", load) while ("df" | getline) - if ($1 ~ "^/dev/" || $1 = "zroot") stor += $4 + if ($1 ~ "^/dev/" || $1 == "zroot") stor += $4 } NR == 2 { - split($0, keys, " ") + split($0, keys) for (key in keys) if (keys[key] ~ /0$/) disks[i++] = keys[key] } NR >= 4 { - for (i = split($0, values, " "); i > 0; i--) + for (i = 1 + split($0, values); i > 0; i--) table[keys[i]] = values[i] mem = table[mem] @@ -48,7 +48,7 @@ NR >= 4 { diskio = table[bi] + table[bo] for (disk in disks) - diskio += table[diskv[disk]] + diskio += table[disks[disk]] print host " " date " " mem " " cpu " " load " " diskio " " stor }' >> "$VAR/stat/now" diff --git a/dma/build b/dma/build @@ -1,3 +1,19 @@ +mkdir -p "$PREFIX/bin" "$PREFIX/share/man/man8" "$VAR/spool/dma" + case "$(uname)" in -(Linux) make ;; -(*BSD) cd bsd && make && cd .. ;; +(*BSD ) + cd bsd + make PREFIX="$PREFIX" CONFDIR="$ETC/dma" VAR="$VAR" \ + CFLAGS+="-I$OPT/libopenssl/include" \ + LDFLAGS+="-L$OPT/libopenssl/lib" + cp dma/dma "$PREFIX/bin/dma" + cp ../dma.8 "$PREFIX/share/man/man8" + ;; +(Linux) + make PREFIX="$PREFIX" CONFDIR="$ETC/dma" VAR="$VAR" \ + CFLAGS+="-I$OPT/libopenssl/include" \ + LDFLAGS+="-L$OPT/libopenssl/lib" + cp dma "$PREFIX/bin/dma" + cp dma.8 "$PREFIX/share/man/man8" + ;; +esac diff --git a/dma/dma.conf b/dma/dma.conf @@ -0,0 +1,66 @@ +# $DragonFly: src/etc/dma/dma.conf,v 1.2 2008/02/04 10:11:41 matthias Exp $ +# +# Your smarthost (also called relayhost). Leave blank if you don't want +# smarthost support. +# NOTE: on Debian systems this is handled via debconf! +# Please use dpkg-reconfigure dma to change this value. +#SMARTHOST + +# Use this SMTP port. Most users will be fine with the default (25) +PORT 25 + +# Path to your alias file. Just stay with the default. +#ALIASES /etc/aliases + +# Path to your spooldir. Just stay with the default. +SPOOLDIR /home/josuah/var/spool/dma + +# SMTP authentication +#AUTHPATH /etc/dma/auth.conf + +# Uncomment if yout want TLS/SSL support +#SECURETRANSFER + +# Uncomment if you want STARTTLS support (only used in combination with +# SECURETRANSFER) +#STARTTLS + +# Uncomment if you have specified STARTTLS above and it should be allowed +# to fail ("opportunistic TLS", use an encrypted connection when available +# but allow an unencrypted one to servers that do not support it) +#OPPORTUNISTIC_TLS + +# Path to your local SSL certificate +#CERTFILE + +# If you want to use plain text SMTP login without using encryption, change +# the SECURE entry below to INSECURE. Otherwise plain login will only work +# over a secure connection. Use this option with caution. +#SECURE + +# Uncomment if you want to defer your mails. This is useful if you are +# behind a dialup line. You have to submit your mails manually with dma -q +#DEFER + +# Uncomment if you want the bounce message to include the complete original +# message, not just the headers. +#FULLBOUNCE + +# The internet hostname dma uses to identify the host. +# If not set or empty, the result of gethostname(2) is used. +# If MAILNAME is an absolute path to a file, the first line of this file +# will be used as the hostname. +MAILNAME mail.gandi.net + +# Masquerade envelope from addresses with this address/hostname. +# Use this if mails are not accepted by destination mail servers because +# your sender domain is invalid. +# By default, MASQUERADE is not set. +# Format: MASQUERADE [user@][host] +# Examples: +# MASQUERADE john@ on host "hamlet" will send all mails as john@hamlet +# MASQUERADE percolator will send mails as $username@percolator, e.g. fish@percolator +# MASQUERADE herb@ert will send all mails as herb@ert + +# Directly forward the mail to the SMARTHOST bypassing aliases and local delivery +#NULLCLIENT