
A generic script (monitoring.sh) has been developed to monitor UNIX process running longer than a given number of days.
Figure 1 monitoring.sh Usage
monitor
Input Arguments
|
Name |
Position |
Notes |
|
processName |
1 |
The process name that the script will monitor. The scripts uses the grep command based on the output of the UNIX command `ps –ef` to determine process to monitor. |
|
maxDays |
2 |
The maximum number of days the process is allowed to run before an alert is generated. Note maxDays is compared with the process start execution time using an AWK script named "monitoring.awk". |
|
emails |
3 |
Comma separated list of emails addresses were alerts will be sent. The emails are sent using the sendmail UNIX command. |
Below is the sample output of the following command;
The following is the report of the long running UNIX processes.
|
UID |
PID |
Start Time |
Max Duration (Days) |
Command |
|
|
|
|
|
|
|
testuser |
928 |
Jul 12 |
2 |
oracleTP (LOCAL=NO) |
|
testuser |
934 |
Jul 12 |
2 |
oracleTP (LOCAL=NO) |
|
testuser |
907 |
Jul 12 |
2 |
oracleTP (LOCAL=NO) |
|
testuser |
924 |
Jul 12 |
2 |
oracleTP (LOCAL=NO) |
crontab -l
0 9 * * * ~/monitoring/monitoring.sh oracleTP 2 "emails"