Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

2
net/nagios-plugins/DESCR Normal file
View File

@@ -0,0 +1,2 @@
This package contains the basic monitoring plugins for nagios. For
more information about nagios, see the 'nagios-base' package.

View File

@@ -0,0 +1,65 @@
# $NetBSD: Makefile,v 1.33 2013/05/31 12:41:35 wiz Exp $
#
PKGREVISION= 6
CATEGORIES= net sysutils
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://sourceforge.net/projects/nagiosplug/
COMMENT= Nagios plugins
LICENSE= gnu-gpl-v2
PKG_DESTDIR_SUPPORT= destdir
.include "../../net/nagios-plugins/Makefile.common"
.include "../../mk/bsd.prefs.mk"
USE_TOOLS+= perl:run
PKG_GROUPS+= ${NAGIOS_GROUP}
BUILD_DEFS+= ${NAGIOS_GROUP}
CONFIGURE_ARGS+= --without-pgsql --without-mysql \
--without-smbclient-command --without-snmpget-command \
--without-snmpgetnext-command --without-fping-command
SPECIAL_PERMS+= ${PREFIX}/libexec/nagios/check_icmp ${SETUID_ROOT_PERMS}
SPECIAL_PERMS+= ${PREFIX}/libexec/nagios/check_dhcp ${SETUID_ROOT_PERMS}
PLIST_VARS+= linux sunos NetBSD
.if ${OPSYS} == "Linux"
PLIST.linux= yes
.elif ${OPSYS} == "SunOS"
PLIST.sunos= yes
.elif ${OPSYS} == "NetBSD"
PLIST.NetBSD= yes
.endif
.if ${OPSYS} == "NetBSD"
CONFIGURE_ARGS+= --with-df-command="/bin/df -Pklt nokernfs,procfs,fdesc"
SPECIAL_PERMS+= ${PREFIX}/libexec/nagios/check_ide_smart \
${REAL_ROOT_USER} ${NAGIOS_GROUP} 4551
.endif
# required to enable large file support on Solaris
.if ${OPSYS} == "SunOS"
CPPFLAGS_LFS!= getconf LFS_CFLAGS
MAKE_ENV+= CPPFLAGS_LFS=${CPPFLAGS_LFS:Q}
.endif
LIBS.SunOS+= -lm
#DEPENDS+= nagios-base-*:../../net/nagios-base
.if !exists(/usr/bin/ssh)
DEPENDS+= {ssh{,6}-[0-9]*,openssh-[0-9]*}:../../security/openssh
.endif
.if (!exists(/usr/bin/dig) && !exists(/usr/sbin/dig)) || \
(!exists(/usr/bin/nslookup) && !exists(/usr/sbin/nslookup))
DEPENDS+= bind-[0-9]*:../../net/bind96
.endif
.include "../../security/openssl/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,25 @@
# $NetBSD: Makefile.common,v 1.10 2012/07/25 12:01:54 fhajny Exp $
#
# used by net/nagios-plugin-mysql/Makefile
# used by net/nagios-plugin-pgsql/Makefile
# used by net/nagios-plugin-radius/Makefile
# used by net/nagios-plugin-snmp/Makefile
# used by net/nagios-plugins/Makefile
PLUGINSVERSION= 1.4.15
DISTNAME= nagios-plugins-${PLUGINSVERSION}
MASTER_SITES?= ${MASTER_SITE_SOURCEFORGE:=nagiosplug/}
.include "../../net/nagios-base/Makefile.common"
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "DragonFly"
CONFIGURE_ARGS+= fu_cv_sys_stat_statvfs=no
.endif
CONFIGURE_ARGS+= --with-nagios-user=${NAGIOS_USER:Q}
CONFIGURE_ARGS+= --with-nagios-group=${NAGIOS_GROUP:Q}
CONFIGURE_ARGS+= --datarootdir=${PREFIX}/share/nagios
CONFIGURE_ENV+= MACHINE_ARCH=${MACHINE_ARCH}

View File

@@ -0,0 +1,32 @@
# $NetBSD: Makefile.plugin,v 1.4 2011/04/08 22:56:12 morr Exp $
#
INSTALLATION_DIRS+= libexec/nagios
do-build:
cd ${WRKSRC}/lib && ${SETENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE}
cd ${WRKSRC}/gl && ${SETENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE}
.if ${BINARY_TARGET:D1}
cd ${WRKSRC}/plugins && ${SETENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE} ${BINARY_TARGET}
.endif
.if ${SCRIPT_TARGET:D1}
cd ${WRKSRC}/plugins-scripts && ${SETENV} ${MAKE_ENV} \
${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE} ${SCRIPT_TARGET}
.endif
do-install:
.if ${BINARY_TARGET:D1}
for PROG in ${BINARY_TARGET}; do \
${INSTALL_PROGRAM} ${WRKSRC}/plugins/$${PROG} \
${DESTDIR}${PREFIX}/libexec/nagios; \
done
.endif
.if ${SCRIPT_TARGET:D1}
for PROG in ${SCRIPT_TARGET}; do \
${INSTALL_SCRIPT} ${WRKSRC}/plugins-scripts/$${PROG} \
${DESTDIR}${PREFIX}/libexec/nagios; \
done
.endif

53
net/nagios-plugins/PLIST Normal file
View File

@@ -0,0 +1,53 @@
@comment $NetBSD: PLIST,v 1.9 2013/01/19 09:59:12 manu Exp $
libexec/nagios/check_by_ssh
libexec/nagios/check_clamd
libexec/nagios/check_dhcp
libexec/nagios/check_dig
libexec/nagios/check_disk
libexec/nagios/check_dns
libexec/nagios/check_dummy
libexec/nagios/check_file_age
libexec/nagios/check_ftp
libexec/nagios/check_http
libexec/nagios/check_icmp
${PLIST.linux}libexec/nagios/check_ide_smart
${PLIST.NetBSD}libexec/nagios/check_ide_smart
libexec/nagios/check_imap
libexec/nagios/check_ircd
libexec/nagios/check_jabber
libexec/nagios/check_load
libexec/nagios/check_log
libexec/nagios/check_mailq
libexec/nagios/check_mrtg
libexec/nagios/check_mrtgtraf
libexec/nagios/check_nagios
libexec/nagios/check_nntp
libexec/nagios/check_nntps
libexec/nagios/check_ntp
libexec/nagios/check_ntp_peer
libexec/nagios/check_ntp_time
libexec/nagios/check_nwstat
libexec/nagios/check_overcr
libexec/nagios/check_ping
libexec/nagios/check_pop
libexec/nagios/check_procs
libexec/nagios/check_real
libexec/nagios/check_rpc
libexec/nagios/check_simap
libexec/nagios/check_smtp
libexec/nagios/check_spop
libexec/nagios/check_ssh
libexec/nagios/check_ssmtp
libexec/nagios/check_swap
libexec/nagios/check_tcp
libexec/nagios/check_time
libexec/nagios/check_udp
libexec/nagios/check_ups
libexec/nagios/check_users
libexec/nagios/negate
${PLIST.sunos}libexec/nagios/pst3
libexec/nagios/urlize
libexec/nagios/utils.pm
libexec/nagios/utils.sh
share/nagios/locale/de/LC_MESSAGES/nagios-plugins.mo
share/nagios/locale/fr/LC_MESSAGES/nagios-plugins.mo

View File

@@ -0,0 +1,19 @@
$NetBSD: distinfo,v 1.13 2013/01/19 09:59:12 manu Exp $
SHA1 (nagios-plugins-1.4.15.tar.gz) = 1faab309c06d37e559490fd852ecb0dc8a8ab610
RMD160 (nagios-plugins-1.4.15.tar.gz) = c2780a3523cf4eaaed34a94c07f5f6bd6fb1f736
Size (nagios-plugins-1.4.15.tar.gz) = 2095419 bytes
SHA1 (patch-ab) = fdde9e8e98f222ab7e24adea205ce402bd64342d
SHA1 (patch-ad) = 1418682ff599f91aa01a1eeb90f11c9e571212c8
SHA1 (patch-ae) = 9975dfe9e7a1e448fe273ccb8427dcf3a74e195f
SHA1 (patch-af) = c63176a78c7f73730c9f2ef3877b274f99be5dfa
SHA1 (patch-ah) = c4f579b9f9971c44252eaea9a40775a2fcf23638
SHA1 (patch-ai) = 2e045b6c10b06703772d0b9156b2e2f81aa4402b
SHA1 (patch-ak) = dd9aba7a0930a6448e372b581ba04d62018a973b
SHA1 (patch-al) = 63e28ae36d671e773acfe6aeb45ab7603c112594
SHA1 (patch-am) = adc95ba1037a7d7caab6dde6ca1e27e47754db62
SHA1 (patch-an) = 372a111ed040114479e363e42d66e2281d0d629f
SHA1 (patch-configure) = 16eec1d6b42401184ef4892a68353c476cc63cc5
SHA1 (patch-configure.in) = 7db3d0ac3bbb6c1f6b05a5a3e9e4813a9635aecf
SHA1 (patch-plugins__check_swap.c) = d7557d1e6823e8bfeb02706ba914685c564bfdea
SHA1 (patch-plugins_check_ide_smart.c) = 9eccab59931bbfe102f1166be36c6939a6e3a1ae

View File

@@ -0,0 +1,160 @@
$NetBSD: patch-ab,v 1.8 2012/07/25 12:01:55 fhajny Exp $
--- configure.orig 2010-07-27 20:48:13.000000000 +0000
+++ configure
@@ -14688,7 +14688,7 @@ _ACEOF
fi
-if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
+if false; then
EXTRAS="$EXTRAS check_radius"
RADIUSLIBS="-lradiusclient"
@@ -14843,7 +14843,7 @@ _ACEOF
fi
-if test "$ac_cv_lib_ldap_main" = "yes"; then
+if false; then
LDAPLIBS="-lldap -llber"\
LDAPINCLUDE="-I/usr/include/ldap"
@@ -18068,7 +18068,7 @@ elif test "$ac_cv_uname_s" = "SunOS"; th
ac_cv_ps_cols=9
{ echo "$as_me:$LINENO: result: using nagios-plugins internal ps command (pst3) for solaris" >&5
echo "${ECHO_T}using nagios-plugins internal ps command (pst3) for solaris" >&6; }
- if test `isainfo -b` = 64 ; then
+ if test "$MACHINE_ARCH" = "x86_64" ; then
pst3_use_64bit=1
{ echo "$as_me:$LINENO: using 64bit pst3" >&5
echo "$as_me: using 64bit pst3" >&6;}
@@ -19037,7 +19037,7 @@ fi
then
{ echo "$as_me:$LINENO: checking for nslookup syntax" >&5
echo $ECHO_N "checking for nslookup syntax... $ECHO_C" >&6; }
- if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep "Invalid option: sil" >/dev/null
+ if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | fgrep "Invalid option: sil" >/dev/null
then
ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
{ echo "$as_me:$LINENO: result: $ac_cv_nslookup_command" >&5
@@ -19260,7 +19260,7 @@ echo "${ECHO_T}no" >&6; }
fi
-if test -x "$PATH_TO_LMSTAT"
+if false
then
cat >>confdefs.h <<_ACEOF
@@ -19431,7 +19431,7 @@ if test "${with_snmpget_command+set}" =
withval=$with_snmpget_command; PATH_TO_SNMPGET=$withval
fi
-if test -n "$PATH_TO_SNMPGET"
+if test -n "$PATH_TO_SNMPGET" -a "$PATH_TO_SNMPGET" != "no"
then
cat >>confdefs.h <<_ACEOF
@@ -19490,7 +19490,7 @@ if test "${with_snmpgetnext_command+set}
withval=$with_snmpgetnext_command; PATH_TO_SNMPGETNEXT=$withval
fi
-if test -n "$PATH_TO_SNMPGETNEXT"
+if test -n "$PATH_TO_SNMPGETNEXT" -a "$PATH_TO_SNMPGETNEXT" != "no"
then
cat >>confdefs.h <<_ACEOF
@@ -19499,7 +19499,7 @@ _ACEOF
fi
-if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
+if false
then
{ echo "$as_me:$LINENO: checking for Net::SNMP perl module" >&5
echo $ECHO_N "checking for Net::SNMP perl module... $ECHO_C" >&6; }
@@ -19666,7 +19666,7 @@ if test "${with_fping_command+set}" = se
withval=$with_fping_command; PATH_TO_FPING=$withval
fi
-if test -n "$PATH_TO_FPING"
+if test -n "$PATH_TO_FPING" -a "$PATH_TO_FPING" != "no"
then
cat >>confdefs.h <<_ACEOF
@@ -20200,6 +20200,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
@@ -20258,6 +20262,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -20333,6 +20341,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
@@ -20400,6 +20412,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
@@ -20468,6 +20484,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -20514,6 +20534,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -20882,7 +20906,7 @@ if test -n "$PATH_TO_APTGET" ; then
fi
-if test -f $srcdir/plugins/check_nt.c ; then
+if false ; then
EXTRAS="$EXTRAS check_nt"
fi

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-ad,v 1.4 2011/04/08 22:56:12 morr Exp $
--- plugins-scripts/Makefile.in.orig 2010-07-27 20:48:10.000000000 +0000
+++ plugins-scripts/Makefile.in
@@ -963,15 +963,11 @@ top_srcdir = @top_srcdir@
with_trusted_path = @with_trusted_path@
@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@
SUFFIXES = .pl .sh
-libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \
- check_log check_oracle check_rpc check_sensors check_wave \
- check_ifstatus check_ifoperstatus check_mailq check_file_age \
- utils.sh utils.pm
-
-EXTRA_DIST = check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \
- check_log.sh check_ntp.pl check_oracle.sh check_rpc.pl check_sensors.sh \
- check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \
- utils.sh.in utils.pm.in t
+libexec_SCRIPTS = check_ircd check_log check_ntp check_rpc check_mailq \
+ check_file_age utils.sh utils.pm
+
+EXTRA_DIST = check_ircd.pl check_log.sh check_ntp.pl check_rpc.pl \
+ check_mailq.pl check_file_age.pl utils.sh.in utils.pm.in t
TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
TESTS = @SCRIPT_TEST@

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ae,v 1.5 2011/04/08 22:56:12 morr Exp $
--- plugins/Makefile.am.orig 2010-07-27 20:47:16.000000000 +0000
+++ plugins/Makefile.am
@@ -170,7 +170,7 @@ install-exec-hook:
cd $(DESTDIR)$(libexecdir) && \
for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done ;\
if [ -x check_ldap ] ; then rm -f check_ldaps ; ln -s check_ldap check_ldaps ; fi
-
+
clean-local:
rm -f $(check_tcp_programs)
rm -f NP-VERSION-FILE

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-af,v 1.5 2011/04/08 22:56:12 morr Exp $
--- plugins/Makefile.in.orig 2010-07-27 20:48:10.000000000 +0000
+++ plugins/Makefile.in
@@ -31,7 +31,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-libexec_PROGRAMS = check_apt$(EXEEXT) check_cluster$(EXEEXT) \
+libexec_PROGRAMS = \
check_disk$(EXEEXT) check_dummy$(EXEEXT) check_http$(EXEEXT) \
check_load$(EXEEXT) check_mrtg$(EXEEXT) \
check_mrtgtraf$(EXEEXT) check_ntp$(EXEEXT) \
@@ -1778,7 +1778,7 @@ $(check_tcp_programs): check_tcp
install-exec-hook:
cd $(DESTDIR)$(libexecdir) && \
for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done ;\
- if [ -x check_ldap ] ; then rm -f check_ldaps ; ln -s check_ldap check_ldaps ; fi
+# if [ -x check_ldap ] ; then rm -f check_ldaps ; ln -s check_ldap check_ldaps ; fi
clean-local:
rm -f $(check_tcp_programs)

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-ah,v 1.3 2011/04/08 22:56:12 morr Exp $
--- plugins-scripts/check_ntp.pl.orig 2010-07-27 20:47:16.000000000 +0000
+++ plugins-scripts/check_ntp.pl
@@ -311,6 +311,7 @@ if ($have_ntpq) {
} else {
$jitter_error = $ERRORS{'OK'};
}
+ last;
} else {
print "No match!\n" if $verbose;
$jitter = '(not parsed)';

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-ai,v 1.2 2011/04/08 22:56:12 morr Exp $
--- plugins-scripts/subst.in.orig 2010-07-27 20:47:16.000000000 +0000
+++ plugins-scripts/subst.in
@@ -9,13 +9,14 @@ function which(c,path) {
sub(/\/.*\//,"",c);
for (dir in path) {
+ if (match(path[dir], /.tools/ ) != 0 ) {
+ continue;
+ }
cmd = "test -x " path[dir] "/" c;
if (system(cmd)==0) {
return path[dir] "/" c;
}
}
-
-
return c;
}

View File

@@ -0,0 +1,70 @@
$NetBSD: patch-ak,v 1.4 2011/04/08 22:56:12 morr Exp $
--- gl/mountlist.c.orig 2010-07-27 20:47:15.000000000 +0000
+++ gl/mountlist.c
@@ -52,7 +52,11 @@
# if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
# define FS_TYPE(Ent) ((Ent).f_fstypename)
# else
-# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
+# ifdef STAT_STATVFS
+# define FS_TYPE(Ent) mnt_names[(Ent).f_fsid]
+# else
+# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
+# endif
# endif
#endif /* MOUNTED_GETFSSTAT */
@@ -99,6 +103,10 @@
# include <sys/statfs.h>
#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+
#ifdef MOUNTED_LISTMNTENT
# include <mntent.h>
#endif
@@ -169,7 +177,7 @@
#if MOUNTED_GETMNTINFO
-# if ! HAVE_STRUCT_STATFS_F_FSTYPENAME
+# if ! HAVE_STRUCT_STATFS_F_FSTYPENAME && ! STAT_STATVFS
static char *
fstype_to_string (short int t)
{
@@ -266,9 +274,13 @@ fstype_to_string (short int t)
# endif
static char *
+#ifdef STAT_STATVFS
+fsp_to_string (const struct statvfs *fsp)
+#else
fsp_to_string (const struct statfs *fsp)
+#endif
{
-# if HAVE_STRUCT_STATFS_F_FSTYPENAME
+# if defined HAVE_STRUCT_STATFS_F_FSTYPENAME || defined STAT_STATVFS
return (char *) (fsp->f_fstypename);
# else
return fstype_to_string (fsp->f_type);
@@ -592,9 +604,17 @@ read_file_system_list (bool need_fs_type
{
int numsys, counter;
size_t bufsize;
+#ifdef STAT_STATVFS
+ struct statvfs *stats;
+#else
struct statfs *stats;
+#endif
+#ifdef STAT_STATVFS
+ numsys = getfsstat ((struct statvfs *)0, 0L, MNT_NOWAIT);
+#else
numsys = getfsstat ((struct statfs *)0, 0L, MNT_NOWAIT);
+#endif
if (numsys < 0)
return (NULL);
if (SIZE_MAX / sizeof *stats <= numsys)

View File

@@ -0,0 +1,92 @@
$NetBSD: patch-al,v 1.3 2011/04/08 22:56:12 morr Exp $
--- contrib/check_axis.sh.orig 2010-07-27 20:47:15.000000000 +0000
+++ contrib/check_axis.sh
@@ -5,7 +5,7 @@ port=$2
usr=$3
pass=$4
-if [ ! "$#" == "4" ]; then
+if [ ! "$#" = "4" ]; then
echo -e "\nYou did not supply enough command line arguments. \nUsage: ./check_axis.sh <host> <port> <username> <password> \n \nCheck_axis.sh checks the status of LPT ports on Axis print servers. \nIt was written by Tom De Blende (tom.deblende@village.uunet.be) in 2002. \n" && exit "3"
fi
@@ -27,7 +27,7 @@ fi
lines=`cat $tempfile | grep -i $port`
status=`echo $lines | awk '{ print $3 }'`
-if [ "$status" == "Printing" ]; then
+if [ "$status" = "Printing" ]; then
bytes=`echo $lines | awk '{ print $4 }'`;
comments=`echo $lines | tr -d "
" | awk '{ print $5 " " $6 }'`;
@@ -42,48 +42,48 @@ if [ "$comma" -eq "1" ]; then
fi
-if [ "$status" == "Available" ]; then
- if [ "$comments" == "Paper out" ]; then
+if [ "$status" = "Available" ]; then
+ if [ "$comments" = "Paper out" ]; then
exit="1" && stdio="WARNING - Out of paper.";
- elif [ "$comments" == " " ]; then
+ elif [ "$comments" = " " ]; then
exit="0" && stdio="OK - Printer is available but returns no comments.";
- elif [ "$comments" == "No error" ]; then
+ elif [ "$comments" = "No error" ]; then
exit="0" && stdio="OK - No error.";
- elif [ "$comments" == "Ready " ]; then
+ elif [ "$comments" = "Ready " ]; then
exit="0" && stdio="OK - Ready.";
- elif [ "$comments" == "Off line" ]; then
+ elif [ "$comments" = "Off line" ]; then
exit="1" && stdio="WARNING - Printer is off line.";
- elif [ "$comments" == "Out of" ]; then
+ elif [ "$comments" = "Out of" ]; then
exit="1" && stdio="WARNING - Out of paper.";
- elif [ "$comments" == "Busy Out" ]; then
+ elif [ "$comments" = "Busy Out" ]; then
exit="1" && stdio="WARNING - Busy, out of paper.";
- elif [ "$comments" == "Printer off-line" ]; then
+ elif [ "$comments" = "Printer off-line" ]; then
exit="1" && stdio="WARNING - Printer is off line.";
- elif [ "$comments" == "Printer fault" ]; then
+ elif [ "$comments" = "Printer fault" ]; then
exit="2" && stdio="CRITICAL - Printer fault.";
else
exit="3" && stdio="Comments: $comments";
fi
-elif [ "$status" == "Printing" ]; then
- if [ "$comments" == "Printer busy" ]; then
+elif [ "$status" = "Printing" ]; then
+ if [ "$comments" = "Printer busy" ]; then
exit="0" && stdio="OK - PRINTING. Bytes printed: $bytes.";
- elif [ "$comments" == "No error" ]; then
+ elif [ "$comments" = "No error" ]; then
exit="0" && stdio="OK - PRINTING. Bytes printed: $bytes.";
- elif [ "$comments" == "Paper out" ]; then
+ elif [ "$comments" = "Paper out" ]; then
exit="1" && stdio="WARNING - PRINTING. Out of paper.";
- elif [ "$comments" == "Out of" ]; then
+ elif [ "$comments" = "Out of" ]; then
exit="1" && stdio="WARNING - PRINTING. Out of paper. Bytes printed: $bytes.";
- elif [ "$comments" == "Busy Out" ]; then
+ elif [ "$comments" = "Busy Out" ]; then
exit="1" && stdio="WARNING - Busy, out of paper.";
- elif [ "$comments" == "Ready " ]; then
+ elif [ "$comments" = "Ready " ]; then
exit="0" && stdio="OK - PRINTING. Bytes printed: $bytes.";
- elif [ "$comments" == "Printer off-line" ]; then
+ elif [ "$comments" = "Printer off-line" ]; then
exit="1" && stdio="WARNING - PRINTING. Printer is off line.";
- elif [ "$comments" == "Busy " ]; then
+ elif [ "$comments" = "Busy " ]; then
exit="0" && stdio="OK - PRINTING. Busy. Bytes printed: $bytes.";
- elif [ "$comments" == "Off line" ]; then
+ elif [ "$comments" = "Off line" ]; then
exit="1" && stdio="WARNING - PRINTING. Printer is off line.";
- elif [ "$comments" == "Printer fault" ]; then
+ elif [ "$comments" = "Printer fault" ]; then
exit="2" && stdio="CRITICAL - PRINTING. Printer fault. Bytes printed: $bytes.";
else
exit="3" && stdio="Comments: $comments.";

View File

@@ -0,0 +1,56 @@
$NetBSD: patch-am,v 1.2 2011/04/08 22:56:12 morr Exp $
--- contrib/check_mssql.sh.orig 2010-07-27 20:47:15.000000000 +0000
+++ contrib/check_mssql.sh
@@ -35,10 +35,10 @@ pswd=$3
srv=$4
-if [ ! "$#" == "4" ]; then
+if [ ! "$#" = "4" ]; then
echo -e "\nYou did not supply enough arguments. \nUsage: $0 <host> <username> <password> <version> \n \n$0 checks Microsoft SQL Server connectivity. It works with versions 7 and 2000.\n\nYou need a working version of FreeTDS (http://www.freetds.org/) and tsql (included in FreeTDS 6.0+) to connect to the SQL server. \nIt was written by Tom De Blende (tom.deblende@village.uunet.be) in 2003. \n\nExample:\n $0 dbserver sa f00bar 2000\n" && exit "3"
-elif [ $tsqlcmd == "" ]; then
+elif [ $tsqlcmd = "" ]; then
echo -e "tsql not found! Please verify you have a working version of tsql (included in the FreeTDS version 6.0+) and enter the full path in the script." && exit "3"
fi
@@ -50,9 +50,9 @@ exit="3"
tmpfile=`$mktempcmd /tmp/$hostname.XXXXXX`
-if [ $srv == "7" ]; then
+if [ $srv = "7" ]; then
spid=7
-elif [ $srv == "2000" ]; then
+elif [ $srv = "2000" ]; then
spid=50
else
echo -e "$srv is not a supported MS SQL Server version!" && exit "3"
@@ -69,7 +69,7 @@ $tsqlcmd -S $hostname -U $usr -P $pswd <
$grepcmd -q "Login failed for user" $errorfile
-if [ "$?" == "0" ]; then
+if [ "$?" = "0" ]; then
$rmcmd -f $tmpfile $resultfile $errorfile;
echo CRITICAL - Could not make connection to SQL server. Login failed.;
exit 2;
@@ -77,7 +77,7 @@ fi
$grepcmd -q "There was a problem connecting to the server" $errorfile
-if [ "$?" == "0" ]; then
+if [ "$?" = "0" ]; then
$rmcmd -f $tmpfile $resultfile $errorfile;
echo CRITICAL - Could not make connection to SQL server. Incorrect server name or SQL service not running.;
exit 2;
@@ -85,7 +85,7 @@ fi
resultfileln=`$catcmd $resultfile | $wccmd -l | $sedcmd 's/ //g'`
-if [ "$resultfileln" == "2" ]; then
+if [ "$resultfileln" = "2" ]; then
$rmcmd -f $tmpfile $resultfile $errorfile;
echo CRITICAL - Could not make connection to SQL server. No data received from host.;
exit 2;

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-an,v 1.4 2011/04/08 22:56:12 morr Exp $
--- lib/Makefile.in.orig 2010-07-27 20:48:09.000000000 +0000
+++ lib/Makefile.in
@@ -146,7 +146,7 @@ DEFAULT_INCLUDES = -I. -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CPPFLAGS_LFS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

View File

@@ -0,0 +1,336 @@
$NetBSD: patch-configure,v 1.1 2013/01/19 09:59:12 manu Exp $
Enable check_smart_ide for NetBSD
--- configure.orig 2013-01-03 05:43:34.000000000 +0100
+++ configure 2013-01-03 06:02:14.000000000 +0100
@@ -15047,9 +15047,11 @@
echo "$as_me: WARNING: install LDAP libs to compile this plugin (see REQUIREMENTS)." >&2;}
fi
LIBS="$_SAVEDLIBS"
-if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
+case $host in
+ *linux*)
+ if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for linux/hdreg.h" >&5
echo $ECHO_N "checking for linux/hdreg.h... $ECHO_C" >&6; }
if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15179,10 +15181,10 @@
FOUNDINCLUDE=no
fi
-if test "$FOUNDINCLUDE" = "yes" ; then
- if test "${ac_cv_header_linux_types_h+set}" = set; then
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ if test "${ac_cv_header_linux_types_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for linux/types.h" >&5
echo $ECHO_N "checking for linux/types.h... $ECHO_C" >&6; }
if test "${ac_cv_header_linux_types_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15312,17 +15314,299 @@
FOUNDINCLUDE=no
fi
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ { echo "$as_me:$LINENO: WARNING: Skipping check_ide_smart plugin." >&5
+echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
+ { echo "$as_me:$LINENO: WARNING: check_ide_smart requires linux/hdreg.h and linux/types.h." >&5
+echo "$as_me: WARNING: check_ide_smart requires linux/hdreg.h and linux/types.h." >&2;}
+ fi
+ ;;
+ *netbsd*)
+ if test "${ac_cv_header_dev_ata_atareg_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for dev/ata/atareg.h" >&5
+echo $ECHO_N "checking for dev/ata/atareg.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dev_ata_atareg_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dev_ata_atareg_h" >&5
+echo "${ECHO_T}$ac_cv_header_dev_ata_atareg_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking dev/ata/atareg.h usability" >&5
+echo $ECHO_N "checking dev/ata/atareg.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <dev/ata/atareg.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test "$FOUNDINCLUDE" = "yes" ; then
- EXTRAS="$EXTRAS check_ide_smart"
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking dev/ata/atareg.h presence" >&5
+echo $ECHO_N "checking dev/ata/atareg.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dev/ata/atareg.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ata/atareg.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dev/ata/atareg.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for dev/ata/atareg.h" >&5
+echo $ECHO_N "checking for dev/ata/atareg.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dev_ata_atareg_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_dev_ata_atareg_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dev_ata_atareg_h" >&5
+echo "${ECHO_T}$ac_cv_header_dev_ata_atareg_h" >&6; }
+
+fi
+if test $ac_cv_header_dev_ata_atareg_h = yes; then
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ if test "${ac_cv_header_dev_ic_wdcreg_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for dev/ic/wdcreg.h" >&5
+echo $ECHO_N "checking for dev/ic/wdcreg.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dev_ic_wdcreg_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dev_ic_wdcreg_h" >&5
+echo "${ECHO_T}$ac_cv_header_dev_ic_wdcreg_h" >&6; }
else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking dev/ic/wdcreg.h usability" >&5
+echo $ECHO_N "checking dev/ic/wdcreg.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <dev/ic/wdcreg.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking dev/ic/wdcreg.h presence" >&5
+echo $ECHO_N "checking dev/ic/wdcreg.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dev/ic/wdcreg.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dev/ic/wdcreg.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dev/ic/wdcreg.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for dev/ic/wdcreg.h" >&5
+echo $ECHO_N "checking for dev/ic/wdcreg.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dev_ic_wdcreg_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_dev_ic_wdcreg_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dev_ic_wdcreg_h" >&5
+echo "${ECHO_T}$ac_cv_header_dev_ic_wdcreg_h" >&6; }
+
+fi
+if test $ac_cv_header_dev_ic_wdcreg_h = yes; then
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
{ echo "$as_me:$LINENO: WARNING: Skipping check_ide_smart plugin." >&5
echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
- { echo "$as_me:$LINENO: WARNING: check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h." >&5
-echo "$as_me: WARNING: check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h." >&2;}
+ { echo "$as_me:$LINENO: WARNING: check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h" >&5
+echo "$as_me: WARNING: check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h" >&2;}
+ fi
+ ;;
+ *)
+ { echo "$as_me:$LINENO: WARNING: Skipping check_ide_smart plugin." >&5
+echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
+ { echo "$as_me:$LINENO: WARNING: check_ide_smart works only on Linux and NetBSD" >&5
+echo "$as_me: WARNING: check_ide_smart works only on Linux and NetBSD" >&2;}
+esac
+
+if test "$FOUNDINCLUDE" = "yes" ; then
+ EXTRAS="$EXTRAS check_ide_smart"
fi

View File

@@ -0,0 +1,50 @@
$NetBSD: patch-configure.in,v 1.1 2013/01/19 09:59:12 manu Exp $
Enable check_smart_ide for NetBSD
--- configure.in.orig 2013-01-03 05:43:46.000000000 +0100
+++ configure.in 2013-01-03 05:50:57.000000000 +0100
@@ -289,18 +289,36 @@
fi
LIBS="$_SAVEDLIBS"
dnl Check for headers used by check_ide_smart
-AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
-if test "$FOUNDINCLUDE" = "yes" ; then
- AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
-fi
+case $host in
+ *linux*)
+ AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart requires linux/hdreg.h and linux/types.h.])
+ fi
+ ;;
+ *netbsd*)
+ AC_CHECK_HEADER(dev/ata/atareg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ AC_CHECK_HEADER(dev/ic/wdcreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h])
+ fi
+ ;;
+ *)
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart works only on Linux and NetBSD])
+esac
if test "$FOUNDINCLUDE" = "yes" ; then
EXTRAS="$EXTRAS check_ide_smart"
-else
- AC_MSG_WARN([Skipping check_ide_smart plugin.])
- AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
fi
dnl Check for mysql libraries
np_mysqlclient

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-plugins__check_swap.c,v 1.1 2012/07/25 12:01:55 fhajny Exp $
Disable large file support when building 32bit on SunOS.
--- plugins/check_swap.c.orig 2010-07-27 20:47:16.000000000 +0000
+++ plugins/check_swap.c
@@ -35,6 +35,10 @@ const char *email = "nagiosplug-devel@li
#include "popen.h"
#include "utils.h"
+#if defined(__sun) && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#endif
+
#ifdef HAVE_DECL_SWAPCTL
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>

View File

@@ -0,0 +1,157 @@
$NetBSD: patch-plugins_check_ide_smart.c,v 1.1 2013/01/19 09:59:12 manu Exp $
NetBSD support for SMART checks
--- plugins/check_ide_smart.c.orig 2012-12-27 09:37:31.000000000 +0100
+++ plugins/check_ide_smart.c 2012-12-27 09:37:31.000000000 +0100
@@ -47,6 +47,27 @@
#include <sys/ioctl.h>
#include <fcntl.h>
+#ifdef linux
#include <linux/hdreg.h>
#include <linux/types.h>
+
+#define OPEN_MODE O_RDONLY
+#endif /* linux */
+#ifdef __NetBSD__
+#include <sys/device.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/videoio.h> /* for __u8 and friends */
+#include <sys/scsiio.h>
+#include <sys/ataio.h>
+#include <dev/ata/atareg.h>
+#include <dev/ic/wdcreg.h>
+
+#define SMART_ENABLE WDSM_ENABLE_OPS
+#define SMART_DISABLE WDSM_DISABLE_OPS
+#define SMART_IMMEDIATE_OFFLINE WDSM_EXEC_OFFL_IMM
+#define SMART_AUTO_OFFLINE 0xdb /* undefined in NetBSD headers */
+
+#define OPEN_MODE O_RDWR
+#endif /* __NetBSD__ */
#include <errno.h>
@@ -224,5 +245,5 @@
}
- fd = open (device, O_RDONLY);
+ fd = open (device, OPEN_MODE);
if (fd < 0) {
@@ -285,4 +306,5 @@
smart_read_values (int fd, values_t * values)
{
+#ifdef linux
int e;
__u8 args[4 + 512];
@@ -297,4 +319,33 @@
}
memcpy (values, args + 4, 512);
+#endif /* linux */
+#ifdef __NetBSD__
+ struct atareq req;
+ unsigned char inbuf[DEV_BSIZE];
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ memset(&inbuf, 0, sizeof(inbuf));
+
+ req.flags = ATACMD_READ;
+ req.features = WDSM_RD_DATA;
+ req.command = WDCC_SMART;
+ req.databuf = (char *)inbuf;
+ req.datalen = sizeof(inbuf);
+ req.cylinder = WDSMART_CYL;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ int e = errno;
+ printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno));
+ return e;
+ }
+
+ (void)memcpy(values, inbuf, 512);
+#endif /* __NetBSD__ */
return 0;
}
@@ -440,4 +491,5 @@
{
int e = 0;
+#ifdef linux
__u8 args[4];
args[0] = WIN_SMART;
@@ -451,4 +503,29 @@
}
}
+#endif /* linux */
+#ifdef __NetBSD__
+ struct atareq req;
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ req.flags = ATACMD_READREG;
+ req.features = smart_command[command].value;
+ req.command = WDCC_SMART;
+ req.cylinder = WDSMART_CYL;
+ req.sec_count = val0;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ if (req.cylinder != WDSMART_CYL)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ e = errno;
+ printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
+ return e;
+ }
+#endif /* __NetBSD__ */
return e;
}
@@ -459,4 +536,5 @@
smart_read_thresholds (int fd, thresholds_t * thresholds)
{
+#ifdef linux
int e;
__u8 args[4 + 512];
@@ -471,4 +549,33 @@
}
memcpy (thresholds, args + 4, 512);
+#endif /* linux */
+#ifdef __NetBSD__
+ struct atareq req;
+ unsigned char inbuf[DEV_BSIZE];
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ memset(&inbuf, 0, sizeof(inbuf));
+
+ req.flags = ATACMD_READ;
+ req.features = WDSM_RD_THRESHOLDS;
+ req.command = WDCC_SMART;
+ req.databuf = (char *)inbuf;
+ req.datalen = sizeof(inbuf);
+ req.cylinder = WDSMART_CYL;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ int e = errno;
+ printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno));
+ return e;
+ }
+
+ (void)memcpy(thresholds, inbuf, 512);
+#endif /* __NetBSD__ */
return 0;
}