Solved

AIX Script help

Posted on 2014-03-31
3
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

728 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