I have systems running scripts as daemons and am not able to determine if they are running or not with my limited knowledge of RL.
example:
ps -ef|grep vmstat_test
username PID CHILD N TIME ? NN:NN /usr/local/bin/vmstat_test
Since scripts running as daemons do not have a Process Descriptor on many NIX platforms (unless it was written in ‘c’), is there a way I get the following info using Relevance Language?:
the script is running as a daemon in the background (’(name of it) of processes’ does not work)
Since I’m having trouble with sleeping processes showing up as “unnamed” I started down a path using a hint I found in http://forum.bigfix.com/viewtopic.php?id=1026 (Index » Fixlet Authoring » command line argument of running UNIX processes ) to search /proc, I have come up with pieces that get me:
a process name from within the /proc/$PID/task/status file
parenthesized parts 1 of (matches (regex “^Name:%09(nfs.*)$”) of it) of (lines of file it) of ("/proc/" & pid of it as string & “/status”) of processes whose (name of it equals “unnamed”)
2A. an “internal” process id from within the status file
(parenthesized parts 1 of (matches (regex “^Pid:%09(.*)$”) of it) of (lines of file it) of ("/proc/" & pid of it as string & “/status”) of processes whose (name of it equals “unnamed”)
2B. an “external” process id of those processes which are sleeping (in square brackets
nfsd
)
(pid of it as string) of processes whose (name of it equals “unnamed”))
I’m having trouble tying it together to know that I have one each of all the pids for all the nfsd processes. I’ve managed to create a tuple to try to get the entries where the “external” pid matches the “internal” pid. The following generates external pid, name, internal pid for each tuple:
(parenthesized parts 1 of (matches (regex “^Pid:%09(.)$") of it) of (lines of file it) of ("/proc/" & pid of it as string & “/status”) of processes whose (name of it equals “unnamed”) , parenthesized parts 1 of (matches (regex "^Name:%09(nfs.)$”) of it) of (lines of file it) of ("/proc/" & pid of it as string & “/status”) of processes whose (name of it equals “unnamed”) , (pid of it as string) of processes whose (name of it equals “unnamed”)) whose (item 0 of it is item 2 of it)
Thanks very much for trying so hard to resolve the issue I submitted and my thanks is not intended to discourage continuing efforts. The solution I’m working towards, of course, is a way to list the processes across all unix platforms and we all know how many different animals there are. There is a “long” workaround, but involves multiple steps. Basically running a fixlet to run unix commands and port the result to a text file…yuk! I don’t know if there is a way to run actual unix commandline statements from relevance, such as, from a managed property (I suspect not).
The reason some processes, especially scripts which are running as daemons do not show up, has to do with Process Descriptors that are actually tied in some fashion to binaries, like c-code that is compiled. I’ve done some research (I’m not a programmer, but have done lots of scripting) on the web and this is where I had learned about why my script(daemon) was not showing up with the process inspector.
Maybe IBM will add a non-PD process inspector at some point, with results that could display something like a ‘ps -ef’ command does, which is fairly standard across most unix platforms that I know of or are familiar with, (Solaris,Linux and HP-UX).