1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

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/
This commit is contained in:
Matthew Seaman 2014-10-24 16:02:32 +00:00
parent f95caca6e3
commit 79260ee9b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=371446
9 changed files with 132 additions and 0 deletions

1
GIDs
View File

@ -67,6 +67,7 @@ fetchmail:*:124:
postfix:*:125:
maildrop:*:126:
nav:*:127:
sd-agent:*:128:
vlock:*:129:
_bgpd:*:130:
_ospfd:*:131:

1
UIDs
View File

@ -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

View File

@ -852,6 +852,7 @@
SUBDIR += screenfetch
SUBDIR += screenie
SUBDIR += scterc
SUBDIR += sd-agent
SUBDIR += sdd
SUBDIR += sdparm
SUBDIR += searchmonkey

View File

@ -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>

View File

@ -0,0 +1,2 @@
SHA256 (sd-agent-1.13.4.tar.gz) = 464f2238e8344d461584cc676af0bfd88851db08ce501e0912150ea0f26795b9
SIZE (sd-agent-1.13.4.tar.gz) = 50647

View File

@ -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'

View File

@ -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"

View File

@ -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/

View File

@ -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