CruzIT
Saturday March 23, 2019 - 11:43:49 AM

Registered Linux User #440901    


 
Login    Register
Login Required

HowTo Get System Information

Linux/BSD based systems only

Note: Command execution in php will need to be enabled in order for most of these to work.
You may want to create directories with special permissions in them - like chrooted or jailed users allowed to run them.
Please keep in mind, there are security issues that need to be addressed if your webserver is allowed to run system type commands.
Try this on a web page to see if you can run commands:
<?php passthru("ping www.somehost.com -c 4"); ?>
You should get something like:
64 bytes from linhost300.prod.mesa1.secureserver.net (208.109.138.107): icmp_seq=1 ttl=49 time=97.0 ms
64 bytes from linhost300.prod.mesa1.secureserver.net (208.109.138.107): icmp_seq=2 ttl=49 time=35.5 ms
64 bytes from linhost300.prod.mesa1.secureserver.net (208.109.138.107): icmp_seq=3 ttl=49 time=36.1 ms
64 bytes from linhost300.prod.mesa1.secureserver.net (208.109.138.107): icmp_seq=4 ttl=49 time=36.6 ms


If you're not seeing something similar, you will need to enable or have your sys admin enable command execution for you.



Copy and paste this code into the page you want to show system information for your web server:

<pre>
<strong>Uptime:</strong>
<?php system("uptime"); ?>
<br />
<strong>System Information:</strong>
<?php system("uname -a"); ?>
<br />
<strong>Memory Usage (MB):</strong>
<?php system("free -m"); ?>
<br />
<strong>Disk Usage:</strong>
<?php system("df -h"); ?>
<br />
<strong>CPU Information:</strong>
<?php system("cat /proc/cpuinfo | grep \"model name\\|processor\""); ?>
</pre>

That should produce something like this:

Uptime:
 11:43:49 up 4 days,  5:03,  1 user,  load average: 0.11, 0.05, 0.01

System Information: Linux www01 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Memory Usage (MB): total used free shared buff/cache available Mem: 9724 1278 6372 3 2073 8128 Swap: 2047 0 2047
Disk Usage: Filesystem Size Used Avail Use% Mounted on /dev/sda1 38G 9.9G 26G 28% / udev 5.7G 0 5.7G 0% /dev tmpfs 4.8G 0 4.8G 0% /dev/shm tmpfs 1.1G 780K 1.1G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 4.8G 0 4.8G 0% /sys/fs/cgroup blackbird.cruzit.com:/mnt/v002/cruz_big 1.3T 828G 402G 68% /nfs/cruz_big tmpfs 973M 0 973M 0% /run/user/1000
CPU Information: processor : 0 model name : QEMU Virtual CPU version 2.0.0 processor : 1 model name : QEMU Virtual CPU version 2.0.0 processor : 2 model name : QEMU Virtual CPU version 2.0.0 processor : 3 model name : QEMU Virtual CPU version 2.0.0
Collecting For A Server Upgrade  

Howto display uptime information like:

Time since last reboot: 4 days, 5 hours, 3 minutes , 34 seconds

 

“Windows - Just Say No”

@ Active Member Project Honeypot  email addresses

This page was last modified on 09/1/18 @ 10:33:50:pm
This file name: howto_sysinfo.php

Questions, Comments, Suggestions or Requests should be sent to:  ronnie@cruzit.com 

There have been  84460  Unique Visitors (IP Addresses) to this site.

Current users online : 14
Maximum users at a time : 50
Last 25 attacks have come from:
14.248.137.211
157.55.39.224
209.97.138.189
185.227.111.133
40.77.167.119
195.201.141.210
45.77.106.13
146.71.77.244
45.119.212.150
104.198.63.244
52.87.182.94
23.228.81.10
188.166.80.133
91.134.248.235
52.78.241.165
175.126.62.28
192.42.116.16
46.229.168.142
188.126.73.10
103.59.38.130
192.200.215.90
176.31.124.223
183.90.250.38
159.65.146.132
138.197.46.78

There are currently 25 unique IP addresses blacklisted.

Public cruzit.com Server Status
server offline limelight  web service
 Aw Crap!, It's Off-Line
server offline limelight  mail service
 Aw Crap!, It's Off-Line
server online www  web service
 Is On-Line
server online mx 08  mail service
 Is On-Line
server online www01  F/O web service
 Is On-Line
server online mx 09  mail service
 Is On-Line
server online tertiary  DNS service
 Is On-Line
server online mx 10  mail service
 Is On-Line

©Copyright 2004-2019 - cruzit.com - Redd Enterprises™, Inc.,  All Rights Reserved.
Ubuntu® is a registered trademark of Canonical Ltd.
Linux® is a registered trademark of Linus Torvalds.
Apache® is a registered trademark of The Apache Software Foundation.
PHP® is a registered trademark of The PHP Group.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
All other product and service names mentioned are the trademarks of their respective companies.

 

pretrial
pretrial
pretrial
pretrial
Let us know what you think! finance@homelandcomputersecurity.com