This decouples the build and packaging of guest-server, guest-agent from mtce, by splitting guest component into stx-nfv repo. This leaves existing C++ code, scripts, and resource files untouched, so there is no functional change. Code refactoring is beyond the scope of this update. Makefiles were modified to include devel headers directories /usr/include/mtce-common and /usr/include/mtce-daemon. This ensures there is no contamination with other system headers. The cgts-mtce-common package is renamed and split into: - repo stx-metal: mtce-common, mtce-common-dev - repo stx-metal: mtce - repo stx-nfv: mtce-guest - repo stx-ha: updates package dependencies to mtce-pmon for service-mgmt, sm, and sm-api mtce-common: - contains common and daemon shared source utility code mtce-common-dev: - based on mtce-common, contains devel package required to build mtce-guest and mtce - contains common library archives and headers mtce: - contains components: alarm, fsmon, fsync, heartbeat, hostw, hwmon, maintenance, mtclog, pmon, public, rmon mtce-guest: - contains guest component guest-server, guest-agent Story: 2002829 Task: 22748 Change-Id: I9c7a9b846fd69fd566b31aa3f12a043c08f19f1f Signed-off-by: Jim Gauld <james.gauld@windriver.com>
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
#ifndef __PMONALARM_H__
|
|
#define __PMONALARM_H__
|
|
|
|
/*
|
|
* Copyright (c) 2015-2017 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* Wind River Titanium Cloud Process Monitor 'Alarm' Header
|
|
*/
|
|
|
|
#include <iostream>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <list>
|
|
|
|
using namespace std;
|
|
|
|
#include "alarmUtil.h" /* for .. alarmUtil_<severity> */
|
|
|
|
/** Alarm Abstract Reference IDs */
|
|
typedef enum
|
|
{
|
|
PMON_ALARM_ID__PMOND = 0,
|
|
PMON_ALARM_ID__LAST = 1,
|
|
} pmon_alarm_id_enum ;
|
|
|
|
/* Keep track of queried alarms and severities */
|
|
typedef struct
|
|
{
|
|
string process ;
|
|
EFmAlarmSeverityT severity ;
|
|
} active_process_alarms_type ;
|
|
|
|
/* Clear any pending alarms if the specified hostname is valid */
|
|
void manage_queried_alarms ( list<active_process_alarms_type> & alarm_list, string hostname="" );
|
|
|
|
void pmonAlarm_init ( void );
|
|
|
|
EFmAlarmSeverityT pmonAlarm_state ( string hostname, pmon_alarm_id_enum id );
|
|
|
|
string pmonAlarm_getId_str ( pmon_alarm_id_enum id );
|
|
|
|
/** Clear the specified process monitor alarm for specific host */
|
|
int pmonAlarm_clear ( string hostname, pmon_alarm_id_enum id, string process );
|
|
|
|
/** Assert a specified alarm or log against the specified host with a MINOR severity level */
|
|
int pmonAlarm_minor ( string hostname, pmon_alarm_id_enum id, string process, int restarts );
|
|
int pmonAlarm_minor_log( string hostname, pmon_alarm_id_enum id, string process, int restarts );
|
|
|
|
/** Assert a specified alarm or log against the specified host with a MAJOR severity level */
|
|
int pmonAlarm_major ( string hostname, pmon_alarm_id_enum id, string process );
|
|
int pmonAlarm_major_log( string hostname, pmon_alarm_id_enum id, string process );
|
|
|
|
/** Assert a specified alarm or log against the specified host with a CRITICAL severity level */
|
|
int pmonAlarm_critical ( string hostname, pmon_alarm_id_enum id, string process );
|
|
int pmonAlarm_critical_log( string hostname, pmon_alarm_id_enum id, string process );
|
|
|
|
#endif /* __PMONALARM_H__ */
|