-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path500.php
52 lines (43 loc) · 1.26 KB
/
500.php
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
<?php
/**
* 500 File Doc Comment
*
* @category Show_500_Errors
* @package MyMon
* @author himaster <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link http://mymon.pkwteile.de
*/
if ($_SERVER["SCRIPT_NAME"] != "/index.php") {
die();
}
if (( ! $connection = @ssh2_connect($_GET['serverip'], 22))
or ( ! @ssh2_auth_pubkey_file($connection, 'root', $docroot.'/id_rsa.pub', $docroot.'/id_rsa', ''))) {
header($_SERVER['SERVER_PROTOCOL'].' 501 Internal Server Error', true, 500);
die("Connection error!");
}
backButton("/");
?>
<div class="textstyle">
<?php
if (empty($_GET["page"])) {
$page = 1;
} else {
$page = $_GET["page"];
}
echo "<p align=center>";
if ($page > 1) {
echo "<a href=index.php?task=500err&serverip=".$_GET['serverip']."&page=".($page - 1)."><</a>";
} else {
echo " ";
}
echo " -".$page."- ";
$str_amount = ssh2_return($connection, "cat /var/log/500err.log");
if ($str_amount > ($page * 10)) {
echo "<a href=index.php?task=500err&serverip=".$_GET['serverip']."&page=".($page + 1).">></a><br>";
}
echo "</p>";
$str = ssh2_return($connection, "tail -n +".not_less_than_zero($str_amount - ($page * 10))." /var/log/500.errs | head -n 10");
echo nl2br($str);
?>
</div>