Add host-status module for collecting host status#9
Open
smol-squad wants to merge 7 commits into
Open
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements issue #8: New module for collecting host status
Overview
This PR adds a new module that provides flexible host monitoring with both pull and push models for status collection.
Features Implemented
Core Functionality
Provider System
Pull Model (HTTP Server)
/statusendpoint for on-demand queries/healthendpoint for health checksPush Model (Periodic Scheduler)
Example Providers
All providers follow the contract:
status,metrics, andmessagefieldsok,warn,errorConfiguration System
Testing
Documentation
Deployment Support
Architecture
The module is organized into clean, focused components:
config.go: Configuration parsing and validationprovider.go: Provider execution engine and registryserver.go: HTTP server for pull modelpusher.go: Scheduler for push modelmain.go: Application entry point with graceful shutdownCode Quality
gofmtformatted)Testing
All functionality has been tested:
Example providers tested and working:
$ ./examples/providers/memory.sh { "status": "ok", "metrics": { "total_mb": 7398, "used_mb": 362, "available_mb": 7036, "used_percentage": 4.00 }, "message": "Memory usage: 362MB / 7398MB (4.00%)" }Usage Example
Integration with smol-modules
This module follows all smol-modules conventions:
modules/host-status/directoryflake.nixfor reproducible dev environmentREADME.mdCloses
Closes #8
Review Notes
The implementation covers all requirements from the issue:
Ready for review and testing!