Solved

AIX Script help

Posted on 2014-03-31
3
296 Views
Last Modified: 2014-04-01
Can someone provide me like a script which checks  whether any aixterm has “too many” children processes. If there are too many like more than 100, Alert via email...
0
Comment
Question by:aanya247
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 39968356
Please you need to modify below script to fit your need:

mytty=`tty`
nop=`ps -t $mytty | wc -l`
if $nop -gt 100
then
      mail -s "too many processes running on $mytty" username@domain
fi
0
 

Author Comment

by:aanya247
ID: 39968422
Does ps -t mean child processes
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 39968447
The command

ps -t ttyname

will show all processes attached to that tty. Processes that are detached from tty will not be reported.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question