diff --git a/include/error_monitors/cpu_presence_monitor.hpp b/include/error_monitors/cpu_presence_monitor.hpp
new file mode 100644
index 0000000..beaf92c
--- /dev/null
+++ b/include/error_monitors/cpu_presence_monitor.hpp
@@ -0,0 +1,108 @@
+/*
+// Copyright (c) 2022 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+#pragma once
+
+#include <systemd/sd-journal.h>
+
+#include <error_monitors/base_monitor.hpp>
+#include <gpiod.hpp>
+#include <host_error_monitor.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+namespace host_error_monitor::cpu_presence_monitor
+{
+class CPUPresenceMonitor : public host_error_monitor::base_monitor::BaseMonitor
+{
+    int cpuPresent;
+    size_t cpuNum;
+    const static constexpr uint8_t beepCPUMIssing = 3;
+
+    void logEvent()
+    {
+        std::string msg = "CPU " + std::to_string(cpuNum) + " missing";
+
+        sd_journal_send("MESSAGE=HostError: %s", msg.c_str(), "PRIORITY=%i",
+                        LOG_INFO, "REDFISH_MESSAGE_ID=%s",
+                        "OpenBMC.0.1.CPUError", "REDFISH_MESSAGE_ARGS=%s",
+                        msg.c_str(), NULL);
+    }
+
+    void CPUPresenceAssertHandler(
+        std::shared_ptr<sdbusplus::asio::connection> conn)
+    {
+        std::cerr << signalName << " asserted\n";
+        // raising beep alert for base cpu missing
+        beep(conn, beepCPUMIssing);
+        logEvent();
+    }
+
+    bool getCPUPresence(const std::string& cpuPresenceName)
+    {
+        // Find the GPIO line
+        gpiod::line cpuPresenceLine = gpiod::find_line(cpuPresenceName);
+        if (!cpuPresenceLine)
+        {
+            std::cerr << "Failed to find the " << cpuPresenceName << " line.\n";
+            return false;
+        }
+
+        // Request GPIO input
+        try
+        {
+            cpuPresenceLine.request(
+                {"host-error-monitor", gpiod::line_request::DIRECTION_INPUT});
+        }
+        catch (const std::exception&)
+        {
+            std::cerr << "Failed to request " << cpuPresenceName << " input\n";
+            return false;
+        }
+
+        // CPU presence is low-assert
+        cpuPresent = !cpuPresenceLine.get_value();
+
+        return true;
+    }
+
+    void checkCPUPresence(std::shared_ptr<sdbusplus::asio::connection> conn)
+    {
+        // Ignore this if the CPU present
+        if (!cpuPresent)
+        {
+            CPUPresenceAssertHandler(conn);
+        }
+    }
+
+  public:
+    CPUPresenceMonitor(boost::asio::io_service& io,
+                       std::shared_ptr<sdbusplus::asio::connection> conn,
+                       const std::string& signalName, const size_t cpuNum) :
+        BaseMonitor(io, conn, signalName),
+        cpuNum(cpuNum)
+    {
+        if (!getCPUPresence(signalName))
+        {
+            return;
+        }
+        checkCPUPresence(conn);
+        valid = true;
+    }
+    void hostOn() override
+    {
+        checkCPUPresence(conn);
+    }
+};
+} // namespace host_error_monitor::cpu_presence_monitor
