×
Back to Geneos FAQ
How to monitor the ulimit command for resources on Linux shell?
The Toolkit plugin can be used to monitor output from commands. This article provides a sample which reformats the data with comma delimiters such that the Toolkit plugin can parse the output.
The ulimit -a command displays some comma characters by itself, which may cause confusion with the delimiter in Toolkit plugin.
Here we have picked the sed command to first strip out the commas and extra space characters, and then insert commas in place of the parentheses.
ulimit -a | /bin/sed -e 's/,//' -e 's/\s\{1,\}/ /g' -e 's/ (/,/' -e 's/) /,/'
Below is the Active Console output when this is configured in the Toolkit plugin.
Below is the sampler configuration in XML file:
<sampler name="Toolkit_ulimit">
<sampleInterval>
<data>300</data>
</sampleInterval>
<plugin>
<toolkit>
<samplerScript>
<data>/bin/echo "Resource,Unit,Limit";ulimit -a | /bin/sed -e 's/,//' -e 's/\s\{1,\}/ /g' -e 's/ (/,/' -e 's/) /,/'</data>
</samplerScript>
</toolkit>
</plugin>
</sampler>
["Geneos"]
["Geneos > Netprobe"]
["FAQ"]