Im in the process of writing a unix mointoring program that will monitor differenet servers all runnning solaris . I am creating a main screen with summary warnings for high cpu usage, low disk space, meta device faults, high network collisions etc. All has gone well but now im coming to do the memory summary field.
Bacially I want to display a warning if memory usage exceeds 80%. Now i know sar -r shows free memory and prtdiag -v | grep Mem will show total memory of the system. But these figures dont seem to relate to eachother. For example a system has 8192mb of memory installed and the sar -r output shows 439484 being free. But how do these figures relate to each other as a percentage so is that 50% of memory being used.
It would be really helpful if someone could write me a little script to collect memory statistics for 30 seconds and display it as a percentage when related to total memory.
Can anyone help!!!