KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Process list in test properties fragmentary

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
ataudte



Joined: 23 Apr 2008
Posts: 28
Location: FFM, Germany

PostPosted: Mon Aug 25, 2008 1:23 am    Post subject: Process list in test properties fragmentary Reply with quote

Hello KS-Soft team,
hello all the other enthusiastic HostMon users,

I think, you can help me.
I have to monitor processes of some Solaris machines. The list in the test properties isn't accord with the processes at the machine, if I'am using the "ps" command in the prompt.

E.g. there are different Orcale processes running, but I just get "oracle" in the list of the "Process" test. What is the difference between the "oracle" process and the other processes, which are using Oracle for their databases?

I hope somebody has experience with Oracle on Sun Solaris and the processes. At the moment we are using a shell script to check the processes by the machine itself. We could use this script in the "Shell Script" test of HostMonitor, but I want to know, why the list generated by the "ps" command is distinct with the list in the test properties.

Regards,
ataudte
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11867
Location: USA

PostPosted: Mon Aug 25, 2008 10:56 am    Post subject: Reply with quote

Not sure I understand the problem. What exactly means "isn't accord with the processes at the machine"? What exactly processes are missed from the list?

There are 2 files in RMA folder that help to perform Process tests on UNIX systems: proccnt.sh proclist.sh
On Sun systems the following command used to list processes: "ps -eo fname"
You may easily modify proccnt.sh proclist.sh to fit your needs.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
ataudte



Joined: 23 Apr 2008
Posts: 28
Location: FFM, Germany

PostPosted: Tue Aug 26, 2008 12:02 am    Post subject: Reply with quote

Hello Alex,

I will give you a little explanation.
I have to know, whether a process with its specific parameters is running, e.g.
Code:

nsrlcpd -s server4711 -N 1 -n 1
nsrmmd -n 2 -s server4711

With the "Process" test of HostMonitor, I just get "nsrlcpd" and "nsrmmd", but there are processes with multiple instances. They differ in their parameters.

My solution:
At the RMA a config file is placed. In this file stands all the processes with their parameters I want to monitor. I insert the following script in the "Script Manager". The committed parameter is the path to the config file at the machine.
Code:

#!/usr/bin/bash
#---Error Treatment---
if [ $# -eq 0 ]; then
   echo "ScriptRes:Bad:Missing Parameters!"
   exit
else
   #---set config-file---
   if [ ! -f "$1" ]; then
      echo "ScriptRes:Bad:Config File ($1) does not exist"
      exit
   else
      cfg_file=$1
   fi
fi
#
#######################
# Check Proc Function #
#######################
check_proc() {
 if [ -z $1 ]; then
    echo "ScriptRes:Bad:No Program specified"
    exit
  fi
  ps -ef | grep -v grep | grep "$*" > /dev/null
  if [ $? -eq 0 ]; then
    return 0
  else
    return 1
  fi
}
#
#################
# Main Funktion #
#################
main_prog() {
  reply=""
  while read line; do
    proc=`echo $line`
    check_proc $proc
    if [ $? -ne 0 ]; then
      reply="$reply \"$proc\""
    fi
  done < $cfg_file
  if [ "$reply" != "" ]; then
    echo "ScriptRes:Bad:Process(es)$reply not running"
  else
    echo "ScriptRes:Ok:All processes active"
  fi
}
#
#
#######
# Run #
#######
main_prog
#-------------------------------------------------------------------------------

Reply (e.g.):
Code:

Process(es) "nsrlcpd -s server4711 -N 1 -n 1" "nsrmmd -n 2 -s server4711" not running

Now I can use the reply of the test to inform the admin of the Solaris machines, which processes aren't runnig at the respective server.

I think it could be helpful to extend the "Process" test of HostMonitor with the needed parameters. Thus I could differentiate between several instances of one process.

Regards,
ataudte
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11867
Location: USA

PostPosted: Tue Aug 26, 2008 1:53 pm    Post subject: Reply with quote

I see.
As I said you may easily modify proccnt.sh proclist.sh to fit your needs. These files comes with agent and located in the same directory
E.g. you may change ""ps -eo fname" to "ps -ef"

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
ataudte



Joined: 23 Apr 2008
Posts: 28
Location: FFM, Germany

PostPosted: Tue Aug 26, 2008 11:19 pm    Post subject: Reply with quote

Hello Alex,

you are right, but now we can monitor all processes in one tests. I might have use the proclist.sh as a suggestion. The effort would been the same.

Thanks for your time,
ataudte
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 11867
Location: USA

PostPosted: Wed Aug 27, 2008 12:15 pm    Post subject: Reply with quote

Quote:
but now we can monitor all processes in one tests

Yes, you are right - Process test cannot do that.
You created script that can checks all processes, something similar to "Dominant Process" test method designed for Windows only.

I think you may publish your script in "Library" forum. It can be useful for some people.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index