Topic: Q about loadaverages

I noticed in the changelog that you changed to /proc/loadavg instead of the uptime-program and i just wanted to check if you verify if the fil exist, and if it does not you have a "plan b" to use?

Here's my listing of /:

storage01# ls -al /
total 6164
drwxr-xr-x  15 root  wheel      512 Aug 14 11:07 .
drwxr-xr-x  15 root  wheel      512 Aug 14 11:07 ..
-rw-r--r--   2 root  wheel     1080 Feb  4  2003 .cshrc
-rw-r--r--   1 root  wheel        0 Oct 12  2002 .exists
drwxr-xr-x   2 root  wheel      512 Sep  8  2002 altroot
drwxr-xr-x   2 root  wheel      512 Sep  8  2002 bin
-r--------   1 root  wheel    40448 Oct  9  2002 boot
drwxr-xr-x   4 root  wheel    26112 Oct  9  2002 dev
drwxr-xr-x  17 root  wheel     2048 Aug 14 11:56 etc
drwxr-xr-x   5 root  wheel      512 May 20 01:22 home
drwxr-xr-x   2 root  wheel      512 Oct  9  2002 kern
drwxr-xr-x   2 root  wheel      512 Sep  8  2002 mnt
-rwxr-xr-x   1 root  wheel  6214088 Aug 13 17:02 netbsd
drwxr-xr-x   5 root  wheel      512 Feb  4  2003 root
drwxr-xr-x   2 root  wheel     2048 Sep  8  2002 sbin
drwxr-xr-x   2 root  wheel      512 Sep  8  2002 stand
lrwxr-xr-x   1 root  wheel       11 Sep  8  2002 sys -> usr/src/sys
drwxrwxrwt   2 root  wheel      512 Sep  1 03:23 tmp
drwxr-xr-x  19 root  wheel      512 Aug 13 15:41 usr
drwxr-xr-x  24 root  wheel      512 Aug 12 16:46 var
storage01#

And my enviroment is NetBSD 1.6:

Unix load averages         2.05 1.79 1.69 - 1 users online
Environment        PHP 4.2.3
 PostgreSQL 7.3.3 on i386--netbsdelf, compiled by GCC 2.95.3

Anything else you would like to know about my system, just holler...

Heaven dosen't want me, and hell's afraid I'll take over...
Are YOU ready to post on the forum?

Re: Q about loadaverages

Gah, I was convinced that *BSD used a similar method (/proc/loadavg doesn't exist on *BSD). I guess I will have to go back to the old method.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Q about loadaverages

Maybe do a check if is_dir(/proc) and if file_exists(loadavg) in /proc otherwise use the uptime?

Heaven dosen't want me, and hell's afraid I'll take over...
Are YOU ready to post on the forum?

Re: Q about loadaverages

Yeah, but then again, admin_index.php isn't a very heavily used script so I think I'll go back to the regular uptime method.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Q about loadaverages

Heh, sorry to pour some rain on the parade smile

Heaven dosen't want me, and hell's afraid I'll take over...
Are YOU ready to post on the forum?