System monitoring and diagnostics