<< Click to Display Table of Contents >> Navigation: Example > Scripts > Unix Process Example |
Using the Script 'UnixProcessExample.sh' it is possible to obtain information about a process on a Unix based system.
An example on how to configure the Sensor can be found in the topic Scripts.
Executing the Script using the SSH Sensor will result in an output like this:
Id: 1
Nice Value: 0
Memory (Virtual): 57184
Memory (Resident): 6928
Memory (Shared): 5288
Cpu Usage: 0.0
Handles: 48
Threads: 1
Parent Id: 0
Command: /sbin/init
To obtain a specific value, regular expressions can be used.
For example, the handle count can be obtained using the regular expression with an anonymous group:
Handles: (.*)