Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

monitor linux swap space


Has anyone successfully managed to monitor linux swap space using agent?

When I tried to list the resources, I can't seem to find the swap space.

Can someone please assist?


0 Kudos
8 Replies
Level 8

Hi Alex,

I have not been able to fint a build-in method to monitor SWAP space, so what we did was utilizing a Linux/Unix script monitor through APM to do the job for us, and from my experience it works just fine!

In our environment we have set the thresholds to Warning 80% and Critical 90%, but that is something you can adjust to whatever you require.

Under this line is the full script, the Command Line field should contain only: ${SCRIPT}


if [ $(free -k | grep 'Swap' | awk '{print $2}') -eq "0" ]; then

    echo "Message: Server has not configured any swap space"

    echo "Statistic: 0"

    exit 0


stat="$(free -k | grep 'Swap' | awk '{print $3/$2 * 100.0}' | awk '{print int($1+0.5)}')"

exit=`echo $?`

if [ $exit -eq 0 ]


        echo "Message: Used amount of swap space in %: $stat"

        echo "Statistic: $stat"

        exit 0


echo "Message: ERROR: Can't find swap field (Swap) in (free -k) command. \n"

echo "Statistic:1000"

exit 1;

Level 11

You could make an application template and add a component monitor that runs a script through SSH to grab your swap usage. 

0 Kudos
Level 16

Hi Alex,

When u monitor using agent, swap and other space is consolidated into 1 component so u dont find it under List Resources...

Hi Pratikmehta0003,

I assume that there is no way for me to view the swap space nor a email alert?



0 Kudos

in agent based, i dont think u can view it..

if u want to specifically alert on swap space, you may have to do a custom poller or make use of the component in SAM which can hep in identifying the swap space...

pratikmehta003​ , that is one of the requirements.

How can I go about creating a custom poller to monitor swap space?

Appreciate your assistance on this.

0 Kudos

Sorry i couldnt respond back.. Are u still at same issue or already resvoled?

0 Kudos

Hi Alex,

I will check if i can get something on that... else u need to know the OIDs for the swap space and then follow the doc available for customer poller creation

0 Kudos