HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/nyloncams.com/public_html/admin/server_status.php
<? require "header.php"; ?>

<div class="content-page">

    <div class="header-area">
        <div class="breadcrumbs">  
            <a href="index.php">Admin Home</a>          
        </div>
    </div>

    <div class="content-outer">

        <h2>Server<strong>Status</strong></h2>

        <?
        $loadresult = @exec('uptime');
        preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $loadresult, $avgs);
        $uptime = explode(' up ', $loadresult);
        $uptime = explode(',', $uptime[1]);
        $uptime = $uptime[0] . ', ' . $uptime[1];
        ?>

        <table class="system-status-report">
            <tbody>
                <tr class="ok">
                    <th>MySQL</th>
                    <td><? echo(dbValue("SHOW VARIABLES LIKE \"version\"",'Value')); ?></td>
                </tr>
                <tr class="ok">
                    <th>PHP</th>
                    <td><? echo phpversion(); ?></td>
                </tr>
                <tr class="ok">
                    <th>System Time</th>
                    <td><? echo date('Y-m-d H:i:s'); ?></td>
                </tr>
                <tr class="ok">
                    <th>MySQL Time</th>
                    <td><? echo dbValue("SELECT NOW() AS `time`", 'time'); ?></td>
                </tr>
                <tr class="ok">
                    <th>Disk Space</th>
                    <td><pre><? echo shell_exec("df -h"); ?></pre></td>
                </tr>
                <tr class="ok">
                    <th>RAM</th>
                    <td><pre><? echo shell_exec("free"); ?></pre></td>
                </tr>

                <tr><th></th><td><strong>PATHS</strong></td></tr>

              

                <? $res = file_exists($config['php_path']); ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>PHP CLI BINARY</th>
                    <? if ($res === true) { ?>
                        <td>Path to PHP CLI is correct (<em><? echo $config['php_path']; ?></em>).</td>
                    <? } else { ?>
                        <td>Missing or incorrect path to PHP CLI</td>
                    <? } ?>
                </tr>

              


                <tr><th></th><td><strong>PHP INFO</strong></td></tr>

                <? $res = extension_loaded('mbstring'); ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>PHP Extension:</th>
                    <? if ($res === true) { ?>
                        <td><b>mbstring</b> extension is enabled.</td>
                    <? } else { ?>
                        <td><b>mbstring</b> extension is missing.</td>
                    <? } ?>
                </tr>

                <? $res = function_exists('curl_version'); ?>
                <? if ($res === true) { ?>
                    <? $version = curl_version(); ?>
                <? } ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>PHP Extension:</th>
                    <? if ($res === true) { ?>
                        <td><b>cURL</b> extension is enabled (v. <? echo $version['version']; ?>).</td>
                    <? } else { ?>
                        <td><b>cURL</b> extension is missing.</td>
                    <? } ?>
                </tr>

               

                <tr><th></th><td><strong>FILESYSTEM PERMISSIONS</strong></td></tr>

                <? $res = isChmod("$basepath/admin/scripts") == '777'; ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>CHMOD</th>
                    <? if ($res === true) { ?>
                        <td><em><? echo $basepath; ?>/admin/scripts</em> directory is writable.</td>
                    <? } else { ?>
                        <td><em><? echo $basepath; ?>/admin/scripts</em> directory not writable! Please chmod it to 777.</td>
                    <? } ?>
                </tr>

               

               

                <? $res = isChmod("$cache_path") == '777'; ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>CHMOD</th>
                    <? if ($res === true) { ?>
                        <td><em><? echo $cache_path; ?></em> directory is writable.</td>
                    <? } else { ?>
                        <td><em><? echo $cache_path; ?></em> directory not writable! Please chmod it to 777.</td>
                    <? } ?>
                </tr>


                <tr><th></th><td><strong>OTHER INFORMATIONS</strong></td></tr>

                <? $res = ($admin_password != 'admin'); ?>
                <tr class="<? echo $res === true ? 'ok' : 'error'; ?>">
                    <th>Admin Account</th>
                    <? if ($res === true) { ?>
                        <td>Admin password is configured.</td>
                    <? } else { ?>
                        <td>Please set your admin password in <em>admin/config.php</em> (via ftp/ssh)</td>
                    <? } ?>
                </tr>

                <tr class="ok">
                    <th>Server Load Averages (<a href='http://en.wikipedia.org/wiki/Load_%28computing%29' target='_blank'>?</a>)</th>
                    <td><? echo $avgs[1] . ', ' . $avgs[2] . ', ' . $avgs[3] ?></td>
                </tr>

                <tr class="ok">
                    <th>Server Uptime</th>
                    <td><? echo $uptime ?></td>
                </tr>

                <tr class="ok">
                    <th>Running SQL Queries</th>
                    <td>
                        <? $results = dbQuery("SHOW FULL PROCESSLIST", false); ?>
                        <? if (is_array($results)) { ?>
                            <? foreach ($results as $result) { ?>
                                <? if ($row['Info']) { ?>
                                    <table>
                                        <tr>
                                            <td width="75"><? echo $row['Command']; ?></td>
                                            <td><? echo $row['Info']; ?></td>
                                        </tr>
                                    </table>
                                <? } ?>
                            <? } ?>
                        <? } ?>
                    </td>
                </tr>

            </tbody>
        </table>
        
    </div>
</div>

<? require "footer.php"; ?>