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
Process list in test properties fragmentary
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
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
Hello Alex,
I will give you a little explanation.
I have to know, whether a process with its specific parameters is running, e.g.
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.
Reply (e.g.):
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
I will give you a little explanation.
I have to know, whether a process with its specific parameters is running, e.g.
Code: Select all
nsrlcpd -s server4711 -N 1 -n 1
nsrmmd -n 2 -s server4711
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: Select all
#!/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
#-------------------------------------------------------------------------------
Code: Select all
Process(es) "nsrlcpd -s server4711 -N 1 -n 1" "nsrmmd -n 2 -s server4711" not running
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
Yes, you are right - Process test cannot do that.but now we can monitor all processes in one tests
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