update-server-status-v2

Gesponsorde koppelingen

PHP script bestanden

  1. update-server-status-v2

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
    $settings
= array(
        'serverName'=>$_SERVER['SERVER_NAME'],
        'services'=>array(
            array(
                'name'=>'Apache2',
                'ip'=>'localhost',
                'port'=>80
            ),
            array(
                'name'=>'MySQL',
                'ip'=>'localhost',
                'port'=>3306
            ),
            array(
                'name'=>'FTP',
                'ip'=>'localhost',
                'port'=>21
            ),
            array(
                'name'=>'SSH',
                'ip'=>'localhost',
                'port'=>22
            )
        ),

        'info'=>array(
            '<strong>PHP: </strong> <a href="?phpinfo">phpinfo()</a>'
        )
    );

    if(isset($_GET['phpinfo'])) {
        exit(phpinfo());
    }

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl" lang="nl">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
        <title>Server Informatie</title>
    </head>

    <body>
        <h2>Server informatie van <?php echo $settings['serverName']; ?></h2>
        <p>
            <?php
                foreach($settings['services'] as $service) {
                    echo '<strong>'.$service['name'].': </strong>';
                    if(!@fsockopen($service['ip'], $service['port'], $errno, $errstr, 10)) {
                        echo '<span style="color: red;">Not running</span>';
                    }
else {
                        echo '<span style="color: green;">Running</span>';
                    }

                    echo '<br />';
                }

                foreach($settings['info'] as $info) {
                    echo $info.'<br />';
                }

            ?>

        </p>
    </body>
</html>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.