Command or script to inform server owner about process


 
Thread Tools Search this Thread
Operating Systems AIX Command or script to inform server owner about process
# 1  
Old 09-11-2013
Command or script to inform server owner about process

Hi all,

How to inform server owner if the particular process is down.
I need command or script to do the above.

TIA
# 2  
Old 09-11-2013
You can periodically with cron check if process is up via ps command and if not you can send an email to him for example.
Code:
ps auxx | grep sleep | grep -v grep
if [ $? == 1 ]
then
  echo "Sleep is down." | mail -s "Server xyz report" admin@mail.com
else
  echo "Sleep is up." | mail -s "Server xyz report" admin@mail.com
fi

---------- Post updated at 03:09 PM ---------- Previous update was at 03:08 PM ----------

I used an sleep function here which could be easily used for this purpose.
This User Gave Thanks to smoofy For This Post:
# 3  
Old 09-12-2013
Command or script to inform server owner about process

Thanks for the help,

But if i have to check for a particular process like pid=176383 how to check whether trhe process is down or up
# 4  
Old 09-12-2013
You are getting it wrong,
If you are saying a process, then follow steps given by 'Smoofy' (just replace sleep with you desired process, like oracle or any application process or cluster process anything).

But, from above email you are requesting monitoring a process ID, a process can hold many process ID's, so going with Process ID ain't a good thing, it can be gone or changed when the process is complete or crashed or killed.

Ex: you are saying pid 176383, say for now sshd is using that process ID (a user logged'in and a process ID is generated for that ssh connection). If you go with that and monitor that process ID, after the user is logged off, the ID is either gone or after some time taken by another process and your judgement will go wrong.

Hope this helps.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

2. Solaris

Privileges : modify dir/file owner by other that's not owner

i need to do the following operations in solaris 10: 1.change owner and group owner for files which are not owned by the current user and user group 2.to can delete files in the /tmp directory which are not of the current user 3. allow to a standard user the deletion of files in the /tmp... (1 Reply)
Discussion started by: sirmark
1 Replies

3. Shell Programming and Scripting

rm/mv command - not owner

Hi, I have two users, either of them can create a file. Either of them should be able to move/remove the file. When trying to do that I am getting error "Not owner". I have many times seen that we could "rm" or atleast "mv" even if the user is not the owner of the file. Does this have... (2 Replies)
Discussion started by: tostay2003
2 Replies

4. UNIX for Advanced & Expert Users

command to find the owner of a db

Hi, Im working with an Informix db, i would like to know the command to identify the owner of a particular database Thanks (2 Replies)
Discussion started by: dvah
2 Replies

5. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

Hi all, We have some files are under 744 permissions and the the owner is say owner1 and group1. Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that. ... (14 Replies)
Discussion started by: TheGunMan
14 Replies

6. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

7. UNIX for Advanced & Expert Users

Is there a command to get the owner of a file?

At the moment I'm just using `ls -o` (with `cut`), but `ls` is obviously giving me a lot more output than just the file owner. (9 Replies)
Discussion started by: Bilge
9 Replies

8. UNIX for Advanced & Expert Users

how to check if a process is running in a server from shell script.

I want to write a unix shell script that will check if a process (say debu) is running in the server or not. If no , then send a mail to the corresponding person to start the process??? (2 Replies)
Discussion started by: debu
2 Replies

9. UNIX for Dummies Questions & Answers

Process owner

Hi there, How do I get the owner of a process? Regards (4 Replies)
Discussion started by: Parker_
4 Replies

10. UNIX for Advanced & Expert Users

Changing the process owner

How do I change the owner of the process in runtime.I'm working AIX. I would appreciate ,If I get sample scripts. (1 Reply)
Discussion started by: kkb_karthi
1 Replies
Login or Register to Ask a Question