12 Commits

Author SHA1 Message Date
65f31f28f6 fix(processor): recovery process can be ended in time when the watchdog received stop command. 2026-05-08 17:09:04 +08:00
3ce076b8dc feat(errorHandle): add service error handling and recovery logic
Implement error handling mechanism with retry logic for failed services. Includes:
- ServiceControl struct to track service state
- HandleErrorProcess function to attempt service restarts
- Integration with monitor to automatically recover services
- Enhanced exception handling with status checks and monitoring restart
2026-04-29 12:11:25 +08:00
db192f2209 fix(monitor): format exception message with XML tags
Improve exception message formatting by adding XML tags for better parsing and processing downstream. The new format includes explicit tags for exception type, service name, and error message.
2026-04-28 20:49:11 +08:00
58a8efc17a refactor(socket): decouple command handling and add message sending
- Move command handler to variable for better flexibility
- Add SendMsg function for sending messages through socket
- Fix missing return statements in command execution
- Improve error handling in monitor exception reporting
2026-04-28 19:55:45 +08:00
3a0b591d5e fix(server): change connection method from one-time to full-time 2026-04-07 23:23:32 +08:00
6770bbed3f feat(config): add debug server configuration options
- Add debug server listen address and port configuration in config.json and config.go
- Update main.go to use debug config values when in debug mode
- Add logging for monitor add/remove commands in commandParse.go
2026-04-07 23:06:19 +08:00
75639bcf96 feat(command): implement command execution for service monitoring
Add functionality to parse and execute commands for adding/removing service monitors and shutting down the watchdog. The ExecuteCommand function now handles "monitor.add", "monitor.remove" and "watchdog.shutdown" commands by interacting with the monitor package and system operations.
2026-04-05 22:45:45 +08:00
f8d3575d60 feat(monitor): add service monitoring functionality with systemd integration
Implement a new monitoring system that tracks service status and logs using systemd commands. The monitor includes:
- Periodic status checks via systemctl
- Log analysis via journalctl
- Thread-safe service tracking
- Error detection and reporting
2026-04-04 18:08:48 +08:00
8aa30b434b style: pack commandParse and socket server to different packages 2026-04-04 18:00:59 +08:00
b367323801 feat(command): add command parsing 2026-04-04 13:44:48 +08:00
0f6045bcbd fix: add newline to response message in handleRequest
Ensure proper message formatting by adding a newline character to the response message before writing to the connection.
2026-04-02 22:21:58 +08:00
f6005cb324 feat: add initial project structure with logging and watchdog service
Implement basic watchdog service for Linux systemd with:
- Configuration loading
- Logging system with database support
- WebSocket log broadcasting
- TCP server for agent communication
- Project setup with Go modules
2026-04-02 21:56:40 +08:00