diff options
Diffstat (limited to 'net-mgmt/nagios12/files')
-rw-r--r-- | net-mgmt/nagios12/files/DEINSTALL.tmpl | 23 | ||||
-rw-r--r-- | net-mgmt/nagios12/files/INSTALL.tmpl | 67 | ||||
-rw-r--r-- | net-mgmt/nagios12/files/MESSAGE.tmpl | 15 | ||||
-rw-r--r-- | net-mgmt/nagios12/files/nagios.sh.tmpl | 55 | ||||
-rw-r--r-- | net-mgmt/nagios12/files/patch-ad | 32 | ||||
-rw-r--r-- | net-mgmt/nagios12/files/patch-aj | 13 |
6 files changed, 176 insertions, 29 deletions
diff --git a/net-mgmt/nagios12/files/DEINSTALL.tmpl b/net-mgmt/nagios12/files/DEINSTALL.tmpl new file mode 100644 index 000000000000..93ed52b4d017 --- /dev/null +++ b/net-mgmt/nagios12/files/DEINSTALL.tmpl @@ -0,0 +1,23 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +USER=%%NAGIOSUSER%% +GROUP=%%NAGIOSGROUP%% +DIR=%%NAGIOSDIR%% + +if [ "$2" = "POST-DEINSTALL" ]; then + + if /usr/sbin/pw group show "${GROUP}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${GROUP}\" group." + fi + + if /usr/sbin/pw user show "${USER}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${USER}\" user." + fi + + if [ -e ${DIR} ]; then + echo "You should manually remove the \"${DIR}\" directory." + fi +fi diff --git a/net-mgmt/nagios12/files/INSTALL.tmpl b/net-mgmt/nagios12/files/INSTALL.tmpl new file mode 100644 index 000000000000..64e6882bdee2 --- /dev/null +++ b/net-mgmt/nagios12/files/INSTALL.tmpl @@ -0,0 +1,67 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +USER=%%NAGIOSUSER%% +GROUP=%%NAGIOSGROUP%% +DIR=%%NAGIOSDIR%% + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +if [ x"$2" = xPRE-INSTALL ]; then + if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + echo "You need a group \"${GROUP}\"." + if yesno "Would you like me to create it" y; then + /usr/sbin/pw groupadd ${GROUP} -h - || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + echo "You need a user \"${USER}\"." + if yesno "Would you like me to create it" y; then + /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - -d ${DIR} \ + -s /nonexistent -c "Nagios pseudo-user" || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi + +fi diff --git a/net-mgmt/nagios12/files/MESSAGE.tmpl b/net-mgmt/nagios12/files/MESSAGE.tmpl new file mode 100644 index 000000000000..a96b0d6243c3 --- /dev/null +++ b/net-mgmt/nagios12/files/MESSAGE.tmpl @@ -0,0 +1,15 @@ + +******************************************************************* + Enable nagios in /etc/rc.conf with the following line: + + nagios_enable="YES" + + Configuration templates are available in %%PREFIX%%/etc/nagios + as *.cfg-sample files. Copy them to *.cfg and edit them to suit + your needs. Documentation is available in HTML form in + %%PREFIX%%/share/nagios/docs. + + If you don't already have a web server running, you need to install + and configure it to finish your nagios installation. +******************************************************************* + diff --git a/net-mgmt/nagios12/files/nagios.sh.tmpl b/net-mgmt/nagios12/files/nagios.sh.tmpl new file mode 100644 index 000000000000..d3cd0691f819 --- /dev/null +++ b/net-mgmt/nagios12/files/nagios.sh.tmpl @@ -0,0 +1,55 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# Add the following lines to /etc/rc.conf to enable nagios: +# +#nagios_enable="YES" +# + +. %%RC_SUBR%% + +name=nagios +rcvar=`set_rcvar` + +prefix=%%PREFIX%% + +required_files=${prefix}/etc/nagios/nagios.cfg + +NagiosBin=${prefix}/bin/nagios +NagiosCfg=${prefix}/etc/nagios/nagios.cfg +NagiosVar=/var/spool/nagios +NagiosLog=${NagiosVar}/status.log +NagiosTmp=${NagiosVar}/nagios.tmp +NagiosSav=${NagiosVar}/status.sav +NagiosCmd=${NagiosVar}/rw/nagios.cmd +NagiosRun=${NagiosVar}/nagios.lock + +pidfile=${NagiosRun} +command=${NagiosBin} +command_args="-d $NagiosCfg" +nagios_user=nagios + +start_precmd=start_precmd +stop_postcmd=stop_postcmd + +# set defaults + +nagios_enable=${nagios_enable:-"NO"} +nagios_flags=${nagios_flags:-""} + +start_precmd() +{ + su -m ${nagios_user} -c "touch ${NagiosVar}/nagios.log ${NagiosSav}" + rm -f ${NagiosCmd} +} + +stop_postcmd() +{ + rm -f $NagiosLog $NagiosTmp $NagiosRun $NagiosCmd +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net-mgmt/nagios12/files/patch-ad b/net-mgmt/nagios12/files/patch-ad index 10c3db33738b..4518f5907c41 100644 --- a/net-mgmt/nagios12/files/patch-ad +++ b/net-mgmt/nagios12/files/patch-ad @@ -1,5 +1,5 @@ ---- configure.orig Tue Jun 3 12:47:57 2003 -+++ configure Thu Jul 31 16:35:45 2003 +--- configure.orig Tue Feb 3 05:45:08 2004 ++++ configure Wed Feb 4 21:26:46 2004 @@ -11,7 +11,7 @@ ac_help= ac_default_prefix=/usr/local @@ -40,30 +40,30 @@ fi -@@ -2748,14 +2753,14 @@ - fi +@@ -2692,14 +2697,14 @@ - if test x$GDLIBFOUND = x; then -- echo $ac_n "checking for gdImagePng in -lgd (order 3)""... $ac_c" 1>&6 --echo "configure:2753: checking for gdImagePng in -lgd (order 3)" >&5 -+ echo $ac_n "checking for gdImagePng in -lgd1 (order 3)""... $ac_c" 1>&6 -+echo "configure:2753: checking for gdImagePng in -lgd1 (order 3)" >&5 - ac_lib_var=`echo gd'_'gdImagePng'_'3 | sed 'y%./+-%__p_%'` + + +- echo $ac_n "checking for gdImagePng in -lgd (order 1)""... $ac_c" 1>&6 +-echo "configure:2697: checking for gdImagePng in -lgd (order 1)" >&5 ++ echo $ac_n "checking for gdImagePng in -lgd1 (order 1)""... $ac_c" 1>&6 ++echo "configure:2697: checking for gdImagePng in -lgd1 (order 1)" >&5 + ac_lib_var=`echo gd'_'gdImagePng'_'1 | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -- LIBS="-lgd -lpng -lz -lm $LIBS" -+ LIBS="-lgd1 -lz -lm -lpng -ljpeg $LIBS" +- LIBS="-lgd $ICONV -lz -lm -lpng -ljpeg $LIBS" ++ LIBS="-lgd1 $ICONV -lz -lm -lpng -ljpeg $LIBS" cat > conftest.$ac_ext <<EOF - #line 2761 "configure" + #line 2705 "configure" #include "confdefs.h" -@@ -2785,7 +2790,7 @@ +@@ -2729,7 +2734,7 @@ echo "$ac_t""yes" 1>&6 GDLIBFOUND=yep -- GDLIBS="-lgd -lpng -lz -lm" -+ GDLIBS="-lgd1 -lz -lm -lpng" +- GDLIBS="-lgd $ICONV -lz -lm -lpng -ljpeg" ++ GDLIBS="-lgd1 $ICONV -lz -lm -lpng -ljpeg" else echo "$ac_t""no" 1>&6 diff --git a/net-mgmt/nagios12/files/patch-aj b/net-mgmt/nagios12/files/patch-aj deleted file mode 100644 index 06a28e042bdf..000000000000 --- a/net-mgmt/nagios12/files/patch-aj +++ /dev/null @@ -1,13 +0,0 @@ ---- cgi/tac.c.orig Mon May 12 06:18:56 2003 -+++ cgi/tac.c Sat Aug 2 16:24:23 2003 -@@ -1220,10 +1220,8 @@ - printf("</table>\n"); - printf("</td>\n"); - -- /* - printf("</tr>\n"); - printf("</table>\n"); -- */ - - printf("</td>\n"); - |