diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-12 06:44:34 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-03-12 06:44:34 (GMT) |
commit | 10a9300ed850d077afb82380649a45d663b3be5d (patch) | |
tree | 19e367d3c02ccb5924fe6568e17587c12008a7fb /plugins | |
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')
-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 5fac4ea..f72841e 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
@@ -99,26 +99,45 @@ main (int argc, char **argv) | |||
99 | if (statfs (path, &buf) == -1) { | 99 | if (statfs (path, &buf) == -1) { |
100 | switch (errno) | 100 | switch (errno) |
101 | { | 101 | { |
102 | #ifdef ENOTDIR | ||
102 | case ENOTDIR: | 103 | case ENOTDIR: |
103 | terminate (STATE_UNKNOWN, "A component of the path prefix is not a directory.\n"); | 104 | terminate (STATE_UNKNOWN, "A component of the path prefix is not a directory.\n"); |
105 | #endif | ||
106 | #ifdef ENAMETOOLONG | ||
104 | case ENAMETOOLONG: | 107 | case ENAMETOOLONG: |
105 | terminate (STATE_UNKNOWN, "path is too long.\n"); | 108 | terminate (STATE_UNKNOWN, "path is too long.\n"); |
109 | #endif | ||
110 | #ifdef ENOENT | ||
106 | case ENOENT: | 111 | case ENOENT: |
107 | terminate (STATE_UNKNOWN, "The file referred to by path does not exist.\n"); | 112 | terminate (STATE_UNKNOWN, "The file referred to by path does not exist.\n"); |
113 | #endif | ||
114 | #ifdef EACCES | ||
108 | case EACCES: | 115 | case EACCES: |
109 | terminate (STATE_UNKNOWN, "Search permission is denied for a component of the path prefix of path.\n"); | 116 | terminate (STATE_UNKNOWN, "Search permission is denied for a component of the path prefix of path.\n"); |
117 | #endif | ||
118 | #ifdef ELOOP | ||
110 | case ELOOP: | 119 | case ELOOP: |
111 | terminate (STATE_UNKNOWN, "Too many symbolic links were encountered in translating path.\n"); | 120 | terminate (STATE_UNKNOWN, "Too many symbolic links were encountered in translating path.\n"); |
121 | #endif | ||
122 | #ifdef EFAULT | ||
112 | case EFAULT: | 123 | case EFAULT: |
113 | terminate (STATE_UNKNOWN, "Buf or path points to an invalid address.\n"); | 124 | terminate (STATE_UNKNOWN, "Buf or path points to an invalid address.\n"); |
125 | #endif | ||
126 | #ifdef EIO | ||
114 | case EIO: | 127 | case EIO: |
115 | terminate (STATE_UNKNOWN, "An I/O error occurred while reading from or writing to the file system.\n"); | 128 | terminate (STATE_UNKNOWN, "An I/O error occurred while reading from or writing to the file system.\n"); |
129 | #endif | ||
130 | #ifdef ENOMEM | ||
116 | case ENOMEM: | 131 | case ENOMEM: |
117 | terminate (STATE_UNKNOWN, "Insufficient kernel memory was available.\n"); | 132 | terminate (STATE_UNKNOWN, "Insufficient kernel memory was available.\n"); |
133 | #endif | ||
134 | #ifdef ENOSYS | ||
118 | case ENOSYS: | 135 | case ENOSYS: |
119 | terminate (STATE_UNKNOWN, "The filesystem path is on does not support statfs.\n"); | 136 | terminate (STATE_UNKNOWN, "The filesystem path is on does not support statfs.\n"); |
137 | #endif | ||
120 | } | 138 | } |
121 | } | 139 | } |
140 | |||
122 | usp = (buf.f_blocks - buf.f_bavail) / buf.f_blocks; | 141 | usp = (buf.f_blocks - buf.f_bavail) / buf.f_blocks; |
123 | disk_result = check_disk (usp, buf.f_bavail); | 142 | disk_result = check_disk (usp, buf.f_bavail); |
124 | result = disk_result; | 143 | result = disk_result; |