mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-07-06 21:17:51 +02:00
separate scripts for workflow
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting system monitoring..."
|
||||
|
||||
# Read API PID from file
|
||||
API_PID=$(cat api_pid.txt)
|
||||
echo "Monitoring API process with PID: $API_PID"
|
||||
|
||||
# Save monitoring PID to file for later cleanup
|
||||
echo $$ > $MONITOR_PID_FILE
|
||||
|
||||
while true; do
|
||||
date >> logs/system_monitor.log
|
||||
echo "Memory usage:" >> logs/system_monitor.log
|
||||
free -m >> logs/system_monitor.log
|
||||
echo "Process info:" >> logs/system_monitor.log
|
||||
ps aux | grep -E 'python|garak' >> logs/system_monitor.log
|
||||
echo "Network connections:" >> logs/system_monitor.log
|
||||
netstat -tulpn | grep python >> logs/system_monitor.log 2>/dev/null || echo "No network connections found" >> logs/system_monitor.log
|
||||
echo "API process status:" >> logs/system_monitor.log
|
||||
if ps -p $API_PID > /dev/null; then
|
||||
echo "API process is running" >> logs/system_monitor.log
|
||||
else
|
||||
echo "API process is NOT running!" >> logs/system_monitor.log
|
||||
fi
|
||||
echo "-------------------" >> logs/system_monitor.log
|
||||
sleep 10
|
||||
done
|
||||
Reference in New Issue
Block a user