diff options
| author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-07-01 09:27:56 +0000 |
|---|---|---|
| committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-07-01 09:27:56 +0000 |
| commit | de50ab8a0c0944c2c6e5221af982780f959c6651 (patch) | |
| tree | db14054dd48668cd07186c68e81252735ebeb628 | |
| parent | 0651464f597e1b702e954ef2cccf9ccf15148f44 (diff) | |
| download | monitoring-plugins-de50ab8a0c0944c2c6e5221af982780f959c6651.tar.gz | |
Fix for large filesystems > 3TB (Stuart Webster)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/release-1.3.0@576 f882894a-f735-0410-b71e-b25c423dba1c
| -rw-r--r-- | plugins/check_disk.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 234a09d8..9a2f1742 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | 41 | ||
| 42 | int process_arguments (int, char **); | 42 | int process_arguments (int, char **); |
| 43 | int validate_arguments (void); | 43 | int validate_arguments (void); |
| 44 | int check_disk (int usp, int free_disk); | 44 | int check_disk (int usp, float free_disk); |
| 45 | void print_help (void); | 45 | void print_help (void); |
| 46 | void print_usage (void); | 46 | void print_usage (void); |
| 47 | 47 | ||
| @@ -62,9 +62,9 @@ int | |||
| 62 | main (int argc, char **argv) | 62 | main (int argc, char **argv) |
| 63 | { | 63 | { |
| 64 | int usp = -1; | 64 | int usp = -1; |
| 65 | int total_disk = -1; | 65 | float total_disk = -1; |
| 66 | int used_disk = -1; | 66 | float used_disk = -1; |
| 67 | int free_disk = -1; | 67 | float free_disk = -1; |
| 68 | int result = STATE_UNKNOWN; | 68 | int result = STATE_UNKNOWN; |
| 69 | int disk_result = STATE_UNKNOWN; | 69 | int disk_result = STATE_UNKNOWN; |
| 70 | char *command_line = ""; | 70 | char *command_line = ""; |
| @@ -101,9 +101,9 @@ main (int argc, char **argv) | |||
| 101 | if (strstr (input_buffer, "/proc ") == input_buffer) | 101 | if (strstr (input_buffer, "/proc ") == input_buffer) |
| 102 | continue; | 102 | continue; |
| 103 | 103 | ||
| 104 | if (sscanf (input_buffer, "%s %d %d %d %d%% %s", file_system, | 104 | if (sscanf (input_buffer, "%s %f %f %f %d%% %s", file_system, |
| 105 | &total_disk, &used_disk, &free_disk, &usp, mntp) == 6 || | 105 | &total_disk, &used_disk, &free_disk, &usp, mntp) == 6 || |
| 106 | sscanf (input_buffer, "%s %*s %d %d %d %d%% %s", file_system, | 106 | sscanf (input_buffer, "%s %*s %f %f %f %d%% %s", file_system, |
| 107 | &total_disk, &used_disk, &free_disk, &usp, mntp) == 6) { | 107 | &total_disk, &used_disk, &free_disk, &usp, mntp) == 6) { |
| 108 | 108 | ||
| 109 | if (strcmp(exclude_device,file_system) == 0 || | 109 | if (strcmp(exclude_device,file_system) == 0 || |
| @@ -122,7 +122,7 @@ main (int argc, char **argv) | |||
| 122 | continue; | 122 | continue; |
| 123 | 123 | ||
| 124 | if (disk_result!=STATE_OK || verbose>=0) | 124 | if (disk_result!=STATE_OK || verbose>=0) |
| 125 | asprintf (&output, "%s [%d kB (%d%%) free on %s]", output, | 125 | asprintf (&output, "%s [%.0f kB (%d%%) free on %s]", output, |
| 126 | free_disk, 100 - usp, display_mntp ? mntp : file_system); | 126 | free_disk, 100 - usp, display_mntp ? mntp : file_system); |
| 127 | 127 | ||
| 128 | result = max_state (result, disk_result); | 128 | result = max_state (result, disk_result); |
| @@ -317,7 +317,7 @@ validate_arguments () | |||
| 317 | } | 317 | } |
| 318 | 318 | ||
| 319 | int | 319 | int |
| 320 | check_disk (usp, free_disk) | 320 | check_disk (int usp, float free_disk) |
| 321 | { | 321 | { |
| 322 | int result = STATE_UNKNOWN; | 322 | int result = STATE_UNKNOWN; |
| 323 | /* check the percent used space against thresholds */ | 323 | /* check the percent used space against thresholds */ |
