diff --git a/src/go/cmd/mock_server/active_checks.json b/src/go/cmd/mock_server/active_checks.json
index 46cfce0375..a94ec8e4ee 100644
--- a/src/go/cmd/mock_server/active_checks.json
+++ b/src/go/cmd/mock_server/active_checks.json
@@ -2,107 +2,11 @@
 	"response": "success",
 	"data": [{
 		"itemid": 1,
-		"key": "system.uptime",
-		"delay": "5",
+		"key": "debug.external.full",
+		"delay": "10",
 		"lastlogsize": 1,
 		"mtime": 2
-	}, {
-		"itemid": 2,
-		"key": "systemd.unit.info[dbus.service]",
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
-	}, {
-		"key": "log[\"/tmp/test.txt\",\"@Network interfaces for discovery\"]",
-		"itemid": 28627,
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
-	}, {
-		"key": "log[\"/tmp/test2.txt\",\"@File systems for discovery\"]",
-		"itemid": 28628,
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
-	}, {
-		"key": "log[\"/tmp/test3.txt\",\"@Character string included\"]",
-		"itemid": 28629,
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
-	}, {
-		"key": "log[\"/tmp/test4.txt\",\"@Any character string included insensitive\"]",
-		"itemid": 28630,
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
-	}, {
-		"key": "log[\"/tmp/test5.txt\",\"@Character string not included\"]",
-		"itemid": 28631,
-		"delay": "5",
-		"lastlogsize": 0,
-		"mtime": 0
 	}],
 	"refresh_unsupported": 600,
-	"regexp": [{
-		"name": "Network interfaces for discovery",
-		"expression": "^Software Loopback Interface",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Network interfaces for discovery",
-		"expression": "^(In)?[Ll]oop[Bb]ack[0-9._]*$",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Network interfaces for discovery",
-		"expression": "^NULL[0-9.]*$",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Network interfaces for discovery",
-		"expression": "^[Ll]o[0-9.]*$",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Network interfaces for discovery",
-		"expression": "^[Ss]ystem$",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Network interfaces for discovery",
-		"expression": "^Nu[0-9.]*$",
-		"expression_type": 4,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "File systems for discovery",
-		"expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$",
-		"expression_type": 3,
-		"exp_delimiter": ",",
-		"case_sensitive": 0
-	}, {
-		"name": "Character string included",
-		"expression": "foo",
-		"expression_type": 0,
-		"exp_delimiter": ",",
-		"case_sensitive": 1
-	}, {
-		"name": "Any character string included insensitive",
-		"expression": "FOO.BAR.BAZ",
-		"expression_type": 1,
-		"exp_delimiter": ".",
-		"case_sensitive": 0
-	}, {
-		"name": "Character string not included",
-		"expression": "foo",
-		"expression_type": 2,
-		"exp_delimiter": ",",
-		"case_sensitive": 0
-	}]
+	"regexp": []
 }
diff --git a/src/go/cmd/zabbix_agent2/external_linux.go b/src/go/cmd/zabbix_agent2/external_linux.go
index 1ebe1a6afe..d421dcdb2e 100644
--- a/src/go/cmd/zabbix_agent2/external_linux.go
+++ b/src/go/cmd/zabbix_agent2/external_linux.go
@@ -25,6 +25,8 @@ import (
 	"syscall"
 
 	"zabbix.com/pkg/log"
+	"zabbix.com/pkg/plugin"
+	"zabbix.com/plugins/external"
 )
 
 func getListener(socket string) (listener net.Listener, err error) {
@@ -46,3 +48,23 @@ func cleanUpExternal() {
 		log.Critf("failed to clean up after external plugins, %s", err)
 	}
 }
+
+func checkExternalExit() error {
+	var status syscall.WaitStatus
+	if pid, err := syscall.Wait4(-1, &status, syscall.WNOHANG, nil); err == nil {
+		for _, p := range plugin.Plugins {
+			if p.IsExternal() {
+				if ep, ok := p.(*external.Plugin); ok {
+					if ep.CheckPid(pid) {
+						ep.Cleanup()
+						return fmt.Errorf("external plugin %s died", p.Name())
+					}
+				}
+			}
+		}
+		return nil
+
+	} else {
+		return fmt.Errorf("failed to obtain PID of dead child process: %s", err)
+	}
+}
diff --git a/src/go/cmd/zabbix_agent2/external_windows.go b/src/go/cmd/zabbix_agent2/external_windows.go
index 75937855f2..42c263799e 100644
--- a/src/go/cmd/zabbix_agent2/external_windows.go
+++ b/src/go/cmd/zabbix_agent2/external_windows.go
@@ -40,3 +40,7 @@ func getListener(socket string) (listener net.Listener, err error) {
 }
 
 func cleanUpExternal() {}
+
+func checkExternalExit() error {
+	return nil
+}
\ No newline at end of file
diff --git a/src/go/cmd/zabbix_agent2/zabbix_agent2.go b/src/go/cmd/zabbix_agent2/zabbix_agent2.go
index c7b7b33c8b..fb5b2418bd 100644
--- a/src/go/cmd/zabbix_agent2/zabbix_agent2.go
+++ b/src/go/cmd/zabbix_agent2/zabbix_agent2.go
@@ -164,7 +164,7 @@ var pidFile *pidfile.File
 
 func run() (err error) {
 	sigs := make(chan os.Signal, 1)
-	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
+	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGCHLD)
 
 	var control *remotecontrol.Conn
 	if control, err = remotecontrol.New(agent.Options.ControlSocket, remoteCommandSendingTimeout); err != nil {
@@ -181,6 +181,12 @@ loop:
 			case syscall.SIGINT, syscall.SIGTERM:
 				sendServiceStop()
 				break loop
+			case syscall.SIGCHLD:
+				if err := checkExternalExit(); err != nil {
+					log.Warningf("Error: %s", err)
+					sendServiceStop()
+					break loop
+				}
 			}
 		case client := <-control.Client():
 			if rerr := processRemoteCommand(client); rerr != nil {
diff --git a/src/go/pkg/win32/advapi32.go b/src/go/pkg/win32/advapi32.go
index 80cbf3820f..2a82e41c7b 100644
--- a/src/go/pkg/win32/advapi32.go
+++ b/src/go/pkg/win32/advapi32.go
@@ -1,3 +1,4 @@
+//go:build windows
 // +build windows
 
 /*
diff --git a/src/go/plugins/external/broker.go b/src/go/plugins/external/broker.go
index 1a79f323c8..446f485282 100644
--- a/src/go/plugins/external/broker.go
+++ b/src/go/plugins/external/broker.go
@@ -239,7 +239,7 @@ func (b *pluginBroker) handleLogs() {
 		case shared.LogRequest:
 			b.handleLog(v)
 		default:
-			log.Errf("Failed to log message from external plugins, unknown request type.")
+			log.Errf(`Failed to log message from external plugins, unknown request type "%T"`, u)
 		}
 	}
 }
diff --git a/src/go/plugins/external/plugin.go b/src/go/plugins/external/plugin.go
index ba3dda4374..c6eb024e73 100644
--- a/src/go/plugins/external/plugin.go
+++ b/src/go/plugins/external/plugin.go
@@ -84,6 +84,12 @@ func (p *Plugin) Start() {
 }
 
 func (p *Plugin) Stop() {
+	if p.cmd == nil {
+		return
+	}
+
+	p.cmd = nil
+
 	err := shared.Write(
 		p.broker.conn,
 		shared.TerminateRequest{
@@ -99,11 +105,7 @@ func (p *Plugin) Stop() {
 
 	p.broker.stop()
 
-	if p.cmd == nil {
-		panic(fmt.Sprintf("missing cmd reference for external plugin %s, %s", p.Path, err.Error()))
-	}
-
-	p.cmd.Wait()
+	time.Sleep(time.Second)
 }
 
 func (p *Plugin) Configure(globalOptions *plugin.GlobalOptions, privateOptions interface{}) {
@@ -165,3 +167,12 @@ func listen(listener net.Listener, ch chan<- net.Conn, errCh chan<- error) {
 
 	ch <- conn
 }
+
+func (p *Plugin) CheckPid(pid int) bool {
+	return p.cmd != nil && p.cmd.Process.Pid == pid
+}
+
+func (p *Plugin) Cleanup() {
+	p.broker.stop()
+	p.cmd = nil
+}
