System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop and start this Patrol Agent in HPUX.

 
HP UNIX Professionals
Frequent Advisor

How to stop and start this Patrol Agent in HPUX.

I Experts,

We have HPUNIX 11.00 Box, BMC patrol is installed for monitoring. How to stop and start this Patrol Agent in HPUX.


Output of file script:
======================

cd /sbin/init.d

root@server1:/sbin/init.d# cat patrol
#!/bin/ksh

# agent port (3181 for standalone agents, 3185 onwards for cluster agents)
PATPORT=3181
export PATPORT

# log location for the output from this script
PDEBUG=/var/tmp/patrol.debug.$PATPORT
export PDEBUG

# Patrol Agent base directory (where patrolrc.sh can be found)
PATROLBASEDIR=/opt/BMCSoftware/Patrol3
export PATROLBASEDIR

set -x
exec > $PDEBUG 2>&1

case $1 in
'start')
echo "running $0"
ps -ef | grep PatrolAgent | grep $PATPORT | grep -v grep >/dev/null
if [ $? -eq 0 ]
then
echo "Patrol Agent already started"
else
echo "Starting Patrol Agent "
su - patrol -c "cd $PATROLBASEDIR ; . ./patrolrc.sh ; fix_hist -p $PATPORT -no_backup -no_pack_ann ; ./PatrolAgent -p $PATPORT "
fi
echo "Finished $0"
;;
'stop')
echo "Stopping Patrol Agent "
su - patrol -c "cd $PATROLBASEDIR ; . ./patrolrc.sh ; pconfig +KILL -port $PATPORT"

echo "Waiting for patrol to shutdown for 5 secs "
sleep 5
kill -9 `ps -ef | grep "PatrolAgent" | grep $PATPORT | grep -v grep | awk '{print $2}'`
;;
*)
echo "Usage $0 start/stop"
;;
esac

==============================================
root@server1:# cd /opt/BMCSoftware/Patrol3
root@server1:/opt/BMCSoftware/Patrol3# ll
total 216
-rwxr-xr-x 1 patrol patrol 4947 Sep 18 2008 .patrolrc
drwxr-xr-x 8 patrol patrol 1024 Sep 18 2008 HPUX-V11-64
-rwxr-xr-x 1 root sys 1350 Sep 29 2008 PatrolAgent
-rwxr-xr-x 1 patrol patrol 7701 Sep 18 2008 agent_configure.sh
drwxr-xr-x 2 root sys 96 Dec 19 2008 app-defaults
drwxr-xr-x 2 patrol patrol 1024 Sep 19 2008 archives
drwxr-xr-x 2 patrol patrol 1024 Sep 19 2008 bin
-rwxr-xr-x 1 patrol patrol 5794 Sep 19 2008 ctrl_scripts.sh
drwxr-xr-x 2 patrol patrol 1024 Sep 18 2008 dirfix
-rw-r--r-- 1 patrol patrol 261 Sep 18 2008 dirfix_MISHP.patrol.log
-rw-r--r-- 1 root sys 258 Sep 18 2008 dirfix_MISHP.root.log
drwxr-xr-x 2 patrol patrol 96 Sep 18 2008 discovery
drwxr-xr-x 10 patrol patrol 1024 Sep 18 2008 lib
-rwxr-xr-x 1 patrol patrol 4886 Sep 18 2008 patrolrc.sh
drwxr-xr-x 2 patrol patrol 1024 Sep 18 2008 pemapi
-rwxr-xr-x 1 patrol patrol 9023 Sep 18 2008 post_check.sh
-rwxr-xr-x 1 patrol patrol 4188 Sep 18 2008 pre_check.sh

Thanks in Advance

vinay
2 REPLIES
Johnson Punniyalingam
Honored Contributor

Re: How to stop and start this Patrol Agent in HPUX.

STOP Agent

Login as root

# su - patrol
# cd /opt/BMCSoftware/Patrol3
# ./patrolrc.sh stop


START Agent

Login as root

# su - patrol
# cd /opt/BMCSoftware/Patrol3
# ./patrolrc.sh start
Problems are common to all, but attitude makes the difference
Patrick Wallek
Honored Contributor

Re: How to stop and start this Patrol Agent in HPUX.

Or just utilize the script in /sbin/init.d since that's why it is there.

# /sbin/init.d/patrol stop

# /sbin/init.d/patrol start