Unix Memory Monitoring Perl
This SAM application monitor template uses Perl scripts to assess the memory performance of computers running AIX 5.3 or 6.1; Solaris 8, 9, or 10; or HP-UX 11.0.
SSH and Perl are installed on the target server.
If Perl is installed in a location different from
/usr/bin/perl, edit paths in the first line of the field ”script body” (
#!/usr/bin/perl) for component monitors, or create a symbolic link to Perl with
To determine where Perl is installed, use the following command:
Root credentials on the target server.
Some Unix implementations such as Solaris have a character limit in the input buffers of SSH sessions that prevents SolarWinds SAM from copying over scripts. If a monitored component fails to return a result or returns error code 255, manually copy the script to the target machine and then make the appropriate path and file name change in the Command Line field. For example, if you manually copied the script over as
/usr/script.pl, you should change the Command Line to:
This component has Count statistic as difference enabled. It will return the difference between two polling intervals.
Components without predetermined threshold values have guidance such as "Use the lowest threshold possible" or "use the highest threshold possible" to help you find a threshold appropriate for your application. To learn more, see Manage thresholds in SAM.
Total memory (MB)
The amount of total usable RAM in MB.
Used memory (MB)
The amount of used memory in MB. Set this value as low as possible.
Free memory (MB)
The amount of available memory in MB.
This should be more than 100 MB at all times or paging will occur.
Total swap (MB)
The amount of total swap space in MB.
Used swap (MB)
The amount of used swap space in MB. Paging is one of the memory-management schemes by which a computer can store and retrieve data from secondary storage for use in main memory. Paging is an important part of virtual memory implementation in most contemporary general-purpose operating systems, allowing them to use disk storage for data that does not fit into physical random-access memory (RAM).
This should be as low as possible. Ideally it should be near zero. If the value is large, it may indicate that there is no free memory left.
Free swap (MB)
The amount of available swap space in MB.
It should be near the “total swap” value. If paging occurs in the system, the value should be as high as possible.
AIX and Solaris: Shows the number of page faults per second. This is not a count of page faults that generate I/O, because some page faults can be resolved without I/O.
HP-UX: Rename this counter to “Page address translation faults/sec” – shows the number of page address translation faults per second.
Should be as low as possible.
The number of “zombie” processes. A “zombie” or defunct process is a process that has completed execution, but still has an entry in the process table. This entry is still needed to allow the process that started the (now zombie) process to read its exit status. When a process finishes execution, it will have an exit status to report to its parent process. Because of this last little bit of information, the process will remain in the operating system’s process table as a zombie process, indicating that it is not to be scheduled for further execution, but that it cannot be completely removed (and its process ID cannot be reused) until it has been determined that the exit status is no longer needed.
This should always be zero (0). If it is not zero, you should manually kill zombie processes. Use the following commands to show these zombie processes:
- For AIX:
ps –ef | grep defunct
- For Solaris:
ps –ecl | grep “Z”
- For HP-UX:
ps –ef | grep defunct
To kill zombie processes:
- The first option is to wait. It is possible that the parent process is intentionally leaving the process in a zombie state to ensure that future children it may create will not receive the same pid. Or perhaps the parent is occupied, and will reap the child process momentarily.
- The second option is to send a SIGCHLD signal to the parent (
kill -s SIGCHLD <ppid>). This will cause well-behaving parents to reap their zombie children.
- The third option is to kill the parent process of the zombie. At that point, all of the parent’s children will be adopted by the init process (pid 1), which periodically runs
wait()to reap any zombie children.
Page cache: page ins
Amount of pages paged in from paging space, which should be as low as possible.
The operation of reading one inactive page or a cluster of inactive memory pages to disk is called a page out.
Page cache: page outs
Amount of pages paged in from paging space.
The operation of writing one inactive page or a cluster of inactive memory pages to disk is called a page out.
Value numbers above 20 pages or so indicate a significant performance problem. In this situation more memory should be installed.