Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Do it yourself -> implement selfmonitoring of CO/VPV with PVTK and OMi

PVTK 2.0 allows to do selfmonitoring of the CO/VPV with the OMi integration.
Details can be found in the PVTK_2.0_User_and_Reference_Manual.pdf

To get this on the road a few things are needed:

1) a open message (opcmsg policy that catches all events with the message group PVTK. Deploy it on your CO/VPV.
Test it with

 /opt/OV/contrib/PVTK/pvsupport  -opcmsg on -script test_OMi_integration.pvs

an event should appear in teh OMI Event browser.

2) additional a pvs script which configures what parts of CO/VPV neds to be monitored and a deamon needs to be started is needed. To be sure that the daemon is running after a reboot a small control script is needed, too.
To make live easier i put all these steps into a small script. the script creates the pvs script and starts and monitor the deamon. so this script need just to be scheduled reguary with e.g. schedule task policy or cron. on my CO/VPV this script runs all 30 minutes:

root@omivpv instrumentation]# cat vpv_startmonitoring.sh
#set -x

PIDFILE=/var/opt/OV/tmp/`basename $0`.pid
LOGFILE=/var/opt/OV/log/`basename $0`.log
TMPFILE=/var/opt/OV/tmp/`basename $0`.tmp
echo `date "+%F %X"` $1 started >>$LOGFILE
if [ ! -e /opt/OV/contrib/PVTK/scripts/vpv_selfmonitoring.pvs ] ; then
# selfmonitoring doesnt exist. create it
echo "
opcmsg minor:archive,restart
opcmsg major:collection_anomaly
opcmsg normal:exit,loopstart
opcmsg on
wait collection_anomaly:0:1h
repeat 4
" > /opt/OV/contrib/PVTK/scripts/vpv_selfmonitoring.pvs
echo `date "+%F %X"` /opt/OV/contrib/PVTK/scripts/vpv_selfmonitoring.pvs not found, created >> $LOGFILE

if [ -e $PIDFILE ] ; then
# Pidfile exist. checking for Process

if [ `ps -ef | grep pvsupport | grep "$PID" | awk '{print $2}' | head -1` = $PID ]; then
echo `date "+%F %X"` PID $PID found. nothing to do. exit  >> $LOGFILE
  exit 0
  /opt/OV/bin/opcmsg msg_g=PVTK a=$1 o=vPV_Selfmonitoring sev=Warning msg_t="PVTK Selfmonitoring: ProcessID PID not found. Process was terminated"
  rm -f $PIDFILE
echo `date "+%F %X"` PID $PID not found. delete PID File $PIDFILE >> $LOGFILE
PID=`/opt/OV/contrib/PVTK/pvsupport -bg -opcmsg on -script vpv_selfmonitoring.pvs 2>&1 | tee $TMPFILE | grep PID | awk '{print $2}'`
echo $PID > $PIDFILE
/opt/OV/bin/opcmsg msg_g=PVTK a=$1 o=vPV_Selfmonitoring sev=Normal msg_t="PVTK selfmonitoring started PID=$PID"
echo `date "+%F %X"` /opt/OV/contrib/PVTK/pvsupport bg -opcmsg on -script vpv_selfmonitoring.pvs  with PID $PID started >> $LOGFILE
exit 0

4) after starting the script a normal event appear in the OMi Event console.
If there are anomalies happens during collection events are created.

Have fun. Feedback is welcome



Labels (1)
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.