rowan osborne
New member
I need to create a php script to see if a windows process is running, for example at the moment i have a script
function servercheck($server,$port){
if(empty($port)){
$port=15779;
}
if(empty($server)){
$server='localhost';
}
$fp=@fsockopen($server, $port, $errno, $errstr, 1);
if($fp){
return 1;
} else{
return 0;
}
fclose($fp);
}
$services=array(
'Server1' => array('localhost' => 15779),
'Server2' => array('localhost' => 15780),
But when this checks it disconnects the servers and disallows the connection to the servers, i need a way of changing it from checking a port to checking for a process like
If the script can detect windows process run.exe is running then the output would display Online.
Is there a way i can do this and if someone can provide me with help on this script ide be greatful!
function servercheck($server,$port){
if(empty($port)){
$port=15779;
}
if(empty($server)){
$server='localhost';
}
$fp=@fsockopen($server, $port, $errno, $errstr, 1);
if($fp){
return 1;
} else{
return 0;
}
fclose($fp);
}
$services=array(
'Server1' => array('localhost' => 15779),
'Server2' => array('localhost' => 15780),
But when this checks it disconnects the servers and disallows the connection to the servers, i need a way of changing it from checking a port to checking for a process like
If the script can detect windows process run.exe is running then the output would display Online.
Is there a way i can do this and if someone can provide me with help on this script ide be greatful!