no1uno Posted February 10, 2008 Share Posted February 10, 2008 Hi The server status page is showing Load & Uptime as "Not Available" Is this due to my server (2003 server IIS6), or is the script meant for Linux servers? Thanks 0 Quote Link to comment Share on other sites More sharing options...
0 soskel Posted February 10, 2008 Share Posted February 10, 2008 I think, I THINK if you go into the admin panel and hit "Check Network Status" on the main page, it will find the load and uptime. 0 Quote Link to comment Share on other sites More sharing options...
0 PPH Posted February 10, 2008 Share Posted February 10, 2008 It appears that way for all Windows servers. 0 Quote Link to comment Share on other sites More sharing options...
0 no1uno Posted February 10, 2008 Author Share Posted February 10, 2008 I think, I THINK if you go into the admin panel and hit "Check Network Status" on the main page, it will find the load and uptime. Hi Soskel Thanks, but no it doesn't show in the admin panel either. Cheers 0 Quote Link to comment Share on other sites More sharing options...
0 no1uno Posted February 10, 2008 Author Share Posted February 10, 2008 It appears that way for all Windows servers. Hi PPH Is this because the code in the Status folder is written for Linux? I saw this post that could be useful if it could incorporated into the current Status script! http://forum.whmcs.com/showthread.php?t=7011 Cheers 0 Quote Link to comment Share on other sites More sharing options...
0 no1uno Posted February 11, 2008 Author Share Posted February 11, 2008 Also, I found this script on a open-source control panel I used to to use. It showed the server uptime on my windows machine. Unfortunately I don't know much about PHP, but maybe someone can get it to work with the current WHMCS status script. <? if (strpos(strtolower($_SERVER["SERVER_SOFTWARE"]), 'unix') || strpos(strtolower($_SERVER["SERVER_SOFTWARE"]), 'linux')) { $data = shell_exec('uptime'); $uptime = explode(' up ', $data); $uptime = explode(',', $uptime[1]); $uptime = $uptime[0].', '.$uptime[1]; echo $uptime; }else{ if ($sysdrive <> '') { $test= filemtime($sysdrive.":/pagefile.sys"); // Path to your Swap File (adjust it if necessary) $up = time() - $test; $days = floor($up / 86400); $up -= ($days * 86400); $hours = floor($up / 3600); $up -= ($hours * 3600); $minutes = floor($up / 60); $up -= ($minutes * 60); $seconds = $up; if (isset($getuptime)) { $template_uptime = $days." d, ".$hours." h, ".$minutes." m and ".$seconds." s"; }else{ echo $days." d, ".$hours." h, ".$minutes." m and ".$seconds." s"; } }else{ $template_uptime = 'Not Available'; } } ?> 0 Quote Link to comment Share on other sites More sharing options...
0 mediademon Posted July 15, 2008 Share Posted July 15, 2008 Hi Any movement on this? mediademon 0 Quote Link to comment Share on other sites More sharing options...
0 eugenevdm Posted September 4, 2010 Share Posted September 4, 2010 I know enough about PHP scripting to get things working and the script you supplied simply does not work. I am researching now for alternative methods. 0 Quote Link to comment Share on other sites More sharing options...
0 supernix Posted October 10, 2010 Share Posted October 10, 2010 I am on a Linux system as well and it wont work. I get 0 for the uptime and nothing for server load. 0 Quote Link to comment Share on other sites More sharing options...
0 laszlof Posted October 10, 2010 Share Posted October 10, 2010 That script will not return a "load average" for a windows server. Such a thing doesn't even exist. However, the uptime code appears to be valid assuming you haven't renamed/moved your swap file. The swap file gets recreated after every reboot. The script above checks the modification time of that file to determine what the servers uptime is. If you're having trouble with it, I'm assuming its failing in locating the $sysdrive variable. You may need to hardcode the path to your swap file to resolve that. Further on that, that script looks like it was ripped out of another script. There are pieces missing, and the output format is not correct. Heres an example of a valid output: 3.09 0 Days 09:15:30 5.2.14 5.0.91 2.2.0 The format is "<LOAD> <UPTIME> <PHP_VER> <MYSQL_VER> <ZEND_VER?>" This should be trivial to output (aside from the load) for anyone with basic PHP knowledge on a windows server. 0 Quote Link to comment Share on other sites More sharing options...
Question
no1uno
Hi
The server status page is showing Load & Uptime as "Not Available"
Is this due to my server (2003 server IIS6), or is the script meant for Linux servers?
Thanks
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.