diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-12 06:44:34 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-12 06:44:34 +0000 |
commit | 10a9300ed850d077afb82380649a45d663b3be5d (patch) | |
tree | 19e367d3c02ccb5924fe6568e17587c12008a7fb /plugins/check_disk.c | |
parent | 5646ca9d05c1e8a3e6d7381a4d07da478d87c0bb (diff) | |
download | monitoring-plugins-10a9300ed850d077afb82380649a45d663b3be5d.tar.gz |
errors for statfs
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@408 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_disk.c')
-rw-r--r-- | plugins/check_disk.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 5fac4eae..f72841e8 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -99,26 +99,45 @@ main (int argc, char **argv) if (statfs (path, &buf) == -1) { switch (errno) { +#ifdef ENOTDIR case ENOTDIR: terminate (STATE_UNKNOWN, "A component of the path prefix is not a directory.\n"); +#endif +#ifdef ENAMETOOLONG case ENAMETOOLONG: terminate (STATE_UNKNOWN, "path is too long.\n"); +#endif +#ifdef ENOENT case ENOENT: terminate (STATE_UNKNOWN, "The file referred to by path does not exist.\n"); +#endif +#ifdef EACCES case EACCES: terminate (STATE_UNKNOWN, "Search permission is denied for a component of the path prefix of path.\n"); +#endif +#ifdef ELOOP case ELOOP: terminate (STATE_UNKNOWN, "Too many symbolic links were encountered in translating path.\n"); +#endif +#ifdef EFAULT case EFAULT: terminate (STATE_UNKNOWN, "Buf or path points to an invalid address.\n"); +#endif +#ifdef EIO case EIO: terminate (STATE_UNKNOWN, "An I/O error occurred while reading from or writing to the file system.\n"); +#endif +#ifdef ENOMEM case ENOMEM: terminate (STATE_UNKNOWN, "Insufficient kernel memory was available.\n"); +#endif +#ifdef ENOSYS case ENOSYS: terminate (STATE_UNKNOWN, "The filesystem path is on does not support statfs.\n"); +#endif } } + usp = (buf.f_blocks - buf.f_bavail) / buf.f_blocks; disk_result = check_disk (usp, buf.f_bavail); result = disk_result; |