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
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.
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}
#!/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"
exit 0
fi
echo "Message: ERROR: Can't find swap field (Swap) in (free -k) command. \n"
echo "Statistic:1000"
exit 1;
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.