SAM_HC_CALLBACK_REGISTER(3) Corosync Cluster Engine Programmer's Manual SAM_HC_CALLBACK_REGISTER(3)NAME
sam_hc_callback_register - Register health check callback
SYNOPSIS
#include <corosync/sam.h>
cs_error_t sam_hc_callback_register (sam_hc_callback_t cb);
DESCRIPTION
The sam_hc_callback_register function is used to register a user provided healthcheck callback. After calling of this function, the SAM is
switched from application driven healthchecking to event driven healthchecking. In this mode, sam_hc_send(3) does not need to be executed.
The parameter cb is callback function of type sam_hc_callback_t defined as:
typedef int (*sam_hc_callback_t)(void);
This function will be regulargly called and must return 0 if the process is functioning normally, or -1 if the process is executing abnor-
mally. When -1 is returned, the SAM server execute the registered recovery policy.
A value of NULL can be passed into this function to switch into application driven healthchecking. cb to NULL.
RETURN VALUE
This call return CS_OK value if successful, otherwise and error is returned.
ERRORS
CS_ERR_BAD_HANDLE
SAM was not initialized and registered or health checking is in running state
CS_ERR_LIBRARY
internal library call failed. This can occur during fork() or pipe () system calls and the errno variable can be read to retrieve
more information.
SEE ALSO sam_start(3), sam_stop(3), sam_hc_send(3), sam_register(3),
corosync Man Page 12/01/2009 SAM_HC_CALLBACK_REGISTER(3)
Check Out this Related Man Page
SAM_INITIALIZE(3) Corosync Cluster Engine Programmer's Manual SAM_INITIALIZE(3)NAME
sam_initialize - Initialize health checking
SYNOPSIS
#include <corosync/sam.h>
cs_error_t sam_initialize (int time_interval, sam_recovery_policy_t recovery_policy);
DESCRIPTION
The sam_initialize function is used to initialize health checking of a process.
Application can have only one instance of SAM. This function must be called before any other of SAM functions. It is recommended to ini-
tialize before the process begins any process initialization.
The time_interval parameter is a timeout in milliseconds before taking recovery action after having not received a healthcheck.
If time_interval parameter is zero, there is no time limit and no healthcheck must be sent by the process. In this operational mode, a
process failure will continue to execute the recovery policy.
The recovery_policy is defined as type:
typedef enum {
SAM_RECOVERY_POLICY_QUIT = 1,
SAM_RECOVERY_POLICY_RESTART = 2,
} sam_recovery_policy_t;
where
SAM_RECOVERY_POLICY_QUIT
on failure, the process will terminate.
SAM_RECOVERY_POLICY_RESTART
on failure, the process will restart.
To perform event driven healthchecking, sam_register(3) and sam_start(3) functions must called. Event driven healthchecking causes the
duplicate standby process running the SAM serve rto periodically request healthchecks from the active process.
RETURN VALUE
This call return CS_OK value if successful, otherwise and error is returned.
ERRORS
CS_ERR_BAD_HANDLE
can happened in case of double initialization.
CS_ERR_INVALID_PARAM
recovery_policy has invalid value.
SEE ALSO sam_register(3), sam_start(3), sam_hc_callback_register(3)corosync Man Page 12/01/2009 SAM_INITIALIZE(3)
Hi,
I need to use SAM on HP-UX 11.11.
SAM was working fully but now when I try to view the "Configurable Parameters" SAM comes back with an empty window.
I think it may be related to some security rules I implemented but cannot be sure (mainly permissions tightening).
I have checked... (6 Replies)
On running ‘Disk Devices’ tools under ‘Disks and File Systems’ option of System Administration Manager (SAM) in our UNIX Server (HP 9000 running HPUX B.11.11 U) a warning message appeared. The message that appeared reads as follows
“The Logical Volume Manager shows this device file,... (3 Replies)
Hi Friends,
Can any one help with this:
I have a huge file with the format as
A SAM 4637
B DEPT1 4758 MILAN
A SMITH 46585
B DEPT2 5385 HARRYIS
B SAMUL 63547 GEORGE
B DANIEL 899 BOISE
A FRES 736 74638
I have to read this file and write only the records that starts with "B" only
... (5 Replies)
Hey, new here, so be nice! I'm trying to write a little script to automate the user creation process on one of our boxes. But I would like to be able to use the templates that we have set up in SAM. Is the information in these templates stored in a file somewhere, that I can reference in my... (5 Replies)
Posted this question in another segment by error, but here goes. Lost my notes on the location of the 5min shutdown warning when using SAM. I set my single user system to 0mins so I don't have to keep backspacing out the 5mins and changing it to 0mins.
Thanks
(Located my old notes by accident,... (4 Replies)
Hi I hope this is easy and sorry if I am using the wrong HP terms.
I am looking for a way to glean the command line information from a process I run in SAM?
In AIX I can just select any options I want for particular process and hit F6 and the command line is shown on the screen for use in... (3 Replies)
Good afternoon.
I am a newbie.
We just had a potentially big problem (negated to having good backups).
Basically, there is an option in SAM, to delete all the data from the system that a user ever created.
Lo and behold, silly me, I choose that option, and all sorts of needed files... (5 Replies)
I am constantly getting request to run reports on our AIX server for system health (cpu, io, memory, etc) when users experience performance issues. We are using SolarWinds to monitor system health and it works great for cpu and disk space; however, I cant seem to get memory and io to work... (5 Replies)
Hello,
I've been doing Linux and AIX administration for years, but I'm very new to HPUX. We have an old audit process which involves someone manually using sam to generate user lists. I'd like to kill that old process with fire...
But...
After working a bit in the morning to try and pull... (3 Replies)
Hi,
I have iPlanet 7.0 process running on Solaris system
SunOS mymac15.10 Generic_150400-59 sun4v sparc sun4v.
The link here suggests to use the below command to get process runtime details / health inorder to understand if the iPlanet process is hung or good.
/usr/bin/ps -o "pid ppid... (4 Replies)