18 lines
355 B
PHP
Executable file
18 lines
355 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
|
|
require_once __DIR__.'/base_script.php';
|
|
|
|
$threshold = 890;
|
|
$delay = 10;
|
|
echo "Restart when java connections exceed $threshold\n";
|
|
|
|
while (true) {
|
|
sleep($delay);
|
|
$level = exec('netstat -pan | grep "java" | wc -l');
|
|
echo "$level ";
|
|
if ($level > $threshold) {
|
|
show_run("Restarting", "bin/restart");
|
|
}
|
|
}
|