diff options
author | matthew <matthew@FreeBSD.org> | 2014-10-25 00:02:32 +0800 |
---|---|---|
committer | matthew <matthew@FreeBSD.org> | 2014-10-25 00:02:32 +0800 |
commit | 331c49b7f7e31fd91996b36469f1fa5e5e21e96c (patch) | |
tree | a08827f5b8154a0becef4a7059182143922de2ea | |
parent | 8374bab44015b46066ee091a9c710d535cd5c477 (diff) | |
download | freebsd-ports-gnome-331c49b7f7e31fd91996b36469f1fa5e5e21e96c.tar.gz freebsd-ports-gnome-331c49b7f7e31fd91996b36469f1fa5e5e21e96c.tar.zst freebsd-ports-gnome-331c49b7f7e31fd91996b36469f1fa5e5e21e96c.zip |
New port: sd-agent
Server Density Agent for FreeBSD
Monitor CPU, memory, disk usage, network, Apache, MySQL + more via the
ServerDensity platform.
WWW: https://www.serverdensity.com/
-rw-r--r-- | GIDs | 1 | ||||
-rw-r--r-- | UIDs | 1 | ||||
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/sd-agent/Makefile | 44 | ||||
-rw-r--r-- | sysutils/sd-agent/distinfo | 2 | ||||
-rw-r--r-- | sysutils/sd-agent/files/patch-agent.py | 17 | ||||
-rw-r--r-- | sysutils/sd-agent/files/sd-agent.in | 50 | ||||
-rw-r--r-- | sysutils/sd-agent/pkg-descr | 6 | ||||
-rw-r--r-- | sysutils/sd-agent/pkg-plist | 10 |
9 files changed, 132 insertions, 0 deletions
@@ -67,6 +67,7 @@ fetchmail:*:124: postfix:*:125: maildrop:*:126: nav:*:127: +sd-agent:*:128: vlock:*:129: _bgpd:*:130: _ospfd:*:131: @@ -73,6 +73,7 @@ _ntp:*:123:123::0:0:NTP Daemon:/var/empty:/usr/sbin/nologin fetchmail:*:124:124::0:0:Fetchmail mail-retrieval daemon:/nonexistent:/usr/sbin/nologin postfix:*:125:125::0:0:Postfix Mail System:/var/spool/postfix:/usr/sbin/nologin navcron:*:127:127::0:0:Network Administration Visualized:/usr/local/nav:/usr/sbin/nologin +sd-agent:*:128:128::0:0:ServerDensity Agent:/nonexistent:/usr/sbin/nologin _bgpd:*:130:130::0:0:BGP Daemon:/var/empty:/usr/sbin/nologin _ospfd:*:131:131::0:0:OSPF Daemon:/var/empty:/usr/sbin/nologin _spamd:*:132:132::0:0:Spam Daemon:/var/empty:/usr/sbin/nologin diff --git a/sysutils/Makefile b/sysutils/Makefile index 5d77d0c8628f..b508334e7636 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -852,6 +852,7 @@ SUBDIR += screenfetch SUBDIR += screenie SUBDIR += scterc + SUBDIR += sd-agent SUBDIR += sdd SUBDIR += sdparm SUBDIR += searchmonkey diff --git a/sysutils/sd-agent/Makefile b/sysutils/sd-agent/Makefile new file mode 100644 index 000000000000..c17b596d5b35 --- /dev/null +++ b/sysutils/sd-agent/Makefile @@ -0,0 +1,44 @@ +# $FreeBSD$ + +PORTNAME= sd-agent +DISTVERSION= 1.13.4 +CATEGORIES= sysutils + +MAINTAINER= tim@wallago.co.uk +COMMENT= Server Density Agent for FreeBSD + +LICENSE= BSD3CLAUSE + +RUN_DEPENDS= $(LOCALBASE)/sbin/sysinfo:$(PORTSDIR)/sysutils/sysinfo + +USERS= sd-agent +GROUPS= sd-agent + +USE_GITHUB= yes +GH_ACCOUNT= serverdensity +GH_COMMIT= 1bacffa + +USES= python shebangfix +SHEBANG_FILES= agent.py +python_OLD_CMD= /usr/bin/env python + +USE_RC_SUBR= $(PORTNAME) +SUB_LIST+= RCNAME=$(PORTNAME:S/-/_/g) + +NO_ARCH= yes + +INSTALLDIR= $(STAGEDIR)$(PREFIX)/libexec/$(PORTNAME) +FLIST= agent.py checks.py daemon.py logtail.py minjson.py pep8.sh plugins.py sd-deploy.py + +do-build:: + $(SED) -i .bak 's,%%PREFIX%%,$(PREFIX),' $(WRKSRC)/agent.py + +do-install:: + $(MKDIR) $(INSTALLDIR)/plugins +.for f in $(FLIST) + $(INSTALL_SCRIPT) $(WRKSRC)/$f $(INSTALLDIR) +.endfor + $(MKDIR) $(STAGEDIR)$(ETCDIR) + $(INSTALL_DATA) $(WRKSRC)/config.cfg $(STAGEDIR)$(ETCDIR)/config.cfg.sample + +.include <bsd.port.mk> diff --git a/sysutils/sd-agent/distinfo b/sysutils/sd-agent/distinfo new file mode 100644 index 000000000000..52dd821133cb --- /dev/null +++ b/sysutils/sd-agent/distinfo @@ -0,0 +1,2 @@ +SHA256 (sd-agent-1.13.4.tar.gz) = 464f2238e8344d461584cc676af0bfd88851db08ce501e0912150ea0f26795b9 +SIZE (sd-agent-1.13.4.tar.gz) = 50647 diff --git a/sysutils/sd-agent/files/patch-agent.py b/sysutils/sd-agent/files/patch-agent.py new file mode 100644 index 000000000000..25d5ef9282c9 --- /dev/null +++ b/sysutils/sd-agent/files/patch-agent.py @@ -0,0 +1,17 @@ +--- agent.py.orig 2014-10-24 11:01:07 UTC ++++ agent.py +@@ -64,10 +64,10 @@ + + config = ConfigParser.ConfigParser() + +- if os.path.exists('/etc/sd-agent/conf.d/'): +- configPath = '/etc/sd-agent/conf.d/' +- elif os.path.exists('/etc/sd-agent/config.cfg'): +- configPath = '/etc/sd-agent/config.cfg' ++ if os.path.exists('%%PREFIX%%/etc/sd-agent/conf.d/'): ++ configPath = '%%PREFIX%%/etc/sd-agent/conf.d/' ++ elif os.path.exists('%%PREFIX%%/etc/sd-agent/config.cfg'): ++ configPath = '%%PREFIX%%/etc/sd-agent/config.cfg' + else: + configPath = path + '/config.cfg' + diff --git a/sysutils/sd-agent/files/sd-agent.in b/sysutils/sd-agent/files/sd-agent.in new file mode 100644 index 000000000000..c5165a3f1f40 --- /dev/null +++ b/sysutils/sd-agent/files/sd-agent.in @@ -0,0 +1,50 @@ +#!/bin/sh + +# PROVIDE: %%RCNAME%% +# REQUIRE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name=%%RCNAME%% +rcvar=%%RCNAME%%_enable +pidfile="/var/run/sd-agent/sd-agent.pid" +logfile="/var/log/sd-agent/sd-agent.log" + +start_precmd="${name}_prestart" +start_cmd="${name}_start" +stop_cmd="${name}_stop" +status_cmd="${name}_status" + +load_rc_config $name +: ${%%RCNAME%%_enable:=no} + +%%RCNAME%%_user=sd-agent +%%RCNAME%%_group=sd-agent + +command='%%PREFIX%%/libexec/sd-agent/agent.py' + +%%RCNAME%%_prestart() +{ + install -d -o ${%%RCNAME%%_user} -g ${%%RCNAME%%_group} \ + $(dirname $pidfile) + install -d -o ${%%RCNAME%%_user} -g ${%%RCNAME%%_group} \ + $(dirname $logfile) +} + +%%RCNAME%%_start() +{ + su -m ${%%RCNAME%%_user} -c "$command start init" +} + +%%RCNAME%%_stop() +{ + $command stop init +} + +%%RCNAME%%_status() +{ + $command status init +} + +run_rc_command "$1" diff --git a/sysutils/sd-agent/pkg-descr b/sysutils/sd-agent/pkg-descr new file mode 100644 index 000000000000..121868acab51 --- /dev/null +++ b/sysutils/sd-agent/pkg-descr @@ -0,0 +1,6 @@ +Server Density Agent for FreeBSD + +Monitor CPU, memory, disk usage, network, Apache, MySQL + more via the +ServerDensity platform. + +WWW: https://www.serverdensity.com/ diff --git a/sysutils/sd-agent/pkg-plist b/sysutils/sd-agent/pkg-plist new file mode 100644 index 000000000000..9560834c6c5b --- /dev/null +++ b/sysutils/sd-agent/pkg-plist @@ -0,0 +1,10 @@ +@sample %%ETCDIR%%/config.cfg.sample +libexec/sd-agent/agent.py +libexec/sd-agent/checks.py +libexec/sd-agent/daemon.py +libexec/sd-agent/logtail.py +libexec/sd-agent/minjson.py +libexec/sd-agent/pep8.sh +libexec/sd-agent/plugins.py +libexec/sd-agent/sd-deploy.py +@dir libexec/sd-agent/plugins |