Document 'show status' in the multipathd manpage.
#include "blacklist.h"
#include "switchgroup.h"
#include "devmapper.h"
+#include "uevent.h"
#define MAX(x,y) (x > y) ? x : y
#define TAIL (line + len - 1 - c)
checker_state_name(i), count[i]);
}
+ int monitored_count = 0;
+
+ vector_foreach_slot(vecs->pathvec, pp, i)
+ if (pp->fd != -1)
+ monitored_count++;
+ fwd += snprintf(buff + fwd, len - fwd, "\npaths: %d\nbusy: %s\n",
+ monitored_count, is_uevent_busy()? "True" : "False");
+
if (fwd > len)
return len;
return fwd;
r += add_key(keys, "devices", DEVICES, 0);
r += add_key(keys, "format", FMT, 1);
r += add_key(keys, "wildcards", WILDCARDS, 0);
- r += add_key(keys, "count", COUNT, 0);
r += add_key(keys, "quit", QUIT, 0);
r += add_key(keys, "exit", QUIT, 0);
add_handler(RESTOREQ+MAPS, NULL);
add_handler(REINSTATE+PATH, NULL);
add_handler(FAIL+PATH, NULL);
- add_handler(COUNT+PATHS, NULL);
add_handler(QUIT, NULL);
return 0;
__BLACKLIST,
__DEVICES,
__FMT,
- __COUNT,
__WILDCARDS,
__QUIT,
};
#include "main.h"
#include "cli.h"
-#include "uevent.h"
-
-int
-count_paths(char **r, int *l, struct vectors *vecs)
-{
- int i, len;
- struct path *pp;
- char * reply;
- unsigned int maxlen = INITIAL_REPLY_LEN;
- int monitored_count = 0;
-
- reply = MALLOC(maxlen);
- if (!reply)
- return 1;
- vector_foreach_slot(vecs->pathvec, pp, i)
- if (pp->fd != -1)
- monitored_count++;
- len = sprintf(reply, "Paths: %d\nBusy: %s\n", monitored_count,
- is_uevent_busy()? "True" : "False");
- *r = reply;
- *l = len + 1;
- return 0;
-}
int
show_paths (char ** r, int * len, struct vectors * vecs, char * style)
return show_config(reply, len);
}
-int
-cli_count_paths (void * v, char ** reply, int * len, void * data)
-{
- struct vectors * vecs = (struct vectors *)data;
-
- condlog(3, "count paths (operator)");
-
- return count_paths(reply, len, vecs);
-}
-
int
cli_list_paths (void * v, char ** reply, int * len, void * data)
{
int cli_suspend(void * v, char ** reply, int * len, void * data);
int cli_resume(void * v, char ** reply, int * len, void * data);
int cli_reinstate(void * v, char ** reply, int * len, void * data);
-int cli_count_paths(void * v, char ** reply, int * len, void * data);
int cli_fail(void * v, char ** reply, int * len, void * data);
int cli_quit(void * v, char ** reply, int * len, void * data);
set_handler_callback(RESTOREQ+MAP, cli_restore_queueing);
set_handler_callback(DISABLEQ+MAPS, cli_disable_all_queueing);
set_handler_callback(RESTOREQ+MAPS, cli_restore_all_queueing);
- set_handler_callback(COUNT+PATHS, cli_count_paths);
set_handler_callback(QUIT, cli_quit);
umask(077);
.B list|show devices
Show all available block devices by name including the information if they are blacklisted or not.
.TP
+.B list|show status
+Show the number of path checkers in each possible state, the number of monitored paths, and whether multipathd is currently handling a uevent.
+.TP
.B add path $path
Add a path to the list of monitored paths. $path is as listed in /sys/block (e.g. sda).
.TP
.B remove|del path $path
Stop monitoring a path. $path is as listed in /sys/block (e.g. sda).
.TP
-.B count paths
-Show the number of monitored paths, and whether multipathd is currently
-handling a uevent.
-.TP
.B add map $map
Add a multipath device to the list of monitored devices. $map can either be a device-mapper device as listed in /sys/block (e.g. dm-0) or it can be the alias for the multipath device (e.g. mpath1) or the uid of the multipath device (e.g. 36005076303ffc56200000000000010aa).
.TP