Count9 #7
@@ -132,12 +132,22 @@ public class AccountEnforcementService : BackgroundService
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
process.Start();
|
process.Start();
|
||||||
|
string output = await process.StandardOutput.ReadToEndAsync(ct);
|
||||||
|
string error = await process.StandardError.ReadToEndAsync(ct);
|
||||||
await process.WaitForExitAsync(ct);
|
await process.WaitForExitAsync(ct);
|
||||||
_logger.LogInformation("Sent RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac})", session.NasIpAddress, profile.Username, session.CallingStationId);
|
|
||||||
|
if (process.ExitCode == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Sent RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac}). Response: {Output}", session.NasIpAddress, profile.Username, session.CallingStationId, output);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Failed RADIUS Disconnect-Request to NAS {NasIp}. Exit Code: {Code}, Error: {Error}, Output: {Output}", session.NasIpAddress, process.ExitCode, error, output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to send RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
_logger.LogError(ex, "Exception sending RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -404,12 +404,22 @@ public class RadiusService : IRadiusService
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
process.Start();
|
process.Start();
|
||||||
|
string output = await process.StandardOutput.ReadToEndAsync();
|
||||||
|
string error = await process.StandardError.ReadToEndAsync();
|
||||||
await process.WaitForExitAsync();
|
await process.WaitForExitAsync();
|
||||||
_logger.LogInformation("Sent manual RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac})", session.NasIpAddress, username, session.CallingStationId);
|
|
||||||
|
if (process.ExitCode == 0)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Sent manual RADIUS Disconnect-Request to NAS {NasIp} for user {Username} (MAC: {Mac}). Response: {Output}", session.NasIpAddress, username, session.CallingStationId, output);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Failed RADIUS Disconnect-Request to NAS {NasIp}. Exit Code: {Code}, Error: {Error}, Output: {Output}", session.NasIpAddress, process.ExitCode, error, output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to send manual RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
_logger.LogError(ex, "Exception sending manual RADIUS Disconnect-Request to NAS {NasIp}", session.NasIpAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user