Need to Help on the script
Code:
Hi All, |
would be nice to insert your code between [code]here comes your script[/code] tags.
which part is unclear? |
It processes the output of the "vmstat" command.
It splits the output into lines and stores them in sa[] array. Then it splits a line into words and stores them in line[] array. Then it loops through the words until it finds "wa". When found, it splits the following line into words and catches the one from the same column. In effect it catches the word under the "wa". There are some shortcomings though, the biggest might be the assumption that a plain "vmstat" gives values that are current. In fact they are the average since the system was booted |
if you really want to understand it I suggest you to execute vmstat (just to see what will it print) and run this code inside the perl debugger, step by step and you can inspect these variables easily (according to the explanation of MadeInGermany).
But again, what is unclear? |
My version (MacOS X vm_stat) prints out this:
Code:
Mach Virtual Memory Statistics: (page size of 4096 bytes) |
yes, you are right, this perl script and this vmstat are not really compatible (with each other)
|
All times are GMT -5. The time now is 03:48 PM. |