Results 1 to 7 of 7
Threaded View
-
1st Dec 2010, 05:40 PM #1OPMember
Linux system info ( C)
Compiled Binary ( compiled using gcc )
http://dl.dropbox.com/u/8626323/c/sysinfo
usage instructions :
Code:wget http://dl.dropbox.com/u/8626323/c/sysinfo ./sysinfo
to compile
save the code to a file and call it sysinfo.c, then use gcc to compile it
gcc sysinfo.c
PHP Code:#include <stdio.h>
#include <sys/sysinfo.h>
int main(){
int days, hours, mins;struct sysinfo KWWH_sysinfo;
if(sysinfo(&KWWH_sysinfo) != 0)perror("sysinfo");
days = KWWH_sysinfo.uptime / 86400;hours = (KWWH_sysinfo.uptime / 3600) - (days * 24);mins = (KWWH_sysinfo.uptime / 60) - (days * 1440) - (hours * 60);
printf("KWWHunction linux Info\n");printf("Uptime: %ddays, %dhours, %dminutes, %ldseconds\n",days, hours, mins, KWWH_sysinfo.uptime % 60);
printf("Load Avgs: 1min(%ld) 5min(%ld) 15min(%ld)\n",KWWH_sysinfo.loads[0], KWWH_sysinfo.loads[1], KWWH_sysinfo.loads[2]);printf("Total Ram: %ldk\tFree: %ldk\n", KWWH_sysinfo.totalram / 1024,KWWH_sysinfo.freeram / 1024);
printf("Number of processes: %d\n", KWWH_sysinfo.procs);return 0;
}
desiboy Reviewed by desiboy on . Linux system info ( C) http://cdnpic.com/upload/5bab0549.png Compiled Binary ( compiled using gcc ) http://dl.dropbox.com/u/8626323/c/sysinfo usage instructions : wget http://dl.dropbox.com/u/8626323/c/sysinfo Rating: 5Coding Horror Fan
I don't read PM's frequently .
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[VPS] 9xhost.info - Linux VPS Starting at $7.75 [NL/US]
By pubic_html in forum ArchiveReplies: 55Last Post: 6th Jan 2012, 12:26 AM -
[Shared] [NL] www.WTFHost.info - Shared Linux Hosting - Offshore
By Derka in forum ArchiveReplies: 3Last Post: 2nd Jan 2011, 03:10 AM -
Get FULL System Info using Batch + Explained ;)
By l0calh0st in forum Web Development AreaReplies: 1Last Post: 2nd Oct 2010, 01:14 PM -
[AMS] xSysInfo - Get all info about your System
By l0calh0st in forum Web Development AreaReplies: 4Last Post: 1st Aug 2010, 01:28 PM -
Linux File System Explained For Beginners
By Plutost in forum Tutorials and GuidesReplies: 4Last Post: 7th Sep 2009, 04:07 PM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...