diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c
index ab2b1e78d8576fc49a0a2a298994f6331084153d..0585cc6020639f2f833e72b40e7d90e5c39e2099 100644
--- a/lustre/utils/liblustreapi.c
+++ b/lustre/utils/liblustreapi.c
@@ -1473,7 +1473,7 @@ int llapi_ping(char *obd_type, char *obd_name)
 
         if (rc == 1)
                 return 0;
-        return rc;
+        return errno;
 }
 
 int llapi_target_iterate(int type_num, char **obd_type, void *args, llapi_cb_t cb)
@@ -1530,7 +1530,9 @@ static void do_target_check(char *obd_type_name, char *obd_name,
         int rc;
 
         rc = llapi_ping(obd_type_name, obd_name);
-        if (rc) {
+        if (rc == ENOTCONN || rc == ESHUTDOWN) {
+                llapi_printf(LLAPI_MSG_NORMAL, "%s inactive.\n", obd_name);
+        } else if (rc) {
                 llapi_err(LLAPI_MSG_ERROR, "error: check '%s'", obd_name);
         } else {
                 llapi_printf(LLAPI_MSG_NORMAL, "%s active.\n", obd_name);