summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce95250)
raw | patch | inline | side by side (parent: ce95250)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 25 Jun 2003 13:28:05 +0000 (13:28 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 25 Jun 2003 13:28:05 +0000 (13:28 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@555 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_disk.c | patch | blob | history |
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 62858b5f19851ce0dac3787fa617a849aff01087..585c4a662b40e7c36fc8583bd626434074db25f8 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
struct name_list
{
char *name;
+ int found;
struct name_list *name_next;
};
struct mount_entry *me;
struct fs_usage fsp;
+ struct name_list *temp_list;
char *disk;
mount_list = read_filesystem_list (0);
if (verbose > 2)
asprintf (&output, "%s%s", output, details);
+ /* Override result if paths specified and not found */
+ temp_list = path_select_list;
+ while (temp_list) {
+ if (temp_list->found != TRUE) {
+ asprintf (&output, "%s [%s not found]", output, temp_list->name);
+ result = STATE_CRITICAL;
+ }
+ temp_list = temp_list->name_next;
+ }
+
terminate (result, "DISK %s%s\n", state_text (result), output, details);
}
mult = (unsigned long)1024 * 1024 * 1024 * 1024;
units = "TB";
} else {
- terminate (STATE_UNKNOWN, "unit type %s not known", optarg);
+ terminate (STATE_UNKNOWN, "unit type %s not known\n", optarg);
}
break;
case 'k': /* display mountpoint */
case 'l':
show_local_fs = 1;
break;
- case 'p': /* selec path */
+ case 'p': /* select path */
se = (struct name_list *) malloc (sizeof (struct name_list));
se->name = strdup (optarg);
se->name_next = NULL;
walk_name_list (struct name_list *list, const char *name)
{
while (list) {
- if (! strcmp(list->name, name))
+ if (! strcmp(list->name, name)) {
+ list->found = 1;
return TRUE;
+ }
list = list->name_next;
}
return FALSE;