InsightFinder Windows Agent for Digital Employee Experience (DEX) monitoring. This agent collects comprehensive system metrics from Windows endpoints and sends them to the InsightFinder platform for analysis and anomaly detection.
The win-dex-agent is a lightweight monitoring agent designed to collect real-time performance metrics from Windows systems. It leverages both native Go libraries and Windows Performance Data Helper (PDH) APIs to gather detailed system telemetry, enabling IT teams to monitor and improve digital employee experience.
-
Multi-source Metric Collection
- CPU utilization and performance metrics
- Memory usage and availability
- Disk I/O and storage metrics
- Network interface statistics
- Thermal/temperature monitoring
- Process-level metrics
-
InsightFinder Integration
- Direct metric streaming to InsightFinder platform
- Automatic data formatting and submission
- Built-in retry and error handling
- Operating System: Windows 10/11 or Windows Server 2016+
- Go Version: 1.23 or higher
- Permissions: Administrator privileges (required for PDH access and low-level metrics)
-
Clone the repository:
git clone https://github.com/your-org/win-dex-agent.git cd win-dex-agent -
Build the agent:
go build -o win-dex-agent.exe
-
Run as administrator:
# Right-click and select "Run as administrator" or use: runas /user:Administrator win-dex-agent.exe
Configure the agent using in the main.go file to build the executable:
IFClient := insightfinder.CreateInsightFinderClient("https://app.insightfinder.com", "insightfinder_username", "insightfinder_licensekey", "insightfinder-project")The agent consists of several key components:
main.go: Entry point and orchestrationcollector/: Metric collection modulesgeneralCollector.go: Native Go-based system metricspdhCollectorService.go: Windows PDH counter collectiongeneralCollectorModel.go&pdhDataModel.go: Data modelsutils.go: Shared utilities
insightfinder/: InsightFinder API integrationinsightfinder.go: Main API clientmodel.go&projectDataModel.go: API data structuresutility.go: Helper functions
internal/: Internal librariespdh/: Windows PDH API bindingsheaders/: Windows API headers
cache/: Local data cachingtool/: Utility tools
- CPU usage (per core and aggregate)
- Memory utilization and availability
- Disk read/write operations
- Disk space usage
- Network interface throughput
- System uptime
- Processor queue length
- Context switches
- Thread count
- Handle count
- Page faults
- And many more Windows-specific counters
To run the agent as a Windows service, you can use tools like NSSM (Non-Sucking Service Manager):
- Download NSSM from https://nssm.cc/
- Install the service:
nssm install WinDexAgent "C:\path\to\win-dex-agent.exe" nssm start WinDexAgent
Permission Denied Errors
- Ensure you're running the agent with Administrator privileges
- Some PDH counters require elevated permissions
Connection Failures
- Verify your InsightFinder credentials and server URL
- Check network connectivity and firewall settings
- Ensure outbound HTTPS traffic is allowed
Missing Metrics
- Some performance counters may not be available on all Windows versions
- Check Windows Event Viewer for PDH-related errors
The agent logs to standard output. Redirect to a file for persistent logging:
win-dex-agent.exe > agent.log 2>&1