how to wrte a shell script for nmon command
in the aix os, I would like to write a script for memory usage.
are the commands that i use to view the memory statistics.
But im not sure how to proceed ahead for usage reaching 90% or free memory reaching to 100MB.
kindly help. thi si something like monitoring script for performance.
You are going to have to explain what you want in more detail. Since most of us here don't have access to AIX, you should provide an example or two of the output of those tools, what you need to get from them, and how the output needs to be formatted.
Most likely what you want can be done with a simple awk script, but it all depends on the details.
I would also start by checking the documentation on those programs and seeing if they can be configured to output only the data you want from them, or at least give it easily parseable formatting.
Your question is a little unclear. Are you trying to monitor when memory usage reaches those levels, and then perform some action (an alert email or something)?
Firstly you need to keep in mind that AIX automatically uses memory which is not used for computational work, as filesystem cache. It is therefor very common to see high overall memory usage at close to 100%, without any issues as a result of this. To monitor for problems you will therefore have to look at more than just total memory used. You need to look at the computational vs file/client memory separately, and also need to look at paging activity (both paging space usage and number of paging space IOs).
For scripting purposes a good starting point might be too look at the "svmon" command rather than nmon (assuming you are running nmon interactively).
If you want to just track memory usage over time, and report on it, your best bet is probably to run "nmon -x" to collect the data, and then graph it with one of the following tools:
* nmon analyzer - http://www.ibm.com/developerworks/wi...e/nmonanalyser
* pGraph - https://www.ibm.com/developerworks/w...kiPtype/pGraph
* nmon2rrd - http://www.ibm.com/developerworks/wi...WikiPtype/nmon
* nmon2web - http://users.ca.astound.net/~baspenc...nmon2rrdv3.htm
Not sure what you want to do with memory monitoring. I assume since you call out 90% used or 100MB free, you want something that sends an alert when the thresholds are met. In that case, I'd suggest noodling around with AIX's mkcondition and mkcondresp commands. You can basically create a mechanism that will, for example, use sendmail to alert you when an OS related condition is met such as the amount of memory usage, CPU utilization, paging space filling up, etc...
Here's some light reading for AIX 6.1...
(You can substitute v5r3 or v7r1 in the URLs above for other OS level versions of the commands)
|All times are GMT -5. The time now is 05:29 PM.|