CruzIT
Monday January 21, 2019 - 16:19:04 PM

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:
 16:19:04 up 27 days, 18:45,  0 users,  load average: 0.10, 0.09, 0.05

System Information: Linux www01 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Memory Usage (MB): total used free shared buff/cache available Mem: 7442 634 2090 3 4717 6370 Swap: 2047 0 2047
Disk Usage: Filesystem Size Used Avail Use% Mounted on /dev/sda1 38G 9.7G 26G 28% / udev 15G 0 15G 0% /dev tmpfs 12G 0 12G 0% /dev/shm tmpfs 2.8G 740K 2.8G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 12G 0 12G 0% /sys/fs/cgroup blackbird.cruzit.com:/mnt/v002/cruz_big 1.3T 771G 459G 63% /nfs/cruz_big
CPU Information: processor : 0 model name : AMD Opteron 22xx (Gen 2 Class Opteron) processor : 1 model name : AMD Opteron 22xx (Gen 2 Class Opteron) processor : 2 model name : AMD Opteron 22xx (Gen 2 Class Opteron) processor : 3 model name : AMD Opteron 22xx (Gen 2 Class Opteron)
Collecting For A Server Upgrade  

Howto display uptime information like:

Time since last reboot: 27 days, 18 hours, 45 minutes , 7 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  8026  Unique Visitors (IP Addresses) to this site.

Current users online : 13
Maximum users at a time : 50
Last 25 attacks have come from:
188.209.49.164
77.75.79.62
23.228.96.82
108.172.246.109
134.249.54.230
77.75.77.17
46.229.168.149
46.229.168.132
157.55.39.104
40.77.167.6
46.119.115.106
77.75.77.11
157.55.39.52
37.187.95.218
91.210.145.247
77.75.78.162
94.158.245.114
77.75.76.162
34.217.84.79
185.225.17.191
185.220.101.44
103.243.25.104
46.119.121.84
77.75.78.163
46.229.168.138

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