The memstat module collects information on current memory usage. This information is presented as a percentage of use at the moment the information is gathered. All operating systems provide at least percentage of meory used and free, while Linux provides additional statistics.
On Linux, CPU information is gathered through the "/proc/meminfo" file. This file is required in order for memstat to work properly.
On the Solaris OS, CPU statistics are gathered using the "kstat" programming interface.
Windows 2000/XP/2003 uses the Performance Data Helper to gather CPU statistics. Windows 9x/NT uses the Win32 API.
Thresholds can be defined on memstat based on the information gathered. Each of the following can be used:
Used (all operating systems)
Free (all operating systems)
Buffers (Linux only)
Cached (Linux only)
Provided the statistic is allowed on the given OS, thresholds can be formed by checking against a percent. Any of the basic logical operators are allowed (==, !=, <, >, <=, >=). Here are some examples:
# Example thresholds for memstat thresh1.threshold = MemStat.used > 90% thresh2.threshold = MemStat.free <= 5% # Linux only thresh3.threshold = MemStat.cached != 0% thresh4.threshold = MemStat.buffers >= 10% AND MemStat.cached <= 5% |