mon.c File Reference
`#include <config.h>`
`#include <unistd.h>`
`#include <statgrab.h>`
`#include <corosync/corotypes.h>`
`#include <corosync/corodefs.h>`
`#include <corosync/coroapi.h>`
`#include <qb/qblist.h>`
`#include <corosync/logsys.h>`
`#include <corosync/icmap.h>`
`#include "fsm.h"`
`#include "service.h"`
Include dependency graph for mon.c:

Go to the source code of this file.

## Data Structures

struct | resource_instance

## Macros

#define | MON_DEFAULT_PERIOD 3000
#define | MON_MIN_PERIOD 500
#define | MON_MAX_PERIOD (120 * CS_TIME_MS_IN_SEC)

## Enumerations

enum | mon_resource_state { MON_S_STOPPED , MON_S_RUNNING , MON_S_FAILED }
enum | mon_resource_event { MON_E_CONFIG_CHANGED , MON_E_FAILURE }

## Functions

| LOGSYS_DECLARE_SUBSYS ("MON")
struct corosync_service_engine * | mon_get_service_engine_ver0 (void)

## Variables

struct corosync_service_engine | mon_service_engine
const char * | mon_running_str = "running"
const char * | mon_failed_str = "failed"
const char * | mon_failure_str = "failure"
const char * | mon_stopped_str = "stopped"
const char * | mon_config_changed_str = "config_changed"
struct cs_fsm_entry | mon_fsm_table []

## Macro Definition Documentation

## MON_DEFAULT_PERIOD

#define MON_DEFAULT_PERIOD 3000

Definition at line 58 of file mon.c.

## MON_MAX_PERIOD

#define MON_MAX_PERIOD (120 * CS_TIME_MS_IN_SEC)

Definition at line 60 of file mon.c.

## MON_MIN_PERIOD

#define MON_MIN_PERIOD 500

Definition at line 59 of file mon.c.

## Enumeration Type Documentation

## mon_resource_event

enum mon_resource_event

Enumerator
MON_E_CONFIG_CHANGED |
MON_E_FAILURE |

Definition at line 135 of file mon.c.

## mon_resource_state

enum mon_resource_state

Enumerator
MON_S_STOPPED |
MON_S_RUNNING |
MON_S_FAILED |

Definition at line 130 of file mon.c.

## Function Documentation

## LOGSYS_DECLARE_SUBSYS()

LOGSYS_DECLARE_SUBSYS | ( | "MON" |  | ) |

## mon_get_service_engine_ver0()

struct corosync_service_engine* mon_get_service_engine_ver0 | ( | void |  | ) |

Definition at line 149 of file mon.c.

References mon_service_engine.

## Variable Documentation

## mon_config_changed_str

const char* mon_config_changed_str = "config_changed"

Definition at line 128 of file mon.c.

## mon_failed_str

const char* mon_failed_str = "failed"

Definition at line 125 of file mon.c.

## mon_failure_str

const char* mon_failure_str = "failure"

Definition at line 126 of file mon.c.

## mon_fsm_table

struct cs_fsm_entry mon_fsm_table[]

Initial value:
= {
{ MON_S_STOPPED, MON_E_CONFIG_CHANGED, mon_config_changed, {MON_S_STOPPED, MON_S_RUNNING, -1} },
{ MON_S_STOPPED, MON_E_FAILURE, NULL, {-1} },
{ MON_S_RUNNING, MON_E_CONFIG_CHANGED, mon_config_changed, {MON_S_RUNNING, MON_S_STOPPED, -1} },
{ MON_S_RUNNING, MON_E_FAILURE, mon_resource_failed, {MON_S_FAILED, -1} },
{ MON_S_FAILED, MON_E_CONFIG_CHANGED, mon_config_changed, {MON_S_RUNNING, MON_S_STOPPED, -1} },
{ MON_S_FAILED, MON_E_FAILURE, NULL, {-1} },
}
MON_S_FAILED
@ MON_S_FAILED
Definition: mon.c:133
MON_S_STOPPED
@ MON_S_STOPPED
Definition: mon.c:131
MON_S_RUNNING
@ MON_S_RUNNING
Definition: mon.c:132
MON_E_FAILURE
@ MON_E_FAILURE
Definition: mon.c:137
MON_E_CONFIG_CHANGED
@ MON_E_CONFIG_CHANGED
Definition: mon.c:136

Definition at line 128 of file mon.c.

## mon_running_str

const char* mon_running_str = "running"

Definition at line 124 of file mon.c.

## mon_service_engine

struct corosync_service_engine mon_service_engine

Initial value:
= {
.name = "corosync resource monitoring service",
.id = MON_SERVICE,
.priority = 1,
.private_data_size = 0,
.flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED,
.lib_init_fn = NULL,
.lib_exit_fn = NULL,
.lib_engine = NULL,
.lib_engine_count = 0,
.exec_engine = NULL,
.exec_engine_count = 0,
.confchg_fn = NULL,
.exec_init_fn = mon_exec_init_fn,
.exec_dump_fn = NULL
}
CS_LIB_FLOW_CONTROL_NOT_REQUIRED
@ CS_LIB_FLOW_CONTROL_NOT_REQUIRED
Definition: coroapi.h:153
MON_SERVICE
@ MON_SERVICE
Definition: corodefs.h:50

Definition at line 57 of file mon.c.

Referenced by mon_get_service_engine_ver0().

## mon_stopped_str

const char* mon_stopped_str = "stopped"

Definition at line 127 of file mon.c.