Hi,
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?
regards,Alex
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?
Thanks
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.
You could make an application template and add a component monitor that runs a script through SSH to grab your swap usage.
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}
#!/bin/sh
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
fi
stat="$(free -k | grep 'Swap' | awk '{print $3/$2 * 100.0}' | awk '{print int($1+0.5)}')"
exit=`echo $?`
if [ $exit -eq 0 ]
then
echo "Message: Used amount of swap space in %: $stat"
echo "Statistic: $stat"
echo "Message: ERROR: Can't find swap field (Swap) in (free -k) command. \n"
echo "Statistic:1000"
exit 1;