Operating System - HP-UX
1833984 Members
1717 Online
110063 Solutions
New Discussion

Re: ServiceGuard SDK, API

 

ServiceGuard SDK, API

Hi, I am about to write an application which runs in a cluster (running Service Guard) and I need to be able to communicate with the cluster to get the status of my packages, their hosting node, the volumes available in the cluster, where are they mounted, etc.

As far as I read, I could use EMS SDK to communicate with ServiceGuard, but I still have to see how to write code to communicate with the cluster.

Is there another solution? A specific SDK, API to use for communicating with ServiceGuard? (The one used with ServiceGuard Manager maybe) Or is EMS the right way to do it?

Thanks for your time,

Cristi
7 REPLIES 7
Jarle Bjorgeengen
Trusted Contributor

Re: ServiceGuard SDK, API

Hi Cristi,

ideally you should write your app, so that it communicates with the package-ip address, and it's service(s) only keeping in mind that the app must be able to cope with a lost connection to the ip address (I.e. the package, or virtual server if you like) disappear, and comes back up.

The package itself should take care of the underlaying infrastructure.

I think you are asking for problems, if the application should be dependant of information like volumegroups, number of nodes and so on.

(Unless it is an app. for tracking config changes in a cluster that is... :-))

Rgds Jarle
Jarle Bjorgeengen
Trusted Contributor

Re: ServiceGuard SDK, API

BTW,

the EMS interface is mainly used by monitor scripts inside the sg-package, to monitor availability of the hw, for the package to take decisions about how to behave in error-conditions.

This should not be a task of the application that will use the package services.

Rgds Jarle

Re: ServiceGuard SDK, API

Basically, I need to get the status of the volumes from the package service itself. So for me it is enough if I can find on which node I can find a volume if it is not currently mounted on the node I expect (or if it is offline, anyway to get its status).

I can see a piece of software called HP Cluster API installed on my machine, but it seems not to be documented.

If you want, I need to get the information you can get with the ServiceGuard Manager.

10x,
Cristi
Jarle Bjorgeengen
Trusted Contributor

Re: ServiceGuard SDK, API

OK,

execute the following commands, from remote using remshell or ssh, you will get what you need.

You will have to run the commands towards the package ip, since you then automgically will reach the node that runs the package.

cmviewcl (-v) will give you info about nodes and packages in the cluster, the status of them, and location.

strings /etc/lvmtab will give you which volumegrups exist on a system.

vgdisplay will show you active volumegroups on the system.

Rgds Jarle

Re: ServiceGuard SDK, API

Thanks for your response.

I thought about using the SG commands to get the cluster resources status, but I would prefer to do it programatically, i.e. directly from my C application by calling the appropriate functions from API (this can be done on Windows or Netware for example and in my opinion it is necessary to have such API for writing cluster aware applications).

If I can not get this API (I am sure that this exists :) ) I will probably get an workaround using the shell commands.

Thanks again for your time.
Cristi

Re: ServiceGuard SDK, API

In the standard package logic, if a volume associated with a package won't activate/mount then the package won't start, and there will be no package IP address.

So you should just be able to go wherever the package IP address is, and have confidence that the packages volumes are available.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Hamdy Al-Sebaey
Regular Advisor

Re: ServiceGuard SDK, API

hi Cristi,
So as Jarli & Duncan told you,you 'll be bound on the package ip, if the package is not running then your FS is not mounted then you 'll not be able on communicate with the VG.
With the help of cmviewcl & vgdisplay you can see where is your package 're running.
Also just keep in a document which is the primary en the secondary node of your package.

Good luck,
Hamdy
Thanks for sharing knowledge