Re: regarding cluster status (219 Views)
Reply
Super Advisor
rajesh73
Posts: 448
Registered: ‎03-17-2009
Message 1 of 3 (289 Views)

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

 

Acclaimed Contributor
Dennis Handly
Posts: 25,053
Registered: ‎03-06-2006
Message 2 of 3 (248 Views)

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

}'

Trusted Contributor
Emil Velez_2
Posts: 125
Registered: ‎01-15-2002
Message 3 of 3 (219 Views)

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
HP UNIX Certified (CSA, CSE HPUX 11i High Availability) HP Software (Openview) Certified Consultant
Certified HP Instructor, Technical Certified I and II SMB and Enterprise
Master ASE Superdome Solutins

HP Education Services

Ask me about training on Blades, Proliant, HP-UX, ServiceGuard, Polyserve, X9000, Virtual Libraries, and High Availability

internet: Emil.Velez@hp.com
Linkedin: http://www.linkedin.com/in/emilvelez

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.