BetaArchive Logo
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 3d, 12h, 45m | CPU: 19% | MEM: 2223MB of 3649MB used
{The community for beta collectors}

Forum rules


Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it


Post new topic Reply to topic  [ 8 posts ] 
Author Message
 PostPost subject: How to make a server usage meter?        Posted: Fri Feb 08, 2008 2:21 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Oct 23, 2007 11:21 pm

Posts
594
How to make a server usage meter like this one?

http://www.betaarchive.co.uk/cpu.php


Top  Profile
 PostPost subject:        Posted: Fri Feb 08, 2008 5:06 pm 
Reply with quote
FTP Access
Offline

Joined
Wed Jun 27, 2007 8:13 pm

Posts
130

Location
France
You can use SNMP to get the data.
Then you can read the manual to use it with php :)


I love Munin ...


Top  Profile  WWW
 PostPost subject:        Posted: Fri Feb 08, 2008 5:21 pm 
Reply with quote
Administrator
User avatar
Offline

Joined
Fri Aug 18, 2006 11:47 am

Posts
12408

Location
Merseyside, United Kingdom

Favourite OS
Microsoft Windows 7 Ultimate x64
Uptime is done primarily through PHP
CPU is a custom made program that is not available for release
Memory is an external program manipulated by PHP.

Only the graphs are done by SNMP, not the data on that bar.

_________________
Image

BetaArchive Discord: https://discord.gg/epK3r6A


Top  Profile  WWW
 PostPost subject:        Posted: Fri Feb 08, 2008 5:36 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Oct 23, 2007 11:21 pm

Posts
594
@thenico: SNMP should be kinda cool, but for some strange reason, by installing it, add/remove programs asks me for a XP CD. I have some XP CDs, but they don't match my language and service pack.

@Andy: I can make CPU monitoring and memory monitoring in AutoIt. I think PHP can read the console stream (not the command prompt stream).

EDIT#1:
Well, here's it: a memory stat program in AutoIt.

Code:
; obtain stats
$MStats = MemGetStats()

; cut the dots (we don't need what's after them) and convert values to MB
; StringSplit is virtually the same as PHP explode()
; yet another bug requires +1 to free memory; eg. if the system have 255 MB RAM and 156 MB are free,
; MemGetStats returns 98 MB in free memory.
$total2 = StringSplit($MStats[1] / 1024,".")
$used2 = StringSplit(($MStats[1] - $MStats[2]) / 1024,".")
$free2 = StringSplit(($MStats[2] / 1024) + 1,".")
$total = $total2[1]
$used = $used2[1]
$free = $free2[1]

; write the stats to console stream (not the stdout!)
ConsoleWrite("<b>Total memory:</b> " & $total & " MB, Used: " & $used & " MB, Free: " & $free & " MB" & @CRLF)



Compiled version is here.

EDIT#2:
THE LINK IS NOW OK.
Good news: PHP can read command output via console stream.
Only tested with passthru().


Top  Profile
 PostPost subject:        Posted: Mon Feb 11, 2008 12:42 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Oct 23, 2007 11:21 pm

Posts
594
New version. See the link. (if you can't find it...)

<blink>For hardware monitoring to work, you must have EVEREST installed and open. Don't forget to go to</blink> File > Preferences > Hardware monitoring > External Applications > tick Enable writing sensor values to Registry > Select All.

WARNING: If PHP don't runs as the same user as EVEREST (eg. when Abyss is installed as service), the program doesn't work. The workaround is: Start > Run > services.msc > Right-click "Abyss Web Server" or "Apache2" > Properties > Logon > This account > your user in the first input box > the other two with your user's password. Restart the web server to make guarantee.

Video tutorial (the configuring EVEREST one):
http://www.mephost.com/~richard/betaarc ... gistry.htm
A small typo leads the File menu to appear too fast.
I clicked the first item, which is "Preferences".


Top  Profile
 PostPost subject:        Posted: Mon Feb 11, 2008 5:57 pm 
Reply with quote
Donator
User avatar
Offline

Joined
Mon Sep 04, 2006 1:06 pm

Posts
1004

Location
USA
A while ago the script you see above was still offered on the AbyssUnderground website: http://web.archive.org/web/200602080942 ... script.php

(Andy: if you want that removed, feel free to get rid of it)

_________________
Old-Computer
BetaArchive VIP | Ex-OSBA Member


Top  Profile
 PostPost subject:        Posted: Mon Feb 11, 2008 10:59 pm 
Reply with quote
Administrator
User avatar
Offline

Joined
Fri Aug 18, 2006 11:47 am

Posts
12408

Location
Merseyside, United Kingdom

Favourite OS
Microsoft Windows 7 Ultimate x64
Its still available on the old site (http://old.abyssunderground.co.uk). This is an unsupported script though because it doesn't work on all systems. The CPU Usage is got from WMI which is slow and buggy.

_________________
Image

BetaArchive Discord: https://discord.gg/epK3r6A


Top  Profile  WWW
 PostPost subject:        Posted: Tue Feb 12, 2008 6:22 pm 
Reply with quote
FTP Access
Offline

Joined
Tue Oct 23, 2007 11:21 pm

Posts
594
I tried phpSysInfo and it's good. (Edited 26/Nov/2009)
It supports several sensors programs, including the popular Motherboard Monitor 5 (Windows) and LM-Sensors (Linux). (Edited 26/Nov/2009)
Also, version 3 has UPS support, but only apcupsd at this time. (Edited 26/Nov/2009)

http://phpsysinfo.sourceforge.net


Top  Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 




Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2018

 

Sitemap | XML | RSS