05. 08. 2010 Patrick Zambelli Unified Monitoring

Linux / Unix Memory and CPU monitoring

MEMORY: Free system memory

The check of free system memory of linux systems may not be pointed directly to the information of the really ‘free’ memory, since Linux is making use of the best reasonable amount of pysical memory. Indeed, we can find the information of the memory occupied by the system but not used for current calculations as ‘buffers’ or system cache.

Therefore when checking actively for free memory resources it is useful to consider the buffers as memory available for eventual arithemtics. The check_mem makes use of the system command free and returns as result the sum of Free memory + buffers.

[root@neteye plugins]# ./check_mem.sh -w 500 -c 200 -p
OK – free system memory: 1329 MB | free memory=1329MB;500;200;0

[root@neteye plugins]# free -m
total       used       free     shared    buffers     cached
Mem:          2026       1584        442          0        159        696
-/+ buffers/cache:        728       1298
Swap:         2047          0       2047

PS: make use of the ‘-p’ argument to extract also the component of the perfdata for the performance data view.
Download: Download section of this blog or Nagios Exchange ( http://exchange.nagios.org )

CPU

The performance of a Linux/Unix system can be measured by reading the load of the system.
CPU usage is distributed on today’s system mainly on multiple-core CPU’s and therefore a OS is providing multiple values to take in consideration for monitoring.

The check_cpu.py interprets the values provided by the vmstat command on the following platforms: Linux, OpenBSD, FreeBSD, NetBSD and SunOS.

[root@neteye plugins]# ./check_cpu.py -w 20 -c 5
WARNING: CPU is only 18% idle

[root@neteye plugins]# vmstat 5 2
procs ———–memory———- —swap– —–io—- –system– —–cpu——
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
3  0    116 267424 161072 635604    0    0    60   115    0    1 34  3 61  1  0
10  0    116 162916 161088 635560    0    0     0   202 1505 3458 80  6 14  0  0

Download: Download section of this blog or Nagios Exchange ( http://exchange.nagios.org )

Patrick Zambelli

Patrick Zambelli

Project Manager at Würth Phoenix
After my graduation in Applied Computer Science at the Free University of Bolzano I decided to start my professional career outside the province. With a bit of good timing and good luck I went into the booming IT-Dept. of Geox in the shoe district of Montebelluna, where I realized how a big IT infrastructure has to grow and adapt to quickly changing requirements. During this experience I had also the nice possibility to travel the world, while setting up the various production and retail areas of this company. Arrived at Würth Phoenix I started developing on our monitoring solution NetEye. Today, in my position as Consulting an Project Manager I am continuously heading to implement our solutions to meet the expectation of your enterprise customers.

Author

Patrick Zambelli

After my graduation in Applied Computer Science at the Free University of Bolzano I decided to start my professional career outside the province. With a bit of good timing and good luck I went into the booming IT-Dept. of Geox in the shoe district of Montebelluna, where I realized how a big IT infrastructure has to grow and adapt to quickly changing requirements. During this experience I had also the nice possibility to travel the world, while setting up the various production and retail areas of this company. Arrived at Würth Phoenix I started developing on our monitoring solution NetEye. Today, in my position as Consulting an Project Manager I am continuously heading to implement our solutions to meet the expectation of your enterprise customers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive