Solved

AIX Script help

Posted on 2014-03-31
3
294 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
Comment Utility
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
Comment Utility
Does ps -t mean child processes
0
 
LVL 40

Expert Comment

by:omarfarid
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now