diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index f8b701f..393c2fe 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -22,6 +22,7 @@
 #include <fmt/format.h>
 
 #include <fstream>
+#include <iterator>
 #include <phosphor-logging/log.hpp>
 #include <xyz/openbmc_project/State/Boot/Progress/server.hpp>
 
@@ -80,6 +81,8 @@
     "xyz.openbmc_project.State.Decorator.OperationalStatus";
 constexpr auto logSetting = "xyz.openbmc_project.Logging.Settings";
 constexpr auto association = "xyz.openbmc_project.Association.Definitions";
+constexpr auto dumpEntry = "xyz.openbmc_project.Dump.Entry";
+constexpr auto dumpProgress = "xyz.openbmc_project.Common.Progress";
 } // namespace interface
 
 using namespace sdbusplus::xyz::openbmc_project::State::Boot::server;
@@ -617,5 +620,72 @@
     return ret;
 }
 
+std::vector<bool>
+    DataInterface::checkDumpStatus(const std::vector<std::string>& type) const
+{
+    DBusSubTree subtree;
+    std::vector<bool> result(type.size(), false);
+
+    // Query GetSubTree for the availability of dump interface
+    auto method = _bus.new_method_call(service_name::objectMapper,
+                                       object_path::objectMapper,
+                                       interface::objectMapper, "GetSubTree");
+    method.append(std::string{"/"}, 0,
+                  std::vector<std::string>{interface::dumpEntry});
+    auto reply = _bus.call(method);
+
+    reply.read(subtree);
+
+    if (subtree.empty())
+    {
+        return result;
+    }
+
+    std::vector<bool>::iterator itDumpStatus = result.begin();
+    uint8_t count = 0;
+    for (const auto& [path, serviceInfo] : subtree)
+    {
+        const auto& service = serviceInfo.begin()->first;
+        // Check for dump type on the object path
+        for (const auto& it : type)
+        {
+            if (path.find(it) != std::string::npos)
+            {
+                DBusValue value, progress;
+
+                // If dump type status is already available go for next path
+                if (*itDumpStatus)
+                {
+                    break;
+                }
+
+                // Check for valid dump to be available if following
+                // conditions are met for the dump entry path -
+                // Offloaded == false and Status == Completed
+                getProperty(service, path, interface::dumpEntry, "Offloaded",
+                            value);
+                getProperty(service, path, interface::dumpProgress, "Status",
+                            progress);
+                auto offload = std::get<bool>(value);
+                auto status = std::get<std::string>(progress);
+                if (!offload && (status.find("Completed") != std::string::npos))
+                {
+                    *itDumpStatus = true;
+                    count++;
+                    if (count >= type.size())
+                    {
+                        return result;
+                    }
+                    break;
+                }
+            }
+            itDumpStatus++;
+        }
+        itDumpStatus = result.begin();
+    }
+
+    return result;
+}
+
 } // namespace pels
 } // namespace openpower
