Determine which file is invoking process?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Determine which file is invoking process?
# 1  
Old 06-22-2006
Determine which file is invoking process?

Hey Guys,

I am trying to figure out what is chewing up a bunch of CPU on our SunFire V120 Boxes and I am having a little trouble drilling down the source.

When I check the CPU usage it displays tail & cat as the top two processes
Code:
PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP        
22110 root     1440K 1032K sleep   32    0   0:00.08  24% tail/1 
22111 root     1224K  744K run     21    0   0:00.05  17% cat/1

To get an idea of what arguments were being sent to cat I did a ps -ef | grep cat, which shows this.
Code:
/usr/bin/cat -s /var/adm/messages.9 /var/adm/messages.8 /var/adm/messages.7

Now these message files are massive, approx 150-200MB in size and we roll them up daily into messages.1 messages.2 etc etc up until .24

I am trying to determine which script and or file is initiating this cat against the message files, as it needs to be adjusted to simply look at messages and not the messages.x archived files.

I thought I could determine this by running lsof against the PID's, but I can't tell from these results if a script or a cron job somewhere is initiating the command.

Code:
lsof -p 22110
COMMAND   PID USER   FD   TYPE        DEVICE  SIZE/OFF    NODE NAME
tail    22110 root  cwd   VDIR           0,2       722 3988152 /tmp
tail    22110 root  txt   VREG          32,0     10064  202941 /usr/bin/tail
tail    22110 root  txt   VREG          32,0   1158072   56610 /usr/lib/libc.so.1
tail    22110 root  txt   VREG          32,0     17096  230926 /usr/platform/sun4u/lib/libc_psr.so.1
tail    22110 root  txt   VREG          32,0      4952   56475 /usr/lib/libdl.so.1
tail    22110 root  txt   VREG          32,0    255948   56528 /usr/lib/ld.so.1
tail    22110 root    0u  FIFO 0x30003cf9220     0t512 6871388 (fifofs) PIPE->0x30003cf9308
tail    22110 root    1w  VREG          32,4        30 1982519 /var/opt/OV/tmp/OpC/dmesg.out
tail    22110 root    2u  VCHR          13,2       0t0  321080 /devices/pseudo/mm@0:null
tail    22110 root    6r  VREG          32,4 118769520  788499 /var/adm/messages
tail    22110 root    7r  VREG          32,4         0  788488 /var/adm/loginlog

lsof -p 22111
cat     22111 root  cwd   VDIR           0,2       722 3988152 /tmp
cat     22111 root  txt   VREG          32,0     10092  202786 /usr/bin/cat
cat     22111 root  txt   VREG          32,4 257483912  788494 /var/adm/messages.6
cat     22111 root  txt   VREG          32,0   1158072   56610 /usr/lib/libc.so.1
cat     22111 root  txt   VREG          32,0     17096  230926 /usr/platform/sun4u/lib/libc_psr.so.1
cat     22111 root  txt   VREG          32,0      4952   56475 /usr/lib/libdl.so.1
cat     22111 root  txt   VREG          32,0    255948   56528 /usr/lib/ld.so.1
cat     22111 root    0u  VCHR          13,2       0t0  321080 /devices/pseudo/mm@0:null
cat     22111 root    1u  FIFO 0x30003cf9308  0t262144 6871388 (fifofs) PIPE->0x30003cf9220
cat     22111 root    2u  VCHR          13,2       0t0  321080 /devices/pseudo/mm@0:null
cat     22111 root    3r  VREG          32,4 158160019  788496 /var/adm/messages.5
cat     22111 root    6r  VREG          32,4 118658470  788499 /var/adm/messages
cat     22111 root    7r  VREG          32,4         0  788488 /var/adm/loginlog

What makes this harder is that I am coming into this brand new and I don't know the history of this box, so I'm not even sure why the message files are being processed, but I think it has to do with alarming.

Can anyone suggest a way or interpret the results to find out what is invoking this cat/tail command?

Thanks
Jerrad
# 2  
Old 06-22-2006
NM, I found the problem.
 
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 determine the completion of a background process to trigger something else?

I've been thinking about a peculiar problem, and so far haven't been able to find out a convincing solution to that. To put it simply, I have a shell script (assume it to be parent_script.sh), calling another shell script (child_script.sh) 5 times, in nohup mode to be executed in the background.... (3 Replies)
Discussion started by: Aviktheory11
3 Replies

2. Shell Programming and Scripting

How to determine if there's a file in directory!

Hi All, I'm just wondering how can i determined if there's a file in directory and put it in a logs? dir="/home/test/" Please advise, Thanks, Use code tags, thanks. (1 Reply)
Discussion started by: nikki1200
1 Replies

3. Shell Programming and Scripting

Determine amount of time to process

Hello all, Hopefully someone can point me in the right direction... I have a script written in bash which is pretty basic and just stop/starts various services based on particular conditions. What I am trying to build is a reporting type function which will send out an email with various stats... (3 Replies)
Discussion started by: systrex
3 Replies

4. Shell Programming and Scripting

Determine BL and RL of a file

A regular ebcdic mainframe tape usually contains header information the 1st three blocks of the tape. The header information tells the computer/user more information about what is on tape. The header info is 240 bytes in length at 80 bytes each header. The 1st block/header is volume name or... (1 Reply)
Discussion started by: Linux-wannabe
1 Replies

5. Shell Programming and Scripting

issue invoking shell script using cron, even with proper file permission

I am using tcsh what could possibly be a problem, when using crontab to invoke a shell script. ? The script has the read, write and execute permission to all users. And the script works as expected while executing it in stand-alone mode. Is there a way to trace (like log) what error... (9 Replies)
Discussion started by: vikram3.r
9 Replies

6. UNIX for Dummies Questions & Answers

determine total memory used by some user/process

HI guys, :confused:i would like to know how can i determine the total/approx memory used by a single user. Example Top output is below =========================================================================== top - 20:00:50 up 24 days, 2:48, 2 users, load average: 0.43, 0.40, 0.37... (3 Replies)
Discussion started by: cromohawk
3 Replies

7. AIX

How to determine what process is actively using my harddisk?

Hi, Is there any command that I can issue to check who is actively using my harddisk? I notice that yesterday the hdisk0 and hdisk1 is really actively being used and is reaching almost 100%. I realized that this is because of paging which is climbing up to 70%. However, just this morning... (3 Replies)
Discussion started by: depam
3 Replies

8. Shell Programming and Scripting

determine owner of a file

Hello, I am on a mission to determine the user of file. I have used the ls -l command but it displays permission, link, user, group, etc, but I just want to display just the name of user of a specified file. Many thanks (4 Replies)
Discussion started by: unibboy
4 Replies

9. Shell Programming and Scripting

Shell script for accessing a file in the network drive and invoking oracle sql loader

Hi, Please let me know if anybody is having a solution handy for the below tasks... It would be helpful if somebody can resolve my query. I am new to unix and oracle environment and looking for some online reference for completing a task. Task: Check if the network drive exists Check... (0 Replies)
Discussion started by: sayydevara
0 Replies

10. UNIX for Dummies Questions & Answers

How to determine if a file is ASCII?

I'm writing a script that takes a filename as an argument, which determines the "file type" of the file. I want to know if there is any command I can use to determine if a file is ASCII type, thanks all for giving a help. (11 Replies)
Discussion started by: popo
11 Replies
Login or Register to Ask a Question