Update code
This commit is contained in:
24
mcp-server-ssh/check_test_logs.cjs
Normal file
24
mcp-server-ssh/check_test_logs.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
const { Client } = require('ssh2');
|
||||
const conn = new Client();
|
||||
conn.on('ready', () => {
|
||||
// Get all logs since the deployment (11:18:09)
|
||||
const cmd = `tail -500 /var/log/bigwo/server-out.log | grep -A 2 -E '(FC\\]|Volcengine.*Update|Volcengine.*Start|Command|ExternalTextToSpeech|TTS segment|Step1|Step2|function|StartVoiceChat resp|TTSConfig|error|Error|FAILED)'`;
|
||||
conn.exec(cmd, (err, stream) => {
|
||||
if (err) { console.error('exec error:', err); conn.end(); return; }
|
||||
let out = '';
|
||||
stream.on('data', d => out += d.toString());
|
||||
stream.stderr.on('data', d => process.stderr.write(d));
|
||||
stream.on('close', () => {
|
||||
console.log(out || '(no output)');
|
||||
conn.end();
|
||||
});
|
||||
});
|
||||
}).on('error', err => {
|
||||
console.error('SSH error:', err.message);
|
||||
}).connect({
|
||||
host: '119.45.10.34',
|
||||
port: 22,
|
||||
username: 'root',
|
||||
password: '#xyzh%CS#2512@28',
|
||||
readyTimeout: 10000,
|
||||
});
|
||||
Reference in New Issue
Block a user