05-23-2009
I think you could give a try to sysinfo().
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, I am new to Unix and I need to know how to find out how much Ram I have on my server.
I have Sun Solaris operating system with Sun Ulta 10 cpu. Could you please let me know the command to find the current Ram I have?
Thank you. (1 Reply)
Discussion started by: hollowayt
1 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I work in a production support environment. All our PROD machines SPARC machines and Solaris O/S. I want to know how to find out what the hard disk size, RAM size etc. of our PROD machines. Please let me know if there is any way to find out this (other than from system administrator).
... (2 Replies)
Discussion started by: ramaraju
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am using SCO Unix 3.12 and Informix database. When we tried to use "du -a" command to check disk space, it showed:
342122 ./usr
30092 ./etc
6244 ./dev
4778 ./bin
2674 ./tcb
1234 ./lost+found
698 ./lib
532 ./shlib
46 ./tmp
6 ./messages
4 ./opt
4 ./var
2 ./mnt
2 ./install... (1 Reply)
Discussion started by: trinhnguyen
1 Replies
4. Shell Programming and Scripting
Hi Friends,
I am using sun Solaris .
I want to find the disk space (df -k) for the Unix box and the data has to be sent to an email id.
Can u please find me a code that checks the disk space 6 times a day, loads the data into an excel sheet and sends to an email id.
Can u also tell me how to... (2 Replies)
Discussion started by: sridharnr
2 Replies
5. Solaris
How swap is getting 12GB as its size as per the below output:
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 7.9G 2.1G 5.7G 27% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 12G 1.2M 12G 1%... (3 Replies)
Discussion started by: ramnagaraj
3 Replies
6. Programming
Suppose I have 3 gb of ram and 250 gb hard disk in my pc.
Now I wrote a simple C program having only one statement malloc() to allocate 4 gb of memory as 32 bit os can address 4gb address space then will the malloc succeed?
If yes then how it will get extra 1 gb of memory?
Does the process gets... (3 Replies)
Discussion started by: rupeshkp728
3 Replies
7. Shell Programming and Scripting
Hi,
I have to regularly monitor manually if my diskspace is close to 90% or not. I use to see this by firing df -k. I want to write a script which can run 24*7 hours and would me mail me whenever the disk space is 90% or more..It would be really great if someone can helo me on this. (1 Reply)
Discussion started by: sachin4shell
1 Replies
8. AIX
Hi All,
I was trying to know more about RAM disk concept in AIX. I found something on IBM site.
I was able to create and use/delete RAM disk as per IBM instructions.
But as you guys know, this RAM disk is a temporary storage. (*when ever we reboot the AIX LPAR, content/RAM disk will be... (4 Replies)
Discussion started by: System Admin 77
4 Replies
9. Shell Programming and Scripting
Hi Guys,
Is there any way I can write a script that sends DISK SPACE USAGE STATUS via email once a week?
Thanks, (5 Replies)
Discussion started by: g4v1n
5 Replies
LEARN ABOUT PLAN9
sysinfo
SYSINFO(2) Linux Programmer's Manual SYSINFO(2)
NAME
sysinfo - return system information
SYNOPSIS
#include <sys/sysinfo.h>
int sysinfo(struct sysinfo *info);
DESCRIPTION
sysinfo() returns certain statistics on memory and swap usage, as well as the load average.
Until Linux 2.3.16, sysinfo() returned information in the following structure:
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* Swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
In the above structure, the sizes of the memory and swap fields are given in bytes.
Since Linux 2.3.23 (i386) and Linux 2.3.48 (all architectures) the structure is:
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* Swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20-2*sizeof(long)-sizeof(int)];
/* Padding to 64 bytes */
};
In the above structure, sizes of the memory and swap fields are given as multiples of mem_unit bytes.
RETURN VALUE
On success, sysinfo() returns zero. On error, -1 is returned, and errno is set to indicate the cause of the error.
ERRORS
EFAULT info is not a valid address.
VERSIONS
sysinfo() first appeared in Linux 0.98.pl6.
CONFORMING TO
This function is Linux-specific, and should not be used in programs intended to be portable.
NOTES
All of the information provided by this system call is also available via /proc/meminfo and /proc/loadavg.
SEE ALSO
proc(5)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-09-15 SYSINFO(2)