$load_average on FreeBSD?

scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Fri, 2010-11-12 18:18

on FreeBSD 8.1, "/proc/loadavg" doesn't exist.

in

/gallery3/modules/gallery/helpers/gallery_block.php

case "platform_info":
      $block->css_id = "g-platform";
      $block->title = t("Platform information");
      $block->content = new View("admin_block_platform.html");
      if (@is_readable("/proc/loadavg") && $first_line = current(@file("/proc/loadavg"))) {
        $block->content->load_average =
          join(" ", array_slice(explode(" ", $first_line), 0, 3));
      } else {
        $block->content->load_average = t("Unavailable");
      }
      break;

how would I modify the code so that output of

sysctl vm.loadavg

or

sysctl vm.loadavg | awk '{ print $3, $4, $5}'

is displayed instead?

__________________________________________________________
liberate your photos with Gallery, make the switch today!
http://pixi.me/

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2010-11-18 21:10

https://sourceforge.net/apps/trac/gallery/ticket/1491 -- fixed in the 3.0.x branch :-)
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git