Hello experts,
I'm trying to run a script that checks the processes listed and returns their name and their PIDs.
issue is that there are 2 nodeagent processes running and it just vomits the PID but doesnt really give the Name for the second Nodeagent.
Ideally , I would like the Node Name of the nodeagent also printed so you can differentiate amongst the nodeagents.
Any help is appreciated.
Look forward to your responses,
KK
---------- Post updated at 02:38 PM ---------- Previous update was at 02:37 PM ----------
I was using this but this stopped working since one of our processes has more than 4096 characters and processes were all wonky and incorrectly being reported by the script.
Last edited by Franklin52; 04-16-2014 at 03:17 AM..
Reason: Please use code tags
The issue is that you are echoing the value of $p after you assign the $BPMPROCID variable. The value of $p is hard coded in $PROCS list. What you would need to do is create a new variable in the same way you created $BPMPROCID to dynamically pick up the actually process name.
I am not sure where the process name (i.e. Nodeagent) gets outputted on the screen, but say if it is the last word on the line when performing 'ps aux' , the below amendments (assigning a PNAME variable and printing that instead of $p) should work for you. Hope this helps.
Btw obviously Corona is right, there are of course more effective/efficient ways of doing this, I'm just trying to help to benefit your understanding at the very least.
Everything before the hyphen (-) like dmgr BPM.* nodeagent(Node1/2) is in the process its just that i suck this this whole thing.
---------- Post updated at 05:15 PM ---------- Previous update was at 05:10 PM ----------
pilnet 101 ,
I appreciate you helping me out.I really do.
As i said , i struggle a lot with this kind of stuff....
---------- Post updated 04-16-14 at 11:12 AM ---------- Previous update was 04-15-14 at 05:15 PM ----------
Quote:
Originally Posted by pilnet101
The issue is that you are echoing the value of $p after you assign the $BPMPROCID variable. The value of $p is hard coded in $PROCS list. What you would need to do is create a new variable in the same way you created $BPMPROCID to dynamically pick up the actually process name.
I am not sure where the process name (i.e. Nodeagent) gets outputted on the screen, but say if it is the last word on the line when performing 'ps aux' , the below amendments (assigning a PNAME variable and printing that instead of $p) should work for you. Hope this helps.
Btw obviously Corona is right, there are of course more effective/efficient ways of doing this, I'm just trying to help to benefit your understanding at the very least.
I'm likely going to explain this clumsily, so apologies in advance:
I have the following script:
#!/bin/bash
pidPrefix="logGen"
checkPrime ()
{
if /sbin/ifconfig eth0:0|/bin/grep -wq inet;then isPrime=1;else isPrime=0;fi
}
killScript ()
{
/usr/bin/find /var/run -name... (4 Replies)
I'm doing a script with the Shell. I need that it only show the number of running processes.
Ex:
echo "There are `command` running processes"
Thnx!
Pd: Sorry the idiom. I'm spanish. (5 Replies)
I'm doing a script with the Shell. I need that it only show the number of running processes.
Ex:
echo "There are `command` running processes"
Thnx!
Pd: Sorry the idiom. I'm spanish. (2 Replies)
I searched the forums but didn't see anything related to what I'm looking for. I need a script that would give me a listing of jobs running longer than, for example, 12 hours or so. Thanks in advance for your assistance!! (2 Replies)
Hi,
I am trying to write a script, which queries a db to get the names of processes, stores it in a file and then checks if that process is running on a remote server. However I am not getting it right, could anyone help me out.
#!/bin/sh
echo "select Address from Device where Cust =... (5 Replies)
Hi Friends,
I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance.
Thanks&Regards,
Amit (3 Replies)
Hi Friends,
I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance.
Thanks&Regards,
Amit (1 Reply)
Hi Friends,
I need to write a script to kill some processes running for more than 10 minutes. Can I get some pointers on that. Thanks for ur help in Advance.
Thanks&Regards,
Amit (1 Reply)