db316b2926
crashes on various architectures and system, such as, for example, the check_icmp bus error on sparc64. Changes in 1.4.4: - check_ntp is now written in C instead of Perl. - check_disk bugfixes. - check_udp2, check_udp and check_tcp are now united. - check_mailq now reports mailq errors better. - check_snmp now compiles with a sane amount of effort. Changes in 1.4.5: - Fixed bug in perl's is_hostname routine. Changes in 1.4.6: - check_ping and netutils.c now do less DNS lookups. - alloca.h related compile fixes. - check_swap now works on Solaris too. - check_disk perf data can now be monitored. - check_procs had a buffer overflow. - Fixed UNIX socket error handling. - check_by_ssh now can pass -q and -o to ssh. - GNUlib sync. - check_jabber can now return things different from a warning. Changes in 1.4.7: - check_procs uses /usr/ucb/ps on Solaris which fixes pst3 problems. - check_smtp does a non-broken HELO now. - check_icmp can now have a minimum number of required hosts and also works if running for a long time on BSDs. - check_ping timeout reduced. - Everybody can now execute SUID check plugins unless indicated otherwise to configure. Changes in 1.4.8: - check_disk now has an extra option for regex matching and grouping of FSes. - check_ntp various fixes. Changes in 1.4.9: - New plugin check_cluster (not built by pkgsrc). - check_by_ssh now has improved stderr/stdout handling options (-E/-S). - check_ldap, check_radius and check_pgsql compile fixes. - check_snmp 64-bit counter support. - Better underflow checking for check_time. - check_http output is more consistent now. - check_http HTTP redirect segfault fixes. - check_tcp doesn't segfault anymore when multiple expect strings are given. - check_tcp now supports -A to check if all expect strings match. Changes in 1.4.10: - check_http redirect buffer overflow vulnerability fixed (was fixed in pkgsrc before). - check_http now shuts down HTTP/1.1 keepalive connections cleanly. - check_ldaps doesn't guess anymore whether to use SSL or STARTTLS. - check_disk now calls stat on all file systems. - check_disk now supports the -L flag for local file system checks. - check_disk now supports -i/-I for ignoring paths/partitions by regex. - check_disk now supports -A to select all file systems explicitly. - check_disk now needs to have the -E flag passed before -p or -r/-R. - check_disk is no longer buggy when case sensitive and insensitive regexes are mixed. - check_dhcp now supports -u (unicast) to emulate a relay. - check_dhcp now lets you specify the MAC address in the request using -m. - check_dhcp -r and -s options now accept host names. - check_icmp no longer bus errors on various platforms. - check_smtp now handles multiple-packet server responses properly. - Negate command line options are no longer evaluated twice by the shell. - Negate commands to be run must now be fully qualified. - Negate can now remap custom states. - check_radius now supports radius-client-ng (was already in pkgsrc). - check_by_ssh now supports multiline output. - check_ntp now honors ntp flags. Changes in 1.4.10: - check_ntp returns UNKNOWN rather than WARNING if no jitter is available. - check_cluster now accept all valid characters in its thresholds. - check_ntp is now deprecated in favor of check_ntp_peer and check_ntp_time. - check_disk no longer reports OK if disk usage exceeds 100%. - check_load handles non-triplet arguments correctly now. - Nagios::Plugin updated to 0.22.
101 lines
2.5 KiB
Text
101 lines
2.5 KiB
Text
$NetBSD: patch-ak,v 1.2 2008/05/27 21:22:02 tonnerre Exp $
|
|
|
|
--- gl/mountlist.c.orig 2007-01-24 23:47:25.000000000 +0100
|
|
+++ gl/mountlist.c
|
|
@@ -57,7 +57,11 @@ char *strstr ();
|
|
# 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 */
|
|
|
|
@@ -104,6 +108,10 @@ char *strstr ();
|
|
# include <sys/statfs.h>
|
|
#endif
|
|
|
|
+#ifdef HAVE_SYS_STATVFS_H
|
|
+#include <sys/statvfs.h>
|
|
+#endif
|
|
+
|
|
#ifdef MOUNTED_LISTMNTENT
|
|
# include <mntent.h>
|
|
#endif
|
|
@@ -178,7 +186,7 @@ char *strstr ();
|
|
|
|
#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)
|
|
{
|
|
@@ -275,9 +283,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);
|
|
@@ -413,7 +425,11 @@ read_file_system_list (bool need_fs_type
|
|
|
|
#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */
|
|
{
|
|
+#ifdef STAT_STATVFS
|
|
+ struct statvfs *fsp;
|
|
+#else
|
|
struct statfs *fsp;
|
|
+#endif
|
|
int entries;
|
|
|
|
entries = getmntinfo (&fsp, MNT_NOWAIT);
|
|
@@ -601,9 +617,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)
|
|
@@ -666,10 +690,18 @@ read_file_system_list (bool need_fs_type
|
|
# ifdef GETFSTYP /* SVR3. */
|
|
if (need_fs_type)
|
|
{
|
|
+#ifdef STAT_STATVFS
|
|
+ struct statvfs fsd;
|
|
+#else
|
|
struct statfs fsd;
|
|
+#endif
|
|
char typebuf[FSTYPSZ];
|
|
|
|
+#ifdef STAT_STATVFS
|
|
+ if (statvfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1
|
|
+#else
|
|
if (statfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1
|
|
+#endif
|
|
&& sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1)
|
|
{
|
|
me->me_type = xstrdup (typebuf);
|