function serverStatus(){
$this->requireAdmin();
//-------------- deconectat edit ---------------------------------------------------------
$this->output.="<div class='footer'><table> ";
$this->output.="<tr><td>Apache2: </td><td>";
$serviceCount=$this->executeProg3("ps ax | grep /apache2 | grep -v grep | wc -l");
if ($serviceCount > 0) $this->output.="<font color='#00cc00'><strong>YES</strong></font>";
else $this->output.="<font color='#ff0000'><strong>NO</strong></font>";
$this->output.="</td><td> (<a href='?op=startapache2'>Start</a> | <a href='?op=stopapache2'>Stop</a> | <a href='?op=restartapache2'>Restart</a>
</td></tr>";
$this->output.="<tr><td>MySQL: </td><td>";
$serviceCount=$this->executeProg3("ps ax | grep '/mysqld ' | grep -v grep | wc -l");
if ($serviceCount > 0) $this->output.="<font color='#00cc00'><strong>YES</strong></font>";
else $this->output.="<font color='#ff0000'><strong>NO</strong></font>";
$this->output.="</td><td> (<a href='?op=startmysql'>Start</a> | <a href='?op=stopmysql'>Stop</a> | <a href='?op=restartmysql'>Restart</a>
</td></tr>";
$this->output.="<tr><td>Vsftpd: </td><td>";
$serviceCount=$this->executeProg3("ps ax | grep vsftpd | grep -v grep | wc -l");
if ($serviceCount > 0) $this->output.="<font color='#00cc00'><strong>YES</strong></font>";
else $this->output.="<font color='#ff0000'><strong>NO</strong></font>";
$this->output.="</td><td> (<a href='?op=startvsftpd'>Start</a> | <a href='?op=stopvsftpd'>Stop</a> | <a href='?op=restartvsftpd'>Restart</a>
</td></tr>";
$this->output.="<tr><td>Bind: </td><td>";
$serviceCount=$this->executeProg3("ps ax | grep bind | grep -v grep | wc -l");
if ($serviceCount > 0) $this->output.="<font color='#00cc00'><strong>YES</strong></font>";
else $this->output.="<font color='#ff0000'><strong>NO</strong></font>";
$this->output.="</td><td> (<a href='?op=startvsftpd'>Start</a> | <a href='?op=stopvsftpd'>Stop</a> | <a href='?op=restartvsftpd'>Restart</a>
</td></tr>";
$this->output.="</table></div> ";
# i edited this part a bit, ehcpdeveloper
$systemStatus="\n Memory: used free (MB)\n".$this->executeProg3("free -m | grep buffers/ca | cut -d\":\" -f2")."\n--------------------------------------------------------------------------\n";
$systemStatus.="\ndf -h\n".$this->executeProg3("df -h")."\n--------------------------------------------------------------------------\n";
$systemStatus.="\nUptime:\n".$this->executeProg3("uptime");
$systemStatus.="\nhosts.deny:\n".$this->executeProg3("cat /etc/hosts.deny");
$systemStatus.="\nnetstat -anp | grep tcp:\n".$this->executeProg3("netstat -anp | grep tcp");
$this->output.="<div class=\"footer\"><pre>".$systemStatus."</pre></div>";
//-------------- end deconectat edit -----------------------------------------------------
$topoutput=$this->executeProg3("top -b -n 1 | head -40");
$this->output.="<hr><div align=left>Top output: <br> <pre>$topoutput</pre></div>";
$topoutput=$this->executeProg3("tail -100 /var/log/syslog");
$this->output.="<hr><div align=left>Syslog (to see this, you must chmod a+r /var/log/syslog on server console): <br> <pre>$topoutput</pre></div>";
return true;
}
Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.