diff options
-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 */ |