Jump to content

No uptime in FreeBSD


Recommended Posts

I've tried to find a solution to this in the forum, but could't find it. So if this have been issued before I apologize.

 

My FreeBSD don't have a proc-fs so the uptime in the status page shows 00:00:00.

 

Go to the status/index.php file.

Find and remove the existing line:

$uptime = shell_exec("cut -d. -f1 /proc/uptime");

 

Insert the following at the same location:

$boottimeSec = shell_exec('/sbin/sysctl kern.boottime');// Get boottime in seconds
$aSec = explode (" ", $boottimeSec);                    // Explode and return array
$bSec = ereg_replace('\,', '', $aSec[4]);               // Remove trailing comma
$uptime = time() - $bSec;                               // Find uptime in seconds

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated