How to monitor kill commands in UNIX.?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to monitor kill commands in UNIX.?
# 1  
Old 09-29-2016
How to monitor kill commands in UNIX.?

Hi All,

I want to know how can we monitor the kill commands that we execute in Unix.

Much appreciate your help.

Thanks.
# 2  
Old 09-29-2016
Monitor in what way? Do you mean log every time someone uses kill?

I suppose you could write a script to replace the expected kill command that collects some information about the process being killed, the person/terminal killing it etc. and then finally calling the (sneakily moved away) kill command.

Is this the sort of thing you are after?



Robin
# 3  
Old 09-29-2016
Yes Robin.

This is what I am looking for. Also I thought of reading the .sh_history file to read the history file and see the kill command report it.

But if you have any specific piece of code that can simulate kill,can you provide me the same.

Also I am looking for a way to add date and time in the .sh_history file. I was able to figure out only for .bash_history and not for.sh_history. Can you please provide me how can I add Date for .sh_history file.

Thanks
# 4  
Old 09-29-2016
What problem are you attempting to solve, exactly? What user is doing what?

What operating system are you using? Some may have auditing features already.
# 5  
Old 09-29-2016
If you are using an OS supporting dtrace like Solaris and derivatives, OS X, some BSDs, some Linuxes, you might use this script as a starting point: kill.d
# 6  
Old 09-30-2016
I would suggest that perhaps you have someone with root privilege that should not have it.

Do all users have individual normal accounts or do several people share access to root? One can only kill one's own processes unless you have root level privilege. I suppose this is technically UID=0 as root could be renamed or you could have more that one UID=0 account.

If you do not trust your users completely then do not give them any privileges.

The other worry is that you have users sharing an account which allows them to get to a command prompt. This is also very bad as it is very difficult to tell who did what. It would be perfectly possible for someone to read a kill script and work out what the real kill command has been hidden away with if they can get to the command line.

It's all about trust, and I don't have any in my users.



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to KIll a Stored procedure invoked by UNIX?

Hi, I am using sql server 2008 version and invoking the stored procedure using unix script. I want to know the procedure of killing the stored procedure in sql server. If I kill -9 the unix script will it also terminate the process at the SQL server. When I executed the kill -9 PID in unix... (2 Replies)
Discussion started by: Rahul Raj
2 Replies

2. Shell Programming and Scripting

Monitor and restart UNIX process

Hi all, Tearing my hair out..! I have a requirement to monitor and restart a unix process via a simple watchdog script. I have the following 3 scripts that dont work for me.. script 1 (only produces 1 output if process is up or not)... (4 Replies)
Discussion started by: jonnyd
4 Replies

3. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

4. Shell Programming and Scripting

script to monitor different processes on different Unix servers

GM, Can you pls help how to write a script to monitor different processes on different unix servers and send the output to a /tmp/report file, earlier my boss asked me to write a script to monitor just one process running on different servers and send the output to a file so I wrote this exec... (0 Replies)
Discussion started by: baders
0 Replies

5. UNIX for Dummies Questions & Answers

Commands to monitor other user's activity

What commands would you recommend in order to monitor things like when a user logs on to a server, assuming you know that user's name on the server? (2 Replies)
Discussion started by: Sotau
2 Replies

6. UNIX for Dummies Questions & Answers

How to monitor Unix server CPU status?

I like to know how to monitor the UNIX CPU/memory status over time. I need to data to do some graphical representation of the server load. I sort of need to keep track of the vmstat but i dont know how. I hope someone would kindly help me out. thanks. (1 Reply)
Discussion started by: shingpui
1 Replies

7. UNIX for Advanced & Expert Users

How do I monitor packets by OS id on a UNIX box?

We think we may have an IO problem. We have 2 identical Oracle servers with the exact same objects in each database. In one database, the first time a query is executed and the data is moved to SGA from disk the query takes about 40 seconds. However, in the other data base, when the query is... (3 Replies)
Discussion started by: shawn_holman
3 Replies

8. UNIX for Dummies Questions & Answers

what is kill -6 command in unix

what is kill -6 command in unix..?? are there any other similar commands.? ex: kil -1, kill -1 to 8..? thanks (2 Replies)
Discussion started by: abhi_123
2 Replies

9. Shell Programming and Scripting

How to monitor a unix folder?

:confused:Hi All, I have a folder on Sun Solaris 5.8 SPAC and I'm trying to build a monitoring shell or perl script that sends an email to a user whenever a file was put into this folder. issue: if I create a new file in the folder using like 'touch newfile', then the newfile has a current... (9 Replies)
Discussion started by: bizheng
9 Replies

10. Shell Programming and Scripting

Unix Kill processes

Hi guys, I am new to Unix shell scripting. Can anyone of you tell me how to kill all the processes at a time for a particular user?(No listing the process ID of each process in the kill -9 command). Thanks in Advance, -Hary (5 Replies)
Discussion started by: tadi18
5 Replies
Login or Register to Ask a Question