Operating System - HP-UX
1745788 Members
3622 Online
108722 Solutions
New Discussion

Re: regarding cluster status

 
rajesh73
Super Advisor

regarding cluster status

i need to write the script for pakage down

 

below find the below ouput

 

 

$ /usr/sbin/cmviewcl

CLUSTER        STATUS
rkdbclu01     up

  NODE           STATUS       STATE
  rkdb001       up           running

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE
    dbPE1          up               running          enabled     rkdb001

  NODE           STATUS       STATE
  rkdb002       up           running
$

 

in this above output we need to write the script for two condition

 

condition 1- when ever pakage down we need to send the mail to respective team

 

conditon 2 - we need to run the pakage on primary node only rkdb001, if any thing wrong we need to send a mail to respective team

 

2 REPLIES 2
Dennis Handly
Acclaimed Contributor

Re: regarding cluster status

>condition 1- when ever package down we need to send the mail to respective team

>condition 2 - we need to run the package on primary node only rkdb001, if any thing wrong we need to send a mail

 

Perhaps something like this:

package=dbPE1

node=rkdb001

/usr/sbin/cmviewcl | awk -v package_check=$package -v node_check=$node '

$1 == "CLUSTER" {

   getline

   cluster = $1

   cluster_status = $2

   # logic here?

   if (cluster_status != "up") {

      print "Cluster", cluster, "is not up:", cluster_status

   }

   next

}

$1 == "NODE" {

   getline

   node = $1

   node_status = $2

   node_state = $3

   # logic here?

   if (node_status != "up") {

      print "Node", node, "is not up:", node_status

   }

   next

}

$1 == "PACKAGE" {

   getline

   package = $1

   package_status = $2

   package_state = $3

   # logic here?

   if (package_status != "up") {

      print "Package", package, "is not up:", package_status

      if (package == package_check) {

         # invoke mailx here

      }

   } else { # package is up, check node

      if (package == package_check && node != node_check) {

         # invoke mailx here

      }

   }

   next

}'

Emil Velez_2
Trusted Contributor

Re: regarding cluster status

when your package shuts down it can run a external script or for legay packages there is a section in the script called customer_defined_run or stop_cmds

IN that secton you can put logic that checks what node the package is running on and runs commands if it is not the primary node.

In modular packges in the package start and stop function in the external script you can put the same type of shell script code to accomplish this.

Emil Velez
Instructor Storage, Servers, HP-UX and Partner Courses
Hewlett Packard Enterprise Education Services
Ask me about training on StoreServ (3PAR) StoreOnce, StoreEasy, StoreAll, StoreVirtual, HP-UX, ServiceGuard and HPE Partner Ready Certification Training

internet: Linkedin: http://www.linkedin.com/in/emilvelez

HPE Master ASE Server Solutions Architect V3
HPE Master ASE Storage Solutions Architect V2
HP UNIX Certified (ASE HPUX 11iv3 Administration V1)
Certified HPE Instructor
HPE Product Certified - OneView [2016]
HP Sales Certified -Servers, Converged Systems and Services [2015]
HPE Product Certified - Converged Solutions [2017]