How does VBulletin get the system information without the use of exec
? Is there any other information I can get about the server without exec? I am interested in:
- bandwidth used
- system type
- CPU speed/usage/count
- RAM usage
How does VBulletin get the system information without the use of exec
? Is there any other information I can get about the server without exec? I am interested in:
The psutil library gives you information about CPU, RAM, etc., on a variety of platforms:
psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalities offered by tools like ps, top and Windows task manager.
It currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6 to 3.5 (users of Python 2.4 and 2.5 may use 2.1.3 version).
Some examples:
#!/usr/bin/env python
import psutil
# gives a single float value
psutil.cpu_percent()
# gives an object with many fields
psutil.virtual_memory()
# you can convert that object to a dictionary
dict(psutil.virtual_memory()._asdict())
# you can have the percentage of used RAM
psutil.virtual_memory().percent
79.2
# you can calculate percentage of available memory
psutil.virtual_memory().available * 100 / psutil.virtual_memory().total
20.8
Here's other documentation that provides more concepts and interest concepts:
There is an open source library that gives these (and more system info stuff) across many platforms: SIGAR API
I've used it in fairly large projects and it works fine (except for certain corner cases on OS X etc.)
Got it working. Used pretty much the same code as found here: http://www.csharphelp.com/archives2/archive334.html Turns out I had a bad path, which i finally got sorted out: new ManagementPath(string.Format("\{0}rootcimv2",machineName));
This is a known issue. To use a hdd in the DVD slot, you used a HDD caddy. In some cases you get a high CPU usage caused by the ACPI.sys driver.
You have to look if your caddy has a jumper and if yes, change the position of the jumper.
This fixes the CPU usage. If you don't have a jumper, buy a caddy which has such a jumper.
Use PHPSysInfo library
phpSysInfo is a open source PHP script that displays information about the host being accessed. It will displays things like:
It directly parsed parses
/proc
and does not useexec
.Another way is to use Linfo. It is a very fast cross-platform php script that describes the host server in extreme detail, giving information such as ram usage, disk space, raid arrays, hardware, network cards, kernel, os, samba/cups/truecrypt status, temps, disks, and much more.