
04-14-2009, 08:11 AM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
Access server uptime / loads etc
Im a reseller so dont have full root access.
Can anyone advise how i would access the server uptime & information (ie loads, hdd space etc)
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 10:27 AM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: Texas, USA
Posts: 429
|
|
Well, you can use HyperSpin to keep track of your UpTime. As for the Server Information, HDD Space, etc, those should be under your WHM 'Server Information'. If your provider does not allow you to view it, maybe request it from them. I have a script (I'll find it and give it to you) that shows every detail of a server, HDD Information, mounts, etc. I use this script all the time.
__________________
██ HostXV, LLC -- Shared, Resellers, Business, VPS & Dedicated Servers.
██ cPanel/WHM, Fantastico, Softaculous, RVSkins, RVSite Builder, Hardened & Shielded Servers. 100% Secure!
|

04-14-2009, 01:13 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
The script would be perfect.
I have access to the info just looking to dispaly it outside cpanel
Thank you
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 01:36 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: Texas, USA
Posts: 429
|
|
Hey,
Are you looking for something like this?
View: Click Here
That's what I use.
__________________
██ HostXV, LLC -- Shared, Resellers, Business, VPS & Dedicated Servers.
██ cPanel/WHM, Fantastico, Softaculous, RVSkins, RVSite Builder, Hardened & Shielded Servers. 100% Secure!
|

04-14-2009, 01:44 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
yep that would be exactly something that i would be looking for
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 02:02 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: Texas, USA
Posts: 429
|
|
Here you go.
Code:
<?
// Set the services you want the script to check.
// You can add more by just adding a line "servers name"=>"host/IP:port number",
// You can use game servers or anything.
// e.g. "IRCdaemon"=>"localhost:6667",
$services = array(
"http"=>"localhost:80",
"ssh"=>"localhost:22",
// "telnet"=>"localhost:23",
"ftp"=>"localhost:21",
// "smtp"=>"localhost:25",
"pop3"=>"localhost:110",
"mysql"=>"localhost:3306"
);
// Variables at the top of the page, date, uptime etc.
$date = date("l, M d, Y - h:i:s A");
$version = `uname -sr`;
$name = `hostname`;
$uptime = `uptime`;
// df command function, formatted into a table
function output_df()
{
$disk = `df`;
$lines = split("\n", $disk);
echo "<table border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"1\">";
for ($i = 0; $i < sizeof($lines) && strlen($lines[$i]) > 1; $i++)
{
$cols = preg_split("/[\s]+/", $lines[$i]);
if ($i == 0)
echo "<tr bgcolor=\"black\"><font color=orange>";
else
echo "<tr>";
for ($j = 0; $j < 6; $j++)
{
if ($j == 0 || $j == 5)
$align = "left";
else if ($j == 1 || $j == 2 || $j == 3)
$align = "right";
else if ($j == 4)
$align = "center";
echo "<td align=$align> <font face=\"Verdana\" size=\"1\" color=\"orange\">$cols[$j]</font> </td>";
}
echo "</font></tr>";
}
echo "</table>";
}
// free comand function, formatted into a table
function output_free()
{
$free = `free`;
$lines = split("\n", $free);
echo "<table border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"1\">";
for ($i = 0; $i < sizeof($lines) && strlen($lines[$i]) > 1; $i++)
{
if ($i == 2) $i++;
$cols = preg_split("/[\s]+/", $lines[$i]);
if ($i == 0)
echo "<tr bgcolor=\"black\">";
else
echo "<tr>";
foreach ($cols as $data)
echo "<td align=right> <font face=\"Verdana\" size=\"1\" color=\"orange\">$data</font> </td>";
echo "</tr>";
}
echo "</table>";
}
// info grabbind done, onto the html
?>
<table border="0" align="center" cellpadding="1" cellspacing="0">
<tr><td>
<p><font face="Verdana" size="1"><b>System Status:</b> <? echo $name ?><br><b>Time:</b> <? echo $date ?></font></p>
<font face="Verdana" size="1">
<? echo $version ?><br>
<? echo $uptime ?>
<p><table>
<b>Services:</b><br>
<tr bgcolor="black"><td><font face="Verdana" size="1" color="orange">Status</font></td><td><font face="Verdana" size="1" color="orange">Service</font></td><td><font face="Verdana" size="1" color="orange">Host</font></td></tr>
<?
foreach ($services as $name=>$location)
{
list($host, $port) = split(":",$location);
$running = fsockopen($host, $port, $errno, $errstr, 30);
if (!$running)
$status_color = "red";
else
{
fclose($running);
$status_color = "green";
}
echo "<tr><td align=center><div align=\"center\" style=\"font-size: 13pt; color: $status_color\" width=\"15\" height=\"15\"><b>?</b></div></td><td><font face=\"Verdana\" size=\"1\">$name</font></td><td><font face=\"Verdana\" size=\"1\">$host</font></td></tr>";
}
?>
</table></p>
<b>Memory:</b><br>
<? output_free(); ?><br>
<b>Drive Info:</b><br>
<? output_df(); ?>
</font>
</td></tr></table>
__________________
██ HostXV, LLC -- Shared, Resellers, Business, VPS & Dedicated Servers.
██ cPanel/WHM, Fantastico, Softaculous, RVSkins, RVSite Builder, Hardened & Shielded Servers. 100% Secure!
|

04-14-2009, 04:37 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
thanks for the script, however does not work with shell_exec disabled, grr
Annoying me now
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 04:44 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: Texas, USA
Posts: 429
|
|
__________________
██ HostXV, LLC -- Shared, Resellers, Business, VPS & Dedicated Servers.
██ cPanel/WHM, Fantastico, Softaculous, RVSkins, RVSite Builder, Hardened & Shielded Servers. 100% Secure!
|

04-14-2009, 04:49 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
is there anyway to disable it for just that domain?
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 04:53 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: Texas, USA
Posts: 429
|
|
I'm not exactly sure. I hope someone else can assist you in this question.
__________________
██ HostXV, LLC -- Shared, Resellers, Business, VPS & Dedicated Servers.
██ cPanel/WHM, Fantastico, Softaculous, RVSkins, RVSite Builder, Hardened & Shielded Servers. 100% Secure!
|

04-14-2009, 05:16 PM
|
|
Hail Eris !
|
|
Join Date: Oct 2002
Location: Canada
Posts: 3,100
|
|
If you can use cron to schedule jobs on server, you could make small script that will gather data for you and have it run every minute. Something like this:
Code:
#!/bin/sh
DATA_DIR=/home/username/html/data/
uname -sr > $DATA_DIR/version
hostname > $DATA_DIR/hostname
uptime > $DATA_DIR/uptime
free > $DATA_DIR/free
df > $DATA_DIR/df
... and then from your php rather then calling exec you read data from files with file_get_contents()
So instead
PHP Code:
$version = `uname -sr`; $name = `hostname`; $uptime = `uptime`; .... function output_df() { $disk = `df`;
... function output_free() { $free = `free`; ...
You would have
PHP Code:
$DATA_DIR = '/home/username/html/data/';
$version = file_get_contents("$DATA_DIR/version"); $name = file_get_contents("$DATA_DIR/hostname"); $uptime = file_get_contents("$DATA_DIR/uptime"); ....
function output_df() { global $DATA_DIR; $disk = file_get_contents("$DATA_DIR/df");
... function output_free() { global $DATA_DIR; $disk = file_get_contents("$DATA_DIR/free");
Last edited by sasha; 04-14-2009 at 05:22 PM.
|

04-14-2009, 06:20 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
ive tried using file_get_contents for the /proc/uptime scripts but getting open base dir restrictions.
Would the method of home/username/html/data work instead?
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|

04-14-2009, 06:54 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: United Kingdom
Posts: 442
|
|
There was a free script on sourceforge that did exactly this. I will have to take a look and find it for you.
|

04-14-2009, 06:57 PM
|
|
Aspiring Evangelist
|
|
Join Date: Feb 2008
Location: United Kingdom
Posts: 442
|
|
Nevermind, I've found it!
Link: http://phpsysinfo.sourceforge.net/
There is also some demo links on there, so you can see what it is like before you download. I'm not sure if it works with shell_exec disabled though.
|

04-14-2009, 07:15 PM
|
|
WHT Addict
|
|
Join Date: Jul 2003
Posts: 120
|
|
jus trying that
was hoping to write my own
David
__________________
David Spalton
www.solidwebservices.net
European & US Webhosting at Affordable Prices
UK: 033 0001 1098 | USA: +1 (347) 878 2932
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|