diff options
author | Jeremy Chadwick <koitsu@FreeBSD.org> | 2008-09-23 02:02:16 +0000 |
---|---|---|
committer | Jeremy Chadwick <koitsu@FreeBSD.org> | 2008-09-23 02:02:16 +0000 |
commit | 63e4fa118fb6f87fafc22375ffc8187e4805a02c (patch) | |
tree | 10dc23951feff7e065812d709bf807a9a2479eeb /net-mgmt/rrdbot/files | |
parent | f69e13fbb82276aaf1e4d1a9c781e96c2e8f89a1 (diff) |
Notes
Diffstat (limited to 'net-mgmt/rrdbot/files')
-rw-r--r-- | net-mgmt/rrdbot/files/patch-parse.c | 43 | ||||
-rw-r--r-- | net-mgmt/rrdbot/files/pkg-message.in | 32 | ||||
-rw-r--r-- | net-mgmt/rrdbot/files/rrdbot.in | 36 |
3 files changed, 111 insertions, 0 deletions
diff --git a/net-mgmt/rrdbot/files/patch-parse.c b/net-mgmt/rrdbot/files/patch-parse.c new file mode 100644 index 000000000000..effce6121719 --- /dev/null +++ b/net-mgmt/rrdbot/files/patch-parse.c @@ -0,0 +1,43 @@ +--- mib/parse.c.orig 2007-05-26 17:42:33.000000000 -0700 ++++ mib/parse.c 2008-09-18 10:42:58.000000000 -0700 +@@ -4516,20 +4516,17 @@ + int + add_mibdir(const char *dirname) + { +- FILE *fp, *ip; ++ FILE *fp; + DIR *dir, *dir2; + const char *oldFile = File; + struct dirent *file; + char token[MAXTOKEN], token2[MAXTOKEN]; +- char tmpstr[300]; ++ char tmpstr[MAXPATHLEN]; + int count = 0; + + DEBUGMSGTL(("parse-mibs", "Scanning directory %s\n", dirname)); + + if ((dir = opendir(dirname))) { +- snprintf(tmpstr, sizeof(tmpstr), "%s/.index", dirname); +- tmpstr[ sizeof(tmpstr)-1 ] = 0; +- ip = fopen(tmpstr, "w"); + while ((file = readdir(dir))) { + /* + * Only parse file names not beginning with a '.' +@@ -4561,8 +4558,6 @@ + if (get_token(fp, token2, MAXTOKEN) == DEFINITIONS) { + new_module(token, tmpstr); + count++; +- if (ip) +- fprintf(ip, "%s %s\n", token, file->d_name); + } + fclose(fp); + } +@@ -4570,8 +4565,6 @@ + } + File = oldFile; + closedir(dir); +- if (ip) +- fclose(ip); + return (count); + } + return (-1); diff --git a/net-mgmt/rrdbot/files/pkg-message.in b/net-mgmt/rrdbot/files/pkg-message.in new file mode 100644 index 000000000000..801e82d07886 --- /dev/null +++ b/net-mgmt/rrdbot/files/pkg-message.in @@ -0,0 +1,32 @@ + +Post-Installation Procedure +=========================== +Before starting the rrdbot daemon for the first time, you need to +perform some necessary steps: + +1. Create configuration file(s) of what you wish to monitor, and + and place them in %%PREFIX%%/etc/rrdbot +2. Create the RRD files based on the above configuration file(s), + using %%PREFIX%%/sbin/rrdbot-create + +When creating your rrdbot configuration files which use the "archive" +feature, be sure your archive durations are correct mathematically +when compared to the actual SNMP polling interval. For example, +assuming your SNMP polling interval is 30: + + 6/minute -- won't work (6*30 = 180 seconds) + 2/minute -- will work (2*30 = 60 seconds) + +Otherwise you'll receive this kind of warning when using rrdbot-create: + + rrdbot-create: my.conf: archive has too many data points for polling interval. ignoring + +Once you've followed these steps, you can start the daemon by setting +rrdbot_enable="yes" in rc.conf, and then execute: + + %%PREFIX%%/etc/rc.d/rrdbot start + +If you forgot to run rrdbot-create, rrdbotd will start but will silently +fail when trying to write data to the non-existent RRD. So please be +sure to follow the above! + diff --git a/net-mgmt/rrdbot/files/rrdbot.in b/net-mgmt/rrdbot/files/rrdbot.in new file mode 100644 index 000000000000..07e586852360 --- /dev/null +++ b/net-mgmt/rrdbot/files/rrdbot.in @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: rrdbot +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable rrdbot: +# rrdbot_enable (bool): Set to "NO" by default. +# Set it to "YES" to start rrdbotd. +# rrdbot_pidfile (str): pidfile location for rrdbotd. +# Defaults to "/var/run/rrdbotd.pid". +# rrdbot_flags (str): Custom command-line flags to be passed +# to rrdbotd (default: none). +# + +. %%RC_SUBR%% + +name="rrdbot" +rcvar=`set_rcvar` + +load_rc_config $name + +: ${rrdbot_enable="NO"} +: ${rrdbot_pidfile="/var/run/rrdbotd.pid"} +: ${rrdbot_flags=""} + +pidfile="${rrdbot_pidfile}" + +command="%%PREFIX%%/sbin/rrdbotd" +command_args="-p ${rrdbot_pidfile} ${rrdbot_flags}" + +run_rc_command "$1" |