1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00

Add new port: fbsdmon

Submit system and ports statistics to fbsdmon.org.
Statistics can be sent from command line, from rc script
or from periodic script.

WWW: http://fbsdmon.org/

PR: ports/164608
Submitted by: Grzegorz Blach <magik at roorback.net>
Approved by:	rene (mentor)
This commit is contained in:
Jason Helfman 2012-02-04 00:56:53 +00:00
parent 4bab1e932a
commit 34a815e881
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=290366
9 changed files with 122 additions and 0 deletions

View File

@ -8,6 +8,7 @@
SUBDIR += bxpkg
SUBDIR += distilator
SUBDIR += fastest_sites
SUBDIR += fbsdmon
SUBDIR += genplist
SUBDIR += gnome-packagekit
SUBDIR += hs-porte

View File

@ -0,0 +1,31 @@
# New ports collection makefile for: fbsdmon
# Date created: 21 January 2012
# Whom: Grzegorz Blach <magik@roorback.net>
#
# $FreeBSD$
#
PORTNAME= fbsdmon
PORTVERSION= 0.90
CATEGORIES= ports-mgmt sysutils
MASTER_SITES= http://files.roorback.net/
MAINTAINER= magik@roorback.net
COMMENT= Sumbit system and ports statistics to fbsdmon.org
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
jansson.6:${PORTSDIR}/devel/jansson \
SUB_FILES= 600.fbsdmon pkg-message
USE_RC_SUBR= fbsdmon
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/fbsdmon ${PREFIX}/sbin
${MKDIR} /var/db/fbsdmon
${MKDIR} ${PREFIX}/etc/periodic/weekly
${INSTALL_SCRIPT} ${WRKDIR}/600.fbsdmon ${PREFIX}/etc/periodic/weekly
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (fbsdmon-0.90.tar.gz) = 5143eb51b241bef6c30e26a5fac54308ca36db76b865da208f33edab92c13b78
SIZE (fbsdmon-0.90.tar.gz) = 3692

View File

@ -0,0 +1,25 @@
#!/bin/sh
#
# $FreeBSD$
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
case "$weekly_fbsdmon_enable" in
[Yy][Ee][Ss])
echo ""
echo "Sending statistic to fbsdmon.org"
%%PREFIX%%/sbin/fbsdmon
rc=$?;;
*) rc=0;;
esac
exit $rc

View File

@ -0,0 +1,30 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: fbsdmon
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable `fbsdmon':
#
# fbsdmon_enable="YES"
#
. /etc/rc.subr
name=fbsdmon
rcvar=fbsdmon_enable
load_rc_config "$name"
: ${fbsdmon_enable="NO"}
pidfile="/var/run/$name.pid"
procname="%%PREFIX%%/sbin/$name"
command="/usr/sbin/daemon"
command_args="-c -f -p $pidfile $procname"
stop_postcmd="/bin/rm -f $pidfile"
run_rc_command "$1"

View File

@ -0,0 +1,11 @@
--- ./src/io.c.orig 2012-01-30 12:34:26.000000000 -0800
+++ ./src/io.c 2012-01-30 12:34:36.000000000 -0800
@@ -47,7 +47,7 @@
extern char* gz_data(char *data)
{
char *fn = strdup("/tmp/fbsdmon.XXXXXX");
- mktemp(fn);
+ mkstemp(fn);
gzFile *gz = gzopen(fn, "wb");
gzputs(gz, data);

View File

@ -0,0 +1,10 @@
To enable weekly reporting, add this line to /etc/periodic.conf:
weekly_fbsdmon_enable="YES"
To enable boottime reporting, add this line to /etc/rc.conf:
fbsdmon_enable="YES"
To run it manually, run command:
%%PREFIX%%/sbin/fbsdmon

View File

@ -0,0 +1,6 @@
Submit system and ports statistics to fbsdmon.org.
Statistics can be sent from command line, from rc script
or from periodic script.
WWW: http://fbsdmon.org/

View File

@ -0,0 +1,6 @@
sbin/fbsdmon
etc/periodic/weekly/600.fbsdmon
@exec mkdir -p /var/db/fbsdmon || true
@unexec rmdir /var/db/fbsdmon 2>/dev/null || true
@dirrmtry etc/periodic/weekly
@dirrmtry etc/periodic