Help with implementing available memory status script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with implementing available memory status script
# 1  
Old 05-17-2013
Lightbulb Help with implementing available memory status script

hi ,
i want write the script which automatically send an alert mail to my mail id when there is low memory available.

things which i am able to implement -:
i got the output of current memory status into one file . Than i break down the required coloumn and again send it in another file.

My question and query-:

instead of sending the required coloumn can we assign the value to one variable
below is the code i am trying to use but not running successfully

-->#this is a dummy to your alert script
-->df -h | head -2 > dummy_file1
-->tail -1 < dummy_file1 > dummy_file2
-->a=`awk'{print $1}' dummy_file2`
now what i what is that -:
1. I want to use the value of this variable in my if condition .
2. when the if condition i write get satisfied then i want my script to send alert with the available memory.

if possible please send me your suggestion to my account .

Thanks
# 2  
Old 05-17-2013
This is a recurring stress dream from the pre-UNIX, pre-MULTIX O/S including many IBM O/S. UNIX dies of low swap space, but low RAM is quite desirable (you paid for it, so sw that uses it all, all the time is great), since it is a cache for things on disk. When a process exits, it creates some free pages from freed swap or could-swap-but-swap-never-allocated pages, but mmap() pages like linked dynamic libraries remain in RAM awaiting other mmap() of the same file, like libc.so. If lots of stuff ends and nothing new runs, the free RAM may be substantial and persistent, but it just says you are not using the RAM and the whole machine fully, in ways that exploit the RAM you bought. Just booted systems can be a bit slugish as RAM pages get written from disk, then perk up as more of the pages needed for each new process are already in RAM. A process that mmap()'s files and reads them in excess can roll every other app's pages from RAM, a vulnerability; when it stops, they all gradually return to full responsiveness as they roll in their pages.

Some O/S map swap and /tmp together, so either files in /tmp or many programs malloc()ing lots of space (new'ing objects) can draw down the swap space to dangerous levels. You can make more swap using any local files space using mkswap or the like, in an emergency, but usually the trick is to kill the hog. Sometimes a programmer needs to do things in file space or with mmap() not malloc(), or needs to not run 983 parallel processes, but 32 at a time until all are run (I like 2x the CPU Core count, assuming 50% i/o bound processing). Disk is so cheap, so not being stingy on swap is a great direction, too. Fussing over lack of VM is not worth your time.

Last edited by DGPickett; 05-17-2013 at 05:07 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with delaying script and implementing checks before completion

Hello everyone, I was wondering if any of you could help me with this. I am an absolute beginner and don't know how to program, but I can follow a tutorial and tweak code sometimes. My understanding of programing is limitted to what for and while loops do, and how if then else logic works. That... (2 Replies)
Discussion started by: tomeurp
2 Replies

2. Shell Programming and Scripting

Need help implementing a timout in my Shell Script for RHEL6

Hey Guys, My problem: I have a script that will be querying the database every minute to see if it gets a response, the response its querying for is "UP" in a table i made called dbup in the database. Now, I am trying to add the component to implement a timeout if the script does not get a... (2 Replies)
Discussion started by: mo_VERTICASQL
2 Replies

3. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

4. Shell Programming and Scripting

Shell script to find Memory status in AIX

Hi All, There is a shell script that captures Memory status in AIX 6.1 64 bits! I need it to be validated by shell script experts for the following: Shell Script: cat memusageAIX.sh #!/usr/bin/ksh # # Memory usage under AIX # USED=`svmon -G | head -2 | tail -1 | awk '{ print $3... (1 Reply)
Discussion started by: a1_win
1 Replies

5. UNIX for Advanced & Expert Users

prtdiag -v problem :Memory Module Groups status not Showing

Hi Friends, I need a help from you all. In my machine which is on Solaris 9. the command prtdiag -v shows the complete output but it doesn't show "Memory Module Groups status" status. I have tried restarting the picl daemon, but still it doesn't work. Memory Module Groups:... (2 Replies)
Discussion started by: vivek.goel.piet
2 Replies

6. AIX

Memory status

hi, how to checck memory and paging utilization in mb in aix 6.1 vmstat output is not clear thanks to all (3 Replies)
Discussion started by: sunnybee
3 Replies

7. Shell Programming and Scripting

Implementing Ctrl +C in a script as a part of automation

Hi, I am working on Solaris SPARC where we used start the BEA WebLogic Server for some project module. The server is started very simply by changing to its home directory and starting the script called ./startWebLogic.sh. Upto this no big deal. Once the server get started and comes to... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

8. Programming

Solaris CPU/memory status monitoring (Shell script or c++)

i'm trying to find a way to monitor the CPU/Memory status of a solaris station using vmstat. I like to write a small script to periodically run vmstat and store the output. Can anyone show me how (preferrably in C++ if possible)? Thanks in advance. (6 Replies)
Discussion started by: shingpui
6 Replies

9. HP-UX

Memory dimm status

Hi, How to check the memory dimm status from OS leavel!! My system model HP N4000. Thanks, ARumugam. (2 Replies)
Discussion started by: arumsun
2 Replies

10. Solaris

Process Status Without Shared Memory

Hello Folks, On a Solaris 8 system I am trying to diagnosis memory usage of the running processes. I've been using prstat, and top , but the outputs of those include the shared memory used by the process. Hence, more a dozen of running processes are using the shared memory, and the total memory... (1 Reply)
Discussion started by: altinkaya
1 Replies
Login or Register to Ask a Question