Donnerstag, 14. August 2014

show linux process status on a website with php

html code:

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<center>
<?php
  exec("ps ax | grep PROCESS_NAME | grep -v grep 2>&1", $output, $ret);
?>
<table>
<tr>
<td align="undefined" valign="undefined">
<h2>
<?php if ($ret == "0") { echo "PROCESS IS RUNNING..."; } else {echo "PROCESS IS STOPPED"; } ?> </td>
</h2>
</tr>
</table>
</body>
</html>

Keine Kommentare:

Kommentar veröffentlichen