Phpsysinfo Problem

Support section for FREESCO v0.3.x 3rd Party Packages

Postby 30K » Thu Mar 15, 2007 10:24 am

I found a little problem - phpsysinfo shows nothing in Network Usage table with some of kernels. My freesco is 036 and when it runs at 032-pptp kernel - it shows Network Usage quite right. When I change kernel to kernel-037.cd-686-triton-vipc-power_off (and some other kernels - kernel-035.586-vipc.bin, kernel-035.586-triton-vipc.bin) - it shows nothing in Network Usage and in top of the page. Ussually there
System Information: ns125(10.123.125.10)
- but now there
System Information: N.A. (10.123.125.10)

My chipset is 440LX (Intel 82371AB PIIX4 IDE ).
Sorry for my English.
<a href='http://123-125.homeip.net:1080/' target='_blank'><img src='http://123-125.homeip.net:1080/uptime/info.png' border='0' alt='user posted image' /></a>
User avatar
30K
Junior Member
 
Posts: 25
Joined: Sun Jan 22, 2006 7:06 am

Postby dingetje » Fri Mar 16, 2007 1:45 am

That information is obtained via this PHP code:

Code: Select all
    // get our canonical hostname
    function chostname ()
    {
        if ($fp = fopen('/proc/sys/kernel/hostname','r')) {
            $result = trim(fgets($fp, 4096));
            fclose($fp);
            $result = gethostbyaddr(gethostbyname($result));
        } else {
            $result = 'N.A.';
        }
        return $result;
    }


basically it reads the contents of /proc/sys/kernel/hostname

The same can be accomplished from a shell with the following statement:
Code: Select all
[root@Freesco] cat /proc/sys/kernel/hostname


Are there any other items missing from the phpsysinfo page when you switch kernels?
GreetZ
http://dingetje.homeip.net

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1004
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby Stig » Fri Mar 16, 2007 6:16 am

Wher can i find the "function chostname"?

In the /www/phpsysinfo/index.php?

Look here
[stig@Freesco] cat /proc/sys/kernel/hostname
www.sadako.mine.nu


Look <a href='http://www.sadako.mine.nu/phpsysinfo/' target='_blank'>phpsysinfo</a>


Not same
User avatar
Stig
Member
 
Posts: 71
Joined: Thu May 09, 2002 7:02 pm

Postby 30K » Fri Mar 16, 2007 10:32 am

Code: Select all
[root@Freesco] cat /proc/sys/kernel/hostname
ns125.vostok
[root@Freesco]
That's ok on my box. But where the script whis this code above (// get our canonical hostname)? :)
<a href='http://123-125.homeip.net:1080/' target='_blank'><img src='http://123-125.homeip.net:1080/uptime/info.png' border='0' alt='user posted image' /></a>
User avatar
30K
Junior Member
 
Posts: 25
Joined: Sun Jan 22, 2006 7:06 am

Postby Slowpoke » Fri Mar 16, 2007 2:02 pm

30K wrote: where the script

It's part of the phpsysinfo package.
User avatar
Slowpoke
Advanced Member
 
Posts: 233
Joined: Fri Aug 12, 2005 4:08 pm
Location: Upstate New York, USA

Postby 30K » Fri Mar 16, 2007 2:05 pm

Thank you, I understand ... :)
I found this code here .../phpsysinfo/includes/os/class.Linux.inc.php
When I execute all commands in shell (cat /proc/sys/kernel/hostname, cat /proc/net/dev) - they are working fine.
But it still N.A where must be the name of server, and still empty in Network Usage box.
<a href='http://123-125.homeip.net:1080/' target='_blank'><img src='http://123-125.homeip.net:1080/uptime/info.png' border='0' alt='user posted image' /></a>
User avatar
30K
Junior Member
 
Posts: 25
Joined: Sun Jan 22, 2006 7:06 am

Postby dingetje » Fri Mar 16, 2007 3:24 pm

Stig wrote: Wher can i find the "function chostname"?

In the /www/phpsysinfo/index.php?

Look here
[stig@Freesco] cat /proc/sys/kernel/hostname
www.sadako.mine.nu


Look <a href='http://www.sadako.mine.nu/phpsysinfo/' target='_blank'>phpsysinfo</a>


Not same


30K has found the code :)

But I wasn't 100% correct in my first reply, because the PHP code also does this:
Code: Select all
gethostbyaddr(gethostbyname($result));


You can lookup these functions in the PHP online manual, but you can probably guess by the function names its a name lookup.
This explains why you get 'www' instead of the output of the 'cat' command.
GreetZ
http://dingetje.homeip.net

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO GURU !!
 
Posts: 1004
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby Lightning » Fri Mar 16, 2007 8:12 pm

As to the exact cause of the problem I am unsure. But I can say there are actually quite a few differences in the 035+ kernels to the older kernels. The original 2.0.39 kernel source from 034- was manually patched with the 2.0.40 kernel source along with some extra security patches. Previously when I ran just the new 2.0.40 kernel it caused a number of problems in 033. So I decided to take the original source and make some of the newer updates to it manually to resolve those problems. This was also done to try and finally resolve some problems with IPSEC kernel stability that was present in the 2.0.40 kernel. So in essence the new FREESCO kernel is reaslly a 2.0.40 kernel. but in reality it is a FREESCO linux kernel due to the large number of changes to the original code and I left it's version at 2.0.39 for driver compatibility reasons.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 3045
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Burma » Mon Apr 23, 2007 3:18 pm

Hello,

This saturday I've upgraded my box from freesco 0.35 to freesco 0.37 and it works fine, but I've the same problem with phpsysinfo than 30K.
I think it's a problem of permissions in /proc because if I log in with a basic user and do
cat /proc/sys/kernel/hostname
I obtain
cat: /proc/sys/kernel/hostname: Permission denied
.
So I've tried to modify the permissions of /proc/sys bur it doesn't work.

So is there any solution ?

PS : sorry for my english.
User avatar
Burma
Newbie
 
Posts: 13
Joined: Tue May 04, 2004 12:58 pm
Location: Angers, FRANCE

Postby Lightning » Mon Apr 23, 2007 6:38 pm

There is a security patch in place in all of the 035, 036, and 037 kernels that control access to the /proc directory and permissions on that directory can not be changed manually. So my recommendation would be to either run an older 034 kernel or the newest 038 kernel which has that security patch disabled so that the ident server runs correctly.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 3045
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby 30K » Sun Apr 29, 2007 4:22 pm

With kernel-038.cd-686-triton-vipc-power_off all the same.
<a href='http://123-125.homeip.net:1080/' target='_blank'><img src='http://123-125.homeip.net:1080/uptime/info.png' border='0' alt='user posted image' /></a>
User avatar
30K
Junior Member
 
Posts: 25
Joined: Sun Jan 22, 2006 7:06 am

Postby Thasaidon » Sun Oct 07, 2007 8:45 am

or the newest 038 kernel

I take it the 038 kernels can be used in 037 too?

I'm running the kernel-037.vipc-ipsec and am having the same problem.
But there is no 038 kernel with vipc and ipsec support...

Also, my "Network Usage" doesn't display anything...
but I'm still looking into that
Experience shared, is experience gained.

Thasaidon's Freesco Page




Image
User avatar
Thasaidon
Advanced Member
 
Posts: 411
Joined: Tue Feb 05, 2002 9:38 am
Location: The Netherlands


Return to 3rd Party Package Support for FREESCO v0.3.x

Who is online

Users browsing this forum: No registered users and 1 guest