Remove Resource Monitor ; aka rmon, from the load

All rmon resource monitoring has been moved to collectd.

This update removes rmon from mtce and the load.

Story: 2002823
Task: 30045

Test Plan:
PASS: Build and install a standard system.
PASS: Inspect mtce rpm list
PASS: Inspect logs
PASS: Check pmon.d

Change-Id: I7cf1fa071eac89274e7fae1f307e14d548cc945b
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
changes/39/643739/3
Eric MacDonald 4 years ago
parent 64f9dd20cf
commit f55ef546a7
  1. 1
      centos_iso_image.inc
  2. 62
      devstack/lib/stx-metal
  3. 3
      devstack/settings
  4. 1
      mtce-common/src/common/fitCodes.h
  5. 4
      mtce-common/src/common/logMacros.h
  6. 9
      mtce-common/src/common/nodeBase.cpp
  7. 17
      mtce-common/src/common/nodeBase.h
  8. 5
      mtce-common/src/common/nodeUtil.cpp
  9. 1
      mtce-common/src/daemon/daemon_common.h
  10. 5
      mtce-common/src/daemon/daemon_config.cpp
  11. 104
      mtce/centos/mtce.spec
  12. 6
      mtce/src/Makefile
  13. 178
      mtce/src/common/nodeClass.cpp
  14. 45
      mtce/src/common/nodeClass.h
  15. 18
      mtce/src/lmon/lmon.h
  16. 8
      mtce/src/maintenance/Makefile
  17. 137
      mtce/src/maintenance/mtcCompMsg.cpp
  18. 38
      mtce/src/maintenance/mtcCtrlMsg.cpp
  19. 110
      mtce/src/maintenance/mtcNodeComp.cpp
  20. 3
      mtce/src/maintenance/mtcNodeComp.h
  21. 3
      mtce/src/maintenance/mtcNodeHdlrs.cpp
  22. 4
      mtce/src/maintenance/mtcNodeMsg.h
  23. 1
      mtce/src/pmon/scripts/pmon-test.sh
  24. 43
      mtce/src/rmon/Makefile
  25. 1183
      mtce/src/rmon/interfaceHdlr.cpp
  26. 376
      mtce/src/rmon/remoteloggingHdlr.cpp
  27. 852
      mtce/src/rmon/rmon.h
  28. 50
      mtce/src/rmon/rmonApi.h
  29. 51
      mtce/src/rmon/rmonApi/Makefile
  30. 475
      mtce/src/rmon/rmonApi/rmon_api.c
  31. 142
      mtce/src/rmon/rmonApi/rmon_api.h
  32. 76
      mtce/src/rmon/rmonApi/rmon_nodeMacro.h
  33. 22
      mtce/src/rmon/rmonApi/tests/Makefile
  34. 262
      mtce/src/rmon/rmonApi/tests/rmon_api_client_test.cpp
  35. 109
      mtce/src/rmon/rmonApi/tests/rmon_api_client_test.h
  36. BIN
      mtce/src/rmon/rmonApi/tests/rmond_api_test
  37. 203
      mtce/src/rmon/rmonFM.cpp
  38. 4918
      mtce/src/rmon/rmonHdlr.cpp
  39. 674
      mtce/src/rmon/rmonHttp.cpp
  40. 161
      mtce/src/rmon/rmonHttp.h
  41. 616
      mtce/src/rmon/rmonInit.cpp
  42. 778
      mtce/src/rmon/rmonMsg.cpp
  43. 33
      mtce/src/rmon/rmon_resource_notify/Makefile
  44. 552
      mtce/src/rmon/rmon_resource_notify/rmon_resource_notify.cpp
  45. 106
      mtce/src/rmon/rmon_resource_notify/rmon_resource_notify.h
  46. 27
      mtce/src/rmon/scripts/cinder_virtual_resource.conf
  47. 6
      mtce/src/rmon/scripts/infrastructure_resource.conf
  48. 16
      mtce/src/rmon/scripts/instance_resource.conf
  49. 6
      mtce/src/rmon/scripts/management_resource.conf
  50. 16
      mtce/src/rmon/scripts/nova_virtual_resource.conf
  51. 6
      mtce/src/rmon/scripts/oam_resource.conf
  52. 6
      mtce/src/rmon/scripts/remotelogging_resource.conf
  53. 97
      mtce/src/rmon/scripts/rmon
  54. 21
      mtce/src/rmon/scripts/rmon.conf
  55. 43
      mtce/src/rmon/scripts/rmon.logrotate
  56. 23
      mtce/src/rmon/scripts/rmon.service
  57. 47
      mtce/src/rmon/scripts/rmon_reload_on_cpe.sh
  58. 34
      mtce/src/rmon/scripts/rmond.conf
  59. 16
      mtce/src/rmon/scripts/virtual_resource.conf
  60. 396
      mtce/src/rmon/thinmetaHdlr.cpp
  61. 4
      mtce/src/scripts/dmemchk.sh
  62. 1
      mtce/src/scripts/mtc.conf

@ -5,7 +5,6 @@
# mtce
mtce
mtce-pmon
mtce-rmon
mtce-hwmon
mtce-hostw
mtce-lmon

@ -273,7 +273,6 @@ function install_mtce {
local unit_dir=${SYSCONFDIR}/systemd/system
local local_etc_pmond=${sysconf_dir}/pmon.d
local local_etc_rmond=${sysconf_dir}/rmon.d
local local_etc_goenabledd=${sysconf_dir}/goenabled.d
local local_etc_servicesd=${sysconf_dir}/services.d
local local_etc_logrotated=${sysconf_dir}/logrotate.d
@ -309,7 +308,6 @@ function install_mtce {
sudo install -m 644 -p -D fsmon/scripts/fsmond.conf ${sysconf_dir}/mtc/fsmond.conf
sudo install -m 644 -p -D hwmon/scripts/hwmond.conf ${sysconf_dir}/mtc/hwmond.conf
sudo install -m 644 -p -D pmon/scripts/pmond.conf ${sysconf_dir}/mtc/pmond.conf
sudo install -m 644 -p -D rmon/scripts/rmond.conf ${sysconf_dir}/mtc/rmond.conf
sudo install -m 644 -p -D hostw/scripts/hostwd.conf ${sysconf_dir}/mtc/hostwd.conf
sudo install -m 755 -d ${sysconf_dir}/bmc/server_profiles.d
@ -324,12 +322,10 @@ function install_mtce {
sudo install -m 755 -p -D heartbeat/hbsClient ${bin_dir}/hbsClient
sudo install -m 755 -p -D pmon/pmond ${bin_dir}/pmond
sudo install -m 755 -p -D hostw/hostwd ${bin_dir}/hostwd
sudo install -m 755 -p -D rmon/rmond ${bin_dir}/rmond
sudo install -m 755 -p -D fsmon/fsmond ${bin_dir}/fsmond
sudo install -m 755 -p -D hwmon/hwmond ${bin_dir}/hwmond
sudo install -m 755 -p -D mtclog/mtclogd ${bin_dir}/mtclogd
sudo install -m 755 -p -D alarm/mtcalarmd ${bin_dir}/mtcalarmd
sudo install -m 755 -p -D rmon/rmon_resource_notify/rmon_resource_notify ${bin_dir}/rmon_resource_notify
sudo install -m 755 -p -D scripts/wipedisk ${bin_dir}/wipedisk
$STX_SUDO install -m 755 -p -D fsync/fsync ${STX_INST_DIR}/sbin/fsync
sudo install -m 700 -p -D pmon/scripts/pmon-restart ${sbin_dir}/pmon-restart
@ -343,7 +339,6 @@ function install_mtce {
sudo install -m 755 -p -D fsmon/scripts/fsmon ${sysconf_dir}/init.d/fsmon
sudo install -m 755 -p -D scripts/mtclog ${sysconf_dir}/init.d/mtclog
sudo install -m 755 -p -D pmon/scripts/pmon ${sysconf_dir}/init.d/pmon
sudo install -m 755 -p -D rmon/scripts/rmon ${sysconf_dir}/init.d/rmon
sudo install -m 755 -p -D hostw/scripts/hostw ${sysconf_dir}/init.d/hostw
sudo install -m 755 -p -D alarm/scripts/mtcalarm.init ${sysconf_dir}/init.d/mtcalarm
@ -354,7 +349,6 @@ function install_mtce {
# systemd service files
sudo install -m 644 -p -D fsmon/scripts/fsmon.service ${unit_dir}/devstack@fsmon.service
sudo install -m 644 -p -D hwmon/scripts/hwmon.service ${unit_dir}/devstack@hwmon.service
sudo install -m 644 -p -D rmon/scripts/rmon.service ${unit_dir}/devstack@rmon.service
sudo install -m 644 -p -D pmon/scripts/pmon.service ${unit_dir}/devstack@pmon.service
sudo install -m 644 -p -D hostw/scripts/hostw.service ${unit_dir}/devstack@hostw.service
sudo install -m 644 -p -D scripts/mtcClient.service ${unit_dir}/devstack@mtcClient.service
@ -388,31 +382,15 @@ function install_mtce {
sudo install -m 644 -p -D pmon/scripts/sshd.conf ${local_etc_pmond}/sshd.conf
sudo install -m 644 -p -D pmon/scripts/syslog-ng.conf ${local_etc_pmond}/syslog-ng.conf
sudo install -m 644 -p -D pmon/scripts/nslcd.conf ${local_etc_pmond}/nslcd.conf
sudo install -m 644 -p -D rmon/scripts/rmon.conf ${local_etc_pmond}/rmon.conf
sudo install -m 644 -p -D fsmon/scripts/fsmon.conf ${local_etc_pmond}/fsmon.conf
sudo install -m 644 -p -D scripts/mtclogd.conf ${local_etc_pmond}/mtclogd.conf
sudo install -m 644 -p -D alarm/scripts/mtcalarm.pmon.conf ${local_etc_pmond}/mtcalarm.conf
# resource monitor config files
sudo install -m 755 -d ${local_etc_rmond}
sudo install -m 755 -d ${sysconf_dir}/rmonapi.d
sudo install -m 755 -d ${sysconf_dir}/rmonfiles.d
sudo install -m 755 -d ${sysconf_dir}/rmon_interfaces.d
sudo install -m 644 -p -D rmon/scripts/remotelogging_resource.conf ${local_etc_rmond}/remotelogging_resource.conf
sudo install -m 644 -p -D rmon/scripts/cinder_virtual_resource.conf ${local_etc_rmond}/cinder_virtual_resource.conf
sudo install -m 644 -p -D rmon/scripts/nova_virtual_resource.conf ${local_etc_rmond}/nova_virtual_resource.conf
sudo install -m 644 -p -D rmon/scripts/oam_resource.conf ${sysconf_dir}/rmon_interfaces.d/oam_resource.conf
sudo install -m 644 -p -D rmon/scripts/management_resource.conf ${sysconf_dir}/rmon_interfaces.d/management_resource.conf
sudo install -m 644 -p -D rmon/scripts/infrastructure_resource.conf ${sysconf_dir}/rmon_interfaces.d/infrastructure_resource.conf
# sudo install -m 755 -p -D rmon/scripts/query_ntp_servers.sh ${sysconf_dir}/rmonfiles.d/query_ntp_servers.sh
sudo install -m 755 -p -D rmon/scripts/rmon_reload_on_cpe.sh ${local_etc_goenabledd}/rmon_reload_on_cpe.sh
# log rotation
sudo install -m 755 -d ${local_etc_logrotated}
sudo install -m 644 -p -D scripts/mtce.logrotate ${local_etc_logrotated}/mtce.logrotate
sudo install -m 644 -p -D hostw/scripts/hostw.logrotate ${local_etc_logrotated}/hostw.logrotate
sudo install -m 644 -p -D pmon/scripts/pmon.logrotate ${local_etc_logrotated}/pmon.logrotate
sudo install -m 644 -p -D rmon/scripts/rmon.logrotate ${local_etc_logrotated}/rmon.logrotate
sudo install -m 644 -p -D fsmon/scripts/fsmon.logrotate ${local_etc_logrotated}/fsmon.logrotate
sudo install -m 644 -p -D hwmon/scripts/hwmon.logrotate ${local_etc_logrotated}/hwmon.logrotate
sudo install -m 644 -p -D alarm/scripts/mtcalarm.logrotate ${local_etc_logrotated}/mtcalarm.logrotate
@ -420,15 +398,11 @@ function install_mtce {
# software development files
$STX_SUDO install -m 644 -p -D heartbeat/mtceHbsCluster.h ${inc_dir}/mtceHbsCluster.h
$STX_SUDO install -m 755 -p -D public/libamon.so.${major} ${lib64_dir}/libamon.so.${major}
$STX_SUDO install -m 755 -p -D rmon/rmonApi/librmonapi.so.${major} ${lib64_dir}/librmonapi.so.${major}
popd
pushd ${lib64_dir}
$STX_SUDO ln -sf libamon.so.${major} libamon.so.${major}.${minor}
$STX_SUDO ln -sf libamon.so.${major} libamon.so
$STX_SUDO ln -sf librmonapi.so.${major} librmonapi.so.${major}.${minor}
$STX_SUDO ln -sf librmonapi.so.${major} librmonapi.so
popd
}
@ -572,9 +546,6 @@ function start_maintenance {
if is_service_enabled mtce; then
start_mtcClient
fi
if is_service_enabled rmon; then
start_rmon
fi
if is_service_enabled mtclog; then
start_mtclog
fi
@ -604,10 +575,6 @@ function start_pmon {
run_process pmon "${SYSCONFDIR}/rc.d/init.d/pmon start" root root
}
function start_rmon {
run_process rmon "${SYSCONFDIR}/rc.d/init.d/rmon start" root root
}
function start_mtclog {
run_process mtclog "${SYSCONFDIR}/rc.d/init.d/mtclog start" root root
}
@ -678,10 +645,6 @@ function stop_hbsClient {
stop_process hbsClient
}
function stop_rmon {
stop_process rmon
}
function stop_mtclog {
stop_process mtclog
}
@ -710,9 +673,6 @@ function stop_maintenance {
if is_service_enabled hbs; then
stop_hbsClient
fi
if is_service_enabled rmon; then
stop_rmon
fi
if is_service_enabled mtclog; then
stop_mtclog
fi
@ -756,7 +716,6 @@ function cleanup_metal {
local unit_dir=${SYSCONFDIR}/systemd/system
local local_etc_pmond=${sysconf_dir}/pmon.d
local local_etc_rmond=${sysconf_dir}/rmon.d
local local_etc_goenabledd=${sysconf_dir}/goenabled.d
local local_etc_servicesd=${sysconf_dir}/services.d
local local_etc_logrotated=${sysconf_dir}/logrotate.d
@ -769,7 +728,6 @@ function cleanup_metal {
sudo rm -rf ${sysconf_dir}/mtc/fsmond.conf
sudo rm -rf ${sysconf_dir}/mtc/hwmond.conf
sudo rm -rf ${sysconf_dir}/mtc/pmond.conf
sudo rm -rf ${sysconf_dir}/mtc/rmond.conf
sudo rm -rf ${sysconf_dir}/mtc/hostwd.conf
sudo rm -rf ${sysconf_dir}/bmc/server_profiles.d/sensor_hp360_v1_ilo_v4.profile
@ -783,12 +741,10 @@ function cleanup_metal {
sudo rm -rf ${bin_dir}/hbsClient
sudo rm -rf ${bin_dir}/pmond
sudo rm -rf ${bin_dir}/hostwd
sudo rm -rf ${bin_dir}/rmond
sudo rm -rf ${bin_dir}/fsmond
sudo rm -rf ${bin_dir}/hwmond
sudo rm -rf ${bin_dir}/mtclogd
sudo rm -rf ${bin_dir}/mtcalarmd
sudo rm -rf ${bin_dir}/rmon_resource_notify
sudo rm -rf ${bin_dir}/wipedisk
rm -rf ${STX_INST_DIR}/sbin/fsync
sudo rm -rf ${sbin_dir}/pmon-restart
@ -802,7 +758,6 @@ function cleanup_metal {
sudo rm -rf ${sysconf_dir}/init.d/fsmon
sudo rm -rf ${sysconf_dir}/init.d/mtclog
sudo rm -rf ${sysconf_dir}/init.d/pmon
sudo rm -rf ${sysconf_dir}/init.d/rmon
sudo rm -rf ${sysconf_dir}/init.d/hostw
sudo rm -rf ${sysconf_dir}/init.d/mtcalarm
@ -813,7 +768,6 @@ function cleanup_metal {
# systemd service files
sudo rm -rf ${unit_dir}/devstack@fsmon.service
sudo rm -rf ${unit_dir}/devstack@hwmon.service
sudo rm -rf ${unit_dir}/devstack@rmon.service
sudo rm -rf ${unit_dir}/devstack@pmon.service
sudo rm -rf ${unit_dir}/devstack@hostw.service
sudo rm -rf ${unit_dir}/devstack@mtcClient.service
@ -842,26 +796,14 @@ function cleanup_metal {
sudo rm -rf ${local_etc_pmond}/sshd.conf
sudo rm -rf ${local_etc_pmond}/syslog-ng.conf
sudo rm -rf ${local_etc_pmond}/nslcd.conf
sudo rm -rf ${local_etc_pmond}/rmon.conf
sudo rm -rf ${local_etc_pmond}/fsmon.conf
sudo rm -rf ${local_etc_pmond}/mtclogd.conf
sudo rm -rf ${local_etc_pmond}/mtcalarm.conf
# resource monitor config files
sudo rm -rf ${local_etc_rmond}/remotelogging_resource.conf
sudo rm -rf ${local_etc_rmond}/cinder_virtual_resource.conf
sudo rm -rf ${local_etc_rmond}/nova_virtual_resource.conf
sudo rm -rf ${sysconf_dir}/rmon_interfaces.d/oam_resource.conf
sudo rm -rf ${sysconf_dir}/rmon_interfaces.d/management_resource.conf
sudo rm -rf ${sysconf_dir}/rmon_interfaces.d/infrastructure_resource.conf
sudo rm -rf ${sysconf_dir}/rmonfiles.d/query_ntp_servers.sh
sudo rm -rf ${local_etc_goenabledd}/rmon_reload_on_cpe.sh
# log rotation
sudo rm -rf ${local_etc_logrotated}/mtce.logrotate
sudo rm -rf ${local_etc_logrotated}/hostw.logrotate
sudo rm -rf ${local_etc_logrotated}/pmon.logrotate
sudo rm -rf ${local_etc_logrotated}/rmon.logrotate
sudo rm -rf ${local_etc_logrotated}/fsmon.logrotate
sudo rm -rf ${local_etc_logrotated}/hwmon.logrotate
sudo rm -rf ${local_etc_logrotated}/mtcalarm.logrotate
@ -869,14 +811,10 @@ function cleanup_metal {
# software development files
$STX_SUDO rm -rf ${inc_dir}/mtceHbsCluster.h
$STX_SUDO rm -rf ${lib64_dir}/libamon.so.${major}
$STX_SUDO rm -rf ${lib64_dir}/librmonapi.so.${major}
$STX_SUDO rm -rf ${lib64_dir}/libamon.so.${major}.${minor}
$STX_SUDO rm -rf ${lib64_dir}/libamon.so
$STX_SUDO rm -rf ${lib64_dir}/librmonapi.so.${major}.${minor}
$STX_SUDO rm -rf ${lib64_dir}/librmonapi.so
#remove mtce_common
local inc_dir_common=${STX_INST_DIR}/include/mtce-common
local inc_dir_daemon=${STX_INST_DIR}/include/mtce-daemon

@ -27,7 +27,6 @@
# mtcalarm
# mtclog
# pmon
# rmon
STX_METAL_NAME=stx-metal
@ -41,7 +40,7 @@ define_plugin stx-metal
plugin_requires stx-metal stx-fault
if is_service_enabled mtce-components; then
enable_service fsmon hbs hwmon mtce mtcalarm mtclog pmon rmon
enable_service fsmon hbs hwmon mtce mtcalarm mtclog pmon
fi
# Be careful to enable hostw, it will restart your host

@ -47,7 +47,6 @@
#define MTC_CMD_FIT__MGMNT_TXSOCK ("/var/run/fit/mgmnt_txsock") /* mtcClient */
#define MTC_CMD_FIT__INFRA_RXSOCK ("/var/run/fit/infra_rxsock") /* mtcClient */
#define MTC_CMD_FIT__INFRA_TXSOCK ("/var/run/fit/infra_txsock") /* mtcClient */
#define MTC_CMD_FIT__RMON_SOCK ("/var/run/fit/rmon_sock") /* mtcClient */
#define MTC_CMD_FIT__AMON_SOCK ("/var/run/fit/amon_sock") /* mtcClient */
#define MTC_CMD_FIT__NO_INFRA_RSP ("/var/run/fit/no_infra_rsp") /* hbsClient */
#define MTC_CMD_FIT__NO_MGMNT_RSP ("/var/run/fit/no_mgmnt_rsp") /* hbsClient */

@ -109,10 +109,6 @@ typedef struct
int pmon_event_port ; /**< process monitor tx event port */
int pmon_pulse_port ; /**< process Monitor I'm Alive pulse port */
int pmon_cmd_port ; /**< process Monitor command receive port */
int rmon_api_tx_port ; /**< resource monitor api tx port */
int rmon_event_port ; /**< resource monitor api event port */
int rmon_critical_thr ; /**< resmon critical threshold in use */
int rmon_tx_port ; /**< resource monitor tx event port */
int log_step ; /**< used to throttle logging at step rate */
int event_port ; /**< daemon specific event tx port */
int cmd_port ; /**< daemon specific command rx port */

@ -201,14 +201,6 @@ const char * get_mtcNodeCommand_str ( int cmd )
case MTC_EVENT_PMON_LOG: return("pmon log");
case MTC_EVENT_PMOND_RAISE: return("pmon raise");
/* rmon events */
case MTC_EVENT_RMON_READY: return("rmon ready event");
case MTC_EVENT_RMON_CLEAR: return("rmon clear");
case MTC_EVENT_RMON_CRIT: return("rmon critical event");
case MTC_EVENT_RMON_MAJOR: return("rmon major event");
case MTC_EVENT_RMON_MINOR: return("rmon minor event");
case MTC_EVENT_RMON_LOG: return("rmon log");
/* data port events */
case MTC_EVENT_AVS_CLEAR: return("AVS clear");
case MTC_EVENT_AVS_MAJOR: return("AVS major");
@ -246,7 +238,6 @@ const char * get_mtcNodeCommand_str ( int cmd )
/* service events */
case MTC_SERVICE_PMOND: return ("pmond service");
case MTC_SERVICE_RMOND: return ("rmond service");
case MTC_SERVICE_HWMOND: return ("hwmond service");
case MTC_SERVICE_HEARTBEAT: return ("heartbeat service");
default:

@ -396,12 +396,6 @@ void daemon_exit ( void );
#define MAX_MTCE_EVENT_NAME_LEN 64
#define MAX_RESOURCE_NAME_LEN 64
/** RMON message codes **/
#define RMON_CRITICAL (3)
#define RMON_MAJOR (2)
#define RMON_MINOR (1)
#define RMON_CLEAR (0)
/** Interface Codes **/
#define MGMNT_INTERFACE (0)
#define INFRA_INTERFACE (1)
@ -545,7 +539,6 @@ typedef struct
#define MTC_CMD_NOTIFY_INST (0x11110025) /* Notify Inst */
#define MTC_SERVICE_PMOND (0xB00BF00D)
#define MTC_SERVICE_RMOND (0xFAABF00D)
#define MTC_SERVICE_HWMOND (0xF00BF00D)
#define MTC_SERVICE_HEARTBEAT (0xBABEF00D)
@ -564,9 +557,6 @@ typedef struct
/* Generic Monitor Service ready event */
#define MTC_EVENT_MONITOR_READY (0xf0f0f0f0)
/* TODO: Obsolete code */
#define MTC_EVENT_RMON_READY (0x0f0f0f0f)
/** Process Monitor Event codes */
#define MTC_EVENT_PMON_CLEAR (0x02020202) /**< Clear Action */
#define MTC_EVENT_PMON_CRIT (0x04040404) /**< Crit Failed Action */
@ -574,13 +564,6 @@ typedef struct
#define MTC_EVENT_PMON_MINOR (0x08080808) /**< Minor Log action */
#define MTC_EVENT_PMON_LOG (0x03030303) /**< Minor Log action */
/** Process Monitor Event codes */
#define MTC_EVENT_RMON_CLEAR (0x10101010) /**< Clear Action */
#define MTC_EVENT_RMON_CRIT (0x20202020) /**< Crit Failed Action */
#define MTC_EVENT_RMON_MAJOR (0x30303030) /**< Major Degrade Action */
#define MTC_EVENT_RMON_MINOR (0x40404040) /**< Minor Log action */
#define MTC_EVENT_RMON_LOG (0x50505050) /**< Minor Log action */
/** Process Monitor Daemon Running - Event Raise / Clear Codes */
#define MTC_EVENT_PMOND_CLEAR (0x06060606)
#define MTC_EVENT_PMOND_RAISE (0x07070707)

@ -1368,26 +1368,21 @@ string get_event_str ( int event_code )
{
switch ( event_code )
{
case MTC_EVENT_RMON_READY:
case MTC_EVENT_MONITOR_READY:
return "ready" ;
case MTC_EVENT_PMOND_CLEAR:
case MTC_EVENT_PMON_CLEAR:
case MTC_EVENT_RMON_CLEAR:
case MTC_EVENT_HWMON_CLEAR:
return "clear" ;
case MTC_EVENT_PMON_CRIT:
case MTC_EVENT_RMON_CRIT:
case MTC_EVENT_HWMON_CRIT:
return "critical" ;
case MTC_EVENT_PMON_LOG:
return "log" ;
case MTC_EVENT_PMON_MAJOR:
case MTC_EVENT_RMON_MAJOR:
case MTC_EVENT_HWMON_MAJOR:
return "major" ;
case MTC_EVENT_PMON_MINOR:
case MTC_EVENT_RMON_MINOR:
case MTC_EVENT_HWMON_MINOR:
return "minor" ;
case MTC_EVENT_HWMON_CONFIG:

@ -232,7 +232,6 @@ int daemon_run_testhead ( void );
#define CONFIG_CLIENT_PULSE_PORT 0x10000000 /**< Pmon pulse port */
#define CONFIG_AGENT_SECRET_PORT 0x20000000 /**< Barbican HTTP port */
#define CONFIG_AGENT_VIM_EVENT_PORT 0x40000000 /**< VIM Event Port Mask */
#define CONFIG_CLIENT_RMON_PORT 0x80000000 /**< Rmon client port */
#define CONFIG_AGENT_PORT CONFIG_AGENT_MTC_MGMNT_PORT
#define CONFIG_CLIENT_PORT CONFIG_CLIENT_MTC_MGMNT_PORT

@ -342,7 +342,6 @@ void daemon_dump_cfg ( void )
if ( ptr->hbs_to_mtc_event_port) { ilog ("hbs_to_mtc_event_port = %d\n", ptr->hbs_to_mtc_event_port);}
if ( ptr->inv_event_port ) { ilog ("inv_event_port = %d\n", ptr->inv_event_port );}
/* rmond */
if ( ptr->per_node ) { ilog ("per_node = %d\n", ptr->per_node );}
if ( ptr->audit_period ) { ilog ("audit_period = %d\n", ptr->audit_period );}
if ( ptr->pm_period ) { ilog ("pm_period = %d\n", ptr->pm_period );}
@ -350,10 +349,6 @@ void daemon_dump_cfg ( void )
if ( ptr->pmon_amon_port ) { ilog ("pmon_amon_port = %d\n", ptr->pmon_amon_port );}
if ( ptr->pmon_event_port ) { ilog ("pmon_event_port = %d\n", ptr->pmon_event_port );}
if ( ptr->pmon_pulse_port ) { ilog ("pmon_pulse_port = %d\n", ptr->pmon_pulse_port );}
if ( ptr->rmon_api_tx_port ) { ilog ("rmon_api_tx_port = %d\n", ptr->rmon_api_tx_port );}
if ( ptr->rmon_event_port ) { ilog ("rmon_event_port = %d\n", ptr->rmon_event_port );}
if ( ptr->rmon_critical_thr ) { ilog ("rmon_critical_thr = %d\n", ptr->rmon_critical_thr );}
if ( ptr->rmon_tx_port ) { ilog ("rmon_tx_port = %d\n", ptr->rmon_tx_port );}
if ( ptr->event_port ) { ilog ("event_port = %d\n", ptr->event_port );}
if ( ptr->cmd_port ) { ilog ("cmd_port = %d\n", ptr->cmd_port );}
if ( ptr->sensor_port ) { ilog ("sensor_port = %d\n", ptr->sensor_port );}

@ -32,7 +32,6 @@ Requires: /bin/bash
Requires: /bin/systemctl
Requires: dpkg
Requires: time
Requires: mtce-rmon >= 1.0
Requires: libevent-2.0.so.5()(64bit)
Requires: expect
Requires: libfmcommon.so.1()(64bit)
@ -49,7 +48,6 @@ Requires: libc.so.6(GLIBC_2.3)(64bit)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Requires: libjson-c.so.2()(64bit)
Requires: libpthread.so.0(GLIBC_2.2.5)(64bit)
Requires: librmonapi.so.1()(64bit)
Requires: librt.so.1(GLIBC_2.3.3)(64bit)
Requires: libgcc_s.so.1(GCC_3.0)(64bit)
Requires: libstdc++.so.6(CXXABI_1.3)(64bit)
@ -80,9 +78,7 @@ Monitor service (pmond) add both passive and active process monitoring and
automatic recovery of stopped or killed processes. The File System Monitor
Service (fsmond) adds detection and reporting of local file system
problems. The Hardware Monitor Service (hwmond) adds present and predictive
hardware failure detection, reporting and recovery. The Resource Monitor
Service (rmond) adds resource monitoring with present and predictive
failure and overload detection and reporting.
hardware failure detection, reporting and recovery.
The Host Watchdog (hostwd) daemon watches for errors in
pmond and logs system information on error. All of these maintenance
services improve MTTD of node failures as well as resource overload and out
@ -138,48 +134,6 @@ Titanium Cloud Maintenance Process Monitor service (pmond) with
passive (pid), active (msg) and status (qry) process monitoring with
automatic recovery and failure reporting of registered failed processes.
%package -n mtce-rmon
Summary: Titanuim Server Maintenance Resource Monitor Package
Group: base
Requires: /bin/bash
Requires: util-linux
Requires: /bin/systemctl
Requires: dpkg
Requires: time
Requires: libjson-c.so.2()(64bit)
Requires: libstdc++.so.6(CXXABI_1.3)(64bit)
Requires: libevent-2.0.so.5()(64bit)
Requires: libfmcommon.so.1()(64bit)
Requires: librmonapi.so.1()(64bit)
Requires: fm-common >= 1.0
Requires: libc.so.6(GLIBC_2.2.5)(64bit)
Requires: libstdc++.so.6(GLIBCXX_3.4.11)(64bit)
Requires: /bin/sh
Requires: librt.so.1()(64bit)
Requires: libc.so.6(GLIBC_2.3)(64bit)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Requires: libpthread.so.0(GLIBC_2.2.5)(64bit)
Requires: librt.so.1(GLIBC_2.3.3)(64bit)
Requires: libgcc_s.so.1(GCC_3.0)(64bit)
Requires: libevent >= 2.0.21
Requires: librt.so.1(GLIBC_2.2.5)(64bit)
Requires: libuuid.so.1()(64bit)
Requires: libm.so.6()(64bit)
Requires: rtld(GNU_HASH)
Requires: libstdc++.so.6()(64bit)
Requires: libc.so.6()(64bit)
Requires: libgcc_s.so.1()(64bit)
Requires: libstdc++.so.6(GLIBCXX_3.4)(64bit)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Requires: libpthread.so.0()(64bit)
Provides: librmonapi.so.1()(64bit)
%description -n mtce-rmon
Titanium Cloud Host Maintenance Resource Monitor Service (rmond) adds
threshold based monitoring with predictive severity level alarming for
out of tolerance utilization of critical resourses such as memory, cpu
file system, etc.
%package -n mtce-hwmon
Summary: Titanuim Server Maintenance Hardware Monitor Package
Group: base
@ -255,9 +209,7 @@ Monitor service (pmond) add both passive and active process monitoring and
automatic recovery of stopped or killed processes. The File System Monitor
Service (fsmond) adds detection and reporting of local file system
problems. The Hardware Monitor Service (hwmond) adds present and predictive
hardware failure detection, reporting and recovery. The Resource Monitor
Service (rmond) adds resource monitoring with present and predictive
failure and overload detection and reporting. The Guest Services
hardware failure detection, reporting and recovery. The Guest Services
(guestAgent/guestServer) daemons control access into and heartbeat of guest
VMs on the worker. The Host Watchdog (hostwd) daemon watches for errors in
pmond and logs system information on error. All of these maintenance
@ -303,7 +255,6 @@ netlink monitoring for provisioned oam, mgmt and infra interfaces.
%define local_bindir %{local_dir}/bin
%define local_sbindir %{local_dir}/sbin
%define local_etc_pmond %{_sysconfdir}/pmon.d
%define local_etc_rmond %{_sysconfdir}/rmon.d
%define local_etc_goenabledd %{_sysconfdir}/goenabled.d
%define local_etc_servicesd %{_sysconfdir}/services.d
%define local_etc_logrotated %{_sysconfdir}/logrotate.d
@ -355,7 +306,6 @@ install -m 644 -p -D %{_buildsubdir}/fsmon/scripts/fsmond.conf %{buildroot}%{_sy
install -m 644 -p -D %{_buildsubdir}/hwmon/scripts/hwmond.conf %{buildroot}%{_sysconfdir}/mtc/hwmond.conf
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/pmond.conf %{buildroot}%{_sysconfdir}/mtc/pmond.conf
install -m 644 -p -D %{_buildsubdir}/lmon/scripts/lmond.conf %{buildroot}%{_sysconfdir}/mtc/lmond.conf
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/rmond.conf %{buildroot}%{_sysconfdir}/mtc/rmond.conf
install -m 644 -p -D %{_buildsubdir}/hostw/scripts/hostwd.conf %{buildroot}%{_sysconfdir}/mtc/hostwd.conf
install -m 755 -d %{buildroot}/%{_sysconfdir}/etc/bmc/server_profiles.d
@ -371,12 +321,10 @@ install -m 755 -p -D %{_buildsubdir}/heartbeat/hbsClient %{buildroot}/%{local_bi
install -m 755 -p -D %{_buildsubdir}/pmon/pmond %{buildroot}/%{local_bindir}/pmond
install -m 755 -p -D %{_buildsubdir}/lmon/lmond %{buildroot}/%{local_bindir}/lmond
install -m 755 -p -D %{_buildsubdir}/hostw/hostwd %{buildroot}/%{local_bindir}/hostwd
install -m 755 -p -D %{_buildsubdir}/rmon/rmond %{buildroot}/%{local_bindir}/rmond
install -m 755 -p -D %{_buildsubdir}/fsmon/fsmond %{buildroot}/%{local_bindir}/fsmond
install -m 755 -p -D %{_buildsubdir}/hwmon/hwmond %{buildroot}/%{local_bindir}/hwmond
install -m 755 -p -D %{_buildsubdir}/mtclog/mtclogd %{buildroot}/%{local_bindir}/mtclogd
install -m 755 -p -D %{_buildsubdir}/alarm/mtcalarmd %{buildroot}/%{local_bindir}/mtcalarmd
install -m 755 -p -D %{_buildsubdir}/rmon/rmon_resource_notify/rmon_resource_notify %{buildroot}/%{local_bindir}/rmon_resource_notify
install -m 755 -p -D %{_buildsubdir}/scripts/wipedisk %{buildroot}/%{local_bindir}/wipedisk
install -m 755 -p -D %{_buildsubdir}/fsync/fsync %{buildroot}/%{_sbindir}/fsync
install -m 700 -p -D %{_buildsubdir}/pmon/scripts/pmon-restart %{buildroot}/%{local_sbindir}/pmon-restart
@ -391,7 +339,6 @@ install -m 755 -p -D %{_buildsubdir}/fsmon/scripts/fsmon %{buildroot}%{_sysconfd
install -m 755 -p -D %{_buildsubdir}/scripts/mtclog %{buildroot}%{_sysconfdir}/init.d/mtclog
install -m 755 -p -D %{_buildsubdir}/pmon/scripts/pmon %{buildroot}%{_sysconfdir}/init.d/pmon
install -m 755 -p -D %{_buildsubdir}/lmon/scripts/lmon %{buildroot}%{_sysconfdir}/init.d/lmon
install -m 755 -p -D %{_buildsubdir}/rmon/scripts/rmon %{buildroot}%{_sysconfdir}/init.d/rmon
install -m 755 -p -D %{_buildsubdir}/hostw/scripts/hostw %{buildroot}%{_sysconfdir}/init.d/hostw
install -m 755 -p -D %{_buildsubdir}/alarm/scripts/mtcalarm.init %{buildroot}%{_sysconfdir}/init.d/mtcalarm
@ -404,7 +351,6 @@ install -m 644 -p -D %{_buildsubdir}/scripts/hwclock.service %{buildroot}%{_unit
# systemd service files
install -m 644 -p -D %{_buildsubdir}/fsmon/scripts/fsmon.service %{buildroot}%{_unitdir}/fsmon.service
install -m 644 -p -D %{_buildsubdir}/hwmon/scripts/hwmon.service %{buildroot}%{_unitdir}/hwmon.service
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/rmon.service %{buildroot}%{_unitdir}/rmon.service
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/pmon.service %{buildroot}%{_unitdir}/pmon.service
install -m 644 -p -D %{_buildsubdir}/hostw/scripts/hostw.service %{buildroot}%{_unitdir}/hostw.service
install -m 644 -p -D %{_buildsubdir}/scripts/mtcClient.service %{buildroot}%{_unitdir}/mtcClient.service
@ -440,28 +386,17 @@ install -m 644 -p -D %{_buildsubdir}/pmon/scripts/acpid.conf %{buildroot}%{local
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/sshd.conf %{buildroot}%{local_etc_pmond}/sshd.conf
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/syslog-ng.conf %{buildroot}%{local_etc_pmond}/syslog-ng.conf
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/nslcd.conf %{buildroot}%{local_etc_pmond}/nslcd.conf
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/rmon.conf %{buildroot}%{local_etc_pmond}/rmon.conf
install -m 644 -p -D %{_buildsubdir}/fsmon/scripts/fsmon.conf %{buildroot}%{local_etc_pmond}/fsmon.conf
install -m 644 -p -D %{_buildsubdir}/scripts/mtclogd.conf %{buildroot}%{local_etc_pmond}/mtclogd.conf
install -m 644 -p -D %{_buildsubdir}/alarm/scripts/mtcalarm.pmon.conf %{buildroot}%{local_etc_pmond}/mtcalarm.conf
install -m 644 -p -D %{_buildsubdir}/lmon/scripts/lmon.pmon.conf %{buildroot}%{local_etc_pmond}/lmon.conf
# resource monitor config files
install -m 755 -d %{buildroot}%{local_etc_rmond}
install -m 755 -d %{buildroot}%{_sysconfdir}/rmonapi.d
install -m 755 -d %{buildroot}%{_sysconfdir}/rmonfiles.d
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/remotelogging_resource.conf %{buildroot}%{local_etc_rmond}/remotelogging_resource.conf
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/cinder_virtual_resource.conf %{buildroot}%{local_etc_rmond}/cinder_virtual_resource.conf
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/nova_virtual_resource.conf %{buildroot}%{local_etc_rmond}/nova_virtual_resource.conf
install -m 755 -p -D %{_buildsubdir}/rmon/scripts/rmon_reload_on_cpe.sh %{buildroot}%{local_etc_goenabledd}/rmon_reload_on_cpe.sh
# log rotation
install -m 755 -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 -p -D %{_buildsubdir}/scripts/mtce.logrotate %{buildroot}%{local_etc_logrotated}/mtce.logrotate
install -m 644 -p -D %{_buildsubdir}/hostw/scripts/hostw.logrotate %{buildroot}%{local_etc_logrotated}/hostw.logrotate
install -m 644 -p -D %{_buildsubdir}/pmon/scripts/pmon.logrotate %{buildroot}%{local_etc_logrotated}/pmon.logrotate
install -m 644 -p -D %{_buildsubdir}/lmon/scripts/lmon.logrotate %{buildroot}%{local_etc_logrotated}/lmon.logrotate
install -m 644 -p -D %{_buildsubdir}/rmon/scripts/rmon.logrotate %{buildroot}%{local_etc_logrotated}/rmon.logrotate
install -m 644 -p -D %{_buildsubdir}/fsmon/scripts/fsmon.logrotate %{buildroot}%{local_etc_logrotated}/fsmon.logrotate
install -m 644 -p -D %{_buildsubdir}/hwmon/scripts/hwmon.logrotate %{buildroot}%{local_etc_logrotated}/hwmon.logrotate
install -m 644 -p -D %{_buildsubdir}/alarm/scripts/mtcalarm.logrotate %{buildroot}%{local_etc_logrotated}/mtcalarm.logrotate
@ -473,10 +408,6 @@ install -m 755 -p -D %{_buildsubdir}/public/libamon.so.$MAJOR %{buildroot}%{_lib
cd %{buildroot}%{_libdir} ; ln -s libamon.so.$MAJOR libamon.so.$MAJOR.$MINOR
cd %{buildroot}%{_libdir} ; ln -s libamon.so.$MAJOR libamon.so
install -m 755 -p -D %{_buildsubdir}/rmon/rmonApi/librmonapi.so.$MAJOR %{buildroot}%{_libdir}/librmonapi.so.$MAJOR
cd %{buildroot}%{_libdir} ; ln -s librmonapi.so.$MAJOR librmonapi.so.$MAJOR.$MINOR
cd %{buildroot}%{_libdir} ; ln -s librmonapi.so.$MAJOR librmonapi.so
# volatile directories
install -m 755 -d %{buildroot}/var
install -m 755 -d %{buildroot}/var/run
@ -498,9 +429,6 @@ install -m 755 -d %{buildroot}/var/run
%post -n mtce-pmon
/bin/systemctl enable pmon.service
%post -n mtce-rmon
/bin/systemctl enable rmon.service
%post -n mtce-lmon
/bin/systemctl enable lmon.service
@ -604,34 +532,6 @@ install -m 755 -d %{buildroot}/var/run
%{_sysconfdir}/init.d/pmon
%{local_bindir}/pmond
###############################
# Resource Monitor RPM Files
###############################
%files -n mtce-rmon
%defattr(-,root,root,-)
# Config files - Non-Modifiable
%{_sysconfdir}/mtc/rmond.conf
%{local_etc_pmond}/rmon.conf
%{local_etc_logrotated}/rmon.logrotate
%{_unitdir}/rmon.service
%{local_etc_rmond}/remotelogging_resource.conf
%{local_etc_rmond}/cinder_virtual_resource.conf
%{local_etc_rmond}/nova_virtual_resource.conf
%{_libdir}/librmonapi.so.1.0
%{_libdir}/librmonapi.so.1
%{_libdir}/librmonapi.so
%dir %{_sysconfdir}/rmonapi.d
%{_sysconfdir}/init.d/rmon
%{local_bindir}/rmond
%{local_bindir}/rmon_resource_notify
%{local_etc_goenabledd}/rmon_reload_on_cpe.sh
###############################
# Hardware Monitor RPM Files
###############################

@ -9,7 +9,6 @@ VER_MJR=1
build:
(cd public ; make lib VER=$(VER) VER_MJR=$(VER_MJR))
(cd rmon/rmonApi ; make lib VER=$(VER) VER_MJR=$(VER_MJR))
(cd common ; make lib VER=$(VER) VER_MJR=$(VER_MJR))
(cd alarm ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd heartbeat ; make build VER=$(VER) VER_MJR=$(VER_MJR))
@ -19,15 +18,12 @@ build:
(cd lmon ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd pmon ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd fsmon ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd rmon ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd rmon/rmon_resource_notify ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd hostw ; make build VER=$(VER) VER_MJR=$(VER_MJR))
(cd fsync ; make build VER=$(VER) VER_MJR=$(VER_MJR))
clean:
@( cd common ; make clean )
@( cd public ; make clean )
@( cd rmon/rmonApi ; make clean )
@( cd alarm ; make clean )
@( cd mtclog ; make clean )
@( cd hwmon ; make clean )
@ -36,8 +32,6 @@ clean:
@( cd fsmon ; make clean )
@( cd heartbeat ; make clean )
@( cd maintenance ; make clean )
@( cd rmon ; make clean )
@( cd rmon/rmon_resource_notify ; make clean )
@( cd hostw ; make clean )
@( cd fsync ; make clean )
@( rm -rf release )

@ -691,9 +691,7 @@ nodeLinkClass::node* nodeLinkClass::addNode( string hostname )
ptr->degrade_mask = ptr->degrade_mask_save = DEGRADE_MASK_NONE ;
ptr->degraded_resources_list.clear () ;
ptr->pmond_ready = false ;
ptr->rmond_ready = false ;
ptr->hwmond_ready = false ;
ptr->hbsClient_ready = false ;
@ -4766,12 +4764,6 @@ int nodeLinkClass::declare_service_ready ( string & hostname,
}
return (PASS);
}
else if ( service == MTC_SERVICE_RMOND )
{
node_ptr->rmond_ready = true ;
plog ("%s got rmond ready event\n", hostname.c_str());
return (PASS);
}
else if ( service == MTC_SERVICE_HEARTBEAT )
{
if ( node_ptr->hbsClient_ready == false )
@ -4857,73 +4849,6 @@ int nodeLinkClass::collectd_notify_handler ( string & hostname,
return (rc);
}
/** Resource Monitor 'Clear' Event handler.
*
* The resource specified will be removed from the
* 'degraded_resources_list' for specified host.
* if there are no other degraded resources or other
* degraded services/reasons against that host then
* this handler will clear the degrade state for the
* specified host all together. */
int nodeLinkClass::degrade_resource_clear ( string & hostname,
string & resource )
{
/* lr - Log Prefix Rmon */
string lr = hostname ;
lr.append (" rmond:");
nodeLinkClass::node * node_ptr = nodeLinkClass::getNode ( hostname );
if ( node_ptr == NULL )
{
wlog ("%s Unknown Host\n", lr.c_str());
return FAIL_UNKNOWN_HOSTNAME ;
}
else if ( node_ptr->adminState == MTC_ADMIN_STATE__UNLOCKED )
{
/* Clear all resource degrade conditions if there is no resource specified */
/* this is used as a cleanup audit just in case things get stuck */
if ( resource.empty() )
{
node_ptr->degrade_mask &= ~DEGRADE_MASK_RESMON ;
node_ptr->degraded_resources_list.clear () ;
}
else if (( node_ptr->degraded_resources_list.empty()) ||
( node_ptr->degrade_mask == DEGRADE_MASK_NONE ))
{
dlog ("%s '%s' Non-Degraded Clear\n",
lr.c_str(), resource.c_str());
}
else
{
if (is_string_in_string_list (node_ptr->degraded_resources_list, resource))
{
node_ptr->degraded_resources_list.remove(resource);
ilog ("%s '%s' Degrade Clear\n",
lr.c_str(), resource.c_str());
}
else
{
wlog ("%s '%s' Unexpected Degrade Clear\n",
lr.c_str(), resource.c_str());
}
if ( node_ptr->degraded_resources_list.empty() )
{
node_ptr->degrade_mask &= ~DEGRADE_MASK_RESMON ; ;
}
else
{
string degraded_resources =
get_strings_in_string_list ( node_ptr->degraded_resources_list );
wlog ("%s Degraded Resource List: %s\n",
lr.c_str(), degraded_resources.c_str());
}
}
}
return (PASS);
}
/*********************************************************************************
*
* Name : node_degrade_control
@ -4940,9 +4865,6 @@ int nodeLinkClass::degrade_resource_clear ( string & hostname,
*
* "hwmon" - The Hardware Monitor process
*
*
* Future services might be rmon and pmon
*
**********************************************************************************/
int nodeLinkClass::node_degrade_control ( string & hostname, int state, string service )
{
@ -5266,28 +5188,6 @@ int nodeLinkClass::alarm_process_failure ( string & hostname, string & process
return (PASS);
}
/* Generate a log for the reported failed resource if that host is
* unlocked */
int nodeLinkClass::log_resource_failure ( string & hostname, string & resource )
{
/* lr - Log Prefix Rmond */
string lr = hostname ;
lr.append (" rmond:");
nodeLinkClass::node * node_ptr = nodeLinkClass::getNode ( hostname );
if ( node_ptr == NULL )
{
wlog ("%s Unknown Host ; '%s' failed (minor)\n",
lr.c_str(), resource.c_str());
return FAIL_UNKNOWN_HOSTNAME ;
}
else if ( node_ptr->operState == MTC_OPER_STATE__ENABLED )
{
ilog ("%s '%s' failed (minor)\n",
lr.c_str(), resource.c_str());
}
return (PASS);
}
/** Process Monitor Degrade Event handler.
*
* The host will enter degrade state due to the specified process
@ -5443,54 +5343,6 @@ int nodeLinkClass::update_dport_states ( struct nodeLinkClass::node * node_ptr,
return (rc);
}
/** Resource Monitor 'Raise' Event handler.
*
* The host will enter degrade state due to the specified resource
* threshold being surpased. The resource name is recorded in the
* 'degraded_resources_list' for specified host.
* Clearing degrade against this resource requires that host to
* send a clear event against that resource or for that host to
* fully re-enable */
int nodeLinkClass::degrade_resource_raise ( string & hostname,
string & resource )
{
/* lr - Log Prefix Rmond */
string lr = hostname ;
lr.append (" rmond:");
nodeLinkClass::node * node_ptr = nodeLinkClass::getNode ( hostname );
if ( node_ptr == NULL )
{
wlog ("%s Unknown Host\n", lr.c_str());
return FAIL_UNKNOWN_HOSTNAME ;
}
else if ( node_ptr->adminState == MTC_ADMIN_STATE__UNLOCKED )
{
if ( is_string_in_string_list ( node_ptr->degraded_resources_list, resource ) == false )
{
string degraded_resources = "";
ilog ("%s '%s' Degraded\n", lr.c_str(), resource.c_str());
node_ptr->degraded_resources_list.push_back (resource);
node_ptr->degrade_mask |= DEGRADE_MASK_RESMON ;
/* Cleanup the list */
node_ptr->degraded_resources_list.sort ();
node_ptr->degraded_resources_list.unique ();
degraded_resources =
get_strings_in_string_list ( node_ptr->degraded_resources_list );
wlog ("%s Failing Resources: %s\n",
lr.c_str(), degraded_resources.c_str());
}
else
{
dlog ("%s '%s' Degraded (again)\n", lr.c_str(), resource.c_str());
}
}
return (PASS);
}
/** Process Monitor 'Critical Process Failed' Event handler.
*
* This utility handles critical process failure event notifications.
@ -5557,36 +5409,6 @@ int nodeLinkClass::critical_process_failed( string & hostname,
return (PASS);
}
/** Resource Monitor 'Failed' Event handler.
*
* The host will go out of service, be reset and
* automatically re-enabled. */
int nodeLinkClass::critical_resource_failed( string & hostname,
string & resource )
{
nodeLinkClass::node * node_ptr = nodeLinkClass::getNode ( hostname );
if ( node_ptr == NULL )
{
wlog ("%s rmond: Unknown host\n", hostname.c_str());
return FAIL_UNKNOWN_HOSTNAME ;
}
if (( node_ptr->adminState == MTC_ADMIN_STATE__UNLOCKED ) &&
( node_ptr->operState == MTC_OPER_STATE__ENABLED ))
{
/* Start fresh the next time we enter graceful recovery handler */
node_ptr->graceful_recovery_counter = 0 ;
elog ("%s rmond: Critical Resource '%s' Failure\n", hostname.c_str(), resource.c_str());
/* Set node as unlocked-enabled */
allStateChange ( node_ptr, MTC_ADMIN_STATE__UNLOCKED,
MTC_OPER_STATE__DISABLED,
MTC_AVAIL_STATUS__FAILED );
}
return (PASS);
}
bool nodeLinkClass::is_active_controller ( string hostname )
{
if ( nodeLinkClass::my_hostname.compare(hostname) )

@ -602,9 +602,9 @@ private:
* @addtogroup private_monitoring_services_variables
* @{
*
* A grouping a of flags, mask and degrade resource lists
* used to manage the degrade state of a host for process
* and resource monitoring services.
* A grouping a of flags, mask and lists used to
* manage the degrade state of a host for process
* monitoring services.
*/
/* Bit mask of degrade reasons */
@ -631,16 +631,6 @@ private:
recovery_ctrl_type hwmon_reset ;
recovery_ctrl_type hwmon_powercycle ;
/** Resource Monitor Daemon Flag Missing count */
int rmond_missing_count ;
/** Host degraded due to loss of Resource Monitor running flag */
bool rmond_degraded ;
/** Resource Monitor Ready flag and degrade list */
bool rmond_ready ;
std::list<string> degraded_resources_list ;
/** process or resource list string iterator */
std::list<string>::iterator string_iter_ptr ;
@ -1797,16 +1787,6 @@ public:
* specified host all together. */
int degrade_pmond_clear ( string & hostname );
/** Resource Monitor 'Clear' Event handler.
*
* The resource specified will be removed from the
* 'degraded_resources_list' for specified host.
* if there are no other degraded resources or other
* degraded services/reasons against that host then
* this handler will clear the degrade state for the
* specified host all together. */
int degrade_resource_clear ( string & hostname, string & resource );
/**
* If the pmond degrade flag is not set then do so.
* if the host is not degraded then set it to degraded. */
@ -1818,19 +1798,6 @@ public:
/** if host is unlocked-enabled generate a process failure alarm */
int alarm_process_failure ( string & hostname, string & process );
/** Resource Monitor Raise Event handler.
*
* The host will enter degrade state due to the specified resource
* not running properly. The resource name is recorded in the
* 'degraded_resources_list' for specified host.
* Clearing degrade against this resource requires that host to
* send a clear event against that resource or for that host to
* fully re-enable */
int degrade_resource_raise ( string & hostname, string & resource );
/** Generate a resource failure log if the host is unlocked */
int log_resource_failure ( string & hostname, string & resource );
/** Hardware Process Monitor Degrade Event handler.
* see implementation for details */
int node_degrade_control ( string & hostname, int state, string service );
@ -1849,12 +1816,6 @@ public:
* automatically re-enabled. */
int critical_process_failed( string & hostname, string & process, unsigned int nodetype );
/** Resource Monitor Failed Event handler.
*
* The host will go out of service and be reset and
* automatically re-enabled. */
int critical_resource_failed( string & hostname, string & resource );
/************************************************************/
/**

@ -86,24 +86,6 @@ typedef struct
char bond[IF_NAMESIZE] ; /* bonded interface name */
bool lagged ; /* Lagged interface=true or not=false */
// unsigned int debounce_cnt ; /* running monitor debounce count */
// unsigned int minorlog_cnt ; /* track minor log count for thresholding */
// unsigned int count ; /* track the number of times the condition has been occured */
// bool failed ; /* track if the resource needs to be serviced by the resource handler */
// int resource_value ; /* 1 if the interface is up and 0 if it is down */
// int resource_value_lagged ; /* 1 if the interface is up and 0 if it is down for lagged interfaces */
// int sev ; /* The severity of the failed resource */
// rmonStage_enum stage ; /* The stage the resource is in within the resource handler fsm */
// char alarm_id[FM_MAX_BUFFER_LENGTH] ; /* Used by FM API, type of alarm being raised */
// char alarm_id_port[FM_MAX_BUFFER_LENGTH] ; /* Used by FM API, type of alarm being raised for the ports */
// char errorMsg[ERR_SIZE];
// rmon_api_socket_type msg;
// bool link_up_and_running; /* whether the interface is up or down initially */
// bool alarm_raised;
// int failed_send; /* The number of times the rmon api failed to send a message */
} interface_ctrl_type ;

@ -51,9 +51,9 @@ CONTROL_OBJS += ../common/nodeClass.o
OBJS = $(SRCS:.cpp=.o)
BINS = mtcAgent mtcClient
LDLIBS += -lstdc++ -ldaemon -lcommon -lthreadUtil -lipmiUtil -lfmcommon -lrmonapi -lalarm -lpthread -lrt -levent -ljson-c -lamon -lcrypto -luuid
LDLIBS += -lstdc++ -ldaemon -lcommon -lthreadUtil -lipmiUtil -lfmcommon -lalarm -lpthread -lrt -levent -ljson-c -lamon -lcrypto -luuid
INCLUDES = -I. -I/usr/include/mtce-daemon -I/usr/include/mtce-common
INCLUDES += -I../common -I../alarm -I../heartbeat -I../hwmon -I../public -I../rmon/rmonApi
INCLUDES += -I../common -I../alarm -I../heartbeat -I../hwmon -I../public
CCFLAGS += -g -O2 -Wall -Wextra -Werror -Wno-missing-braces
STATIC_ANALYSIS_TOOL = cppcheck
@ -77,10 +77,10 @@ common:
( cd ../common ; make clean ; make lib VER=$(VER) VER_MJR=$(VER_MJR))
mtcAgent: $(OBJS)
$(CXX) $(CONTROL_OBJS) -L../public -L../alarm -L../rmon/rmonApi $(LDLIBS) $(EXTRALDFLAGS) -o mtcAgent
$(CXX) $(CONTROL_OBJS) -L../public -L../alarm $(LDLIBS) $(EXTRALDFLAGS) -o mtcAgent
mtcClient: $(OBJS)
$(CXX) $(COMPUTE_OBJS) -L../public -L../alarm -L../rmon/rmonApi $(LDLIBS) $(EXTRALDFLAGS) -o mtcClient
$(CXX) $(COMPUTE_OBJS) -L../public -L../alarm $(LDLIBS) $(EXTRALDFLAGS) -o mtcClient
remove_bins:
@rm -v -f $(BINS)

@ -55,122 +55,6 @@ extern char *program_invocation_short_name;
int mtcAlive_mgmnt_sequence = 0 ;
int mtcAlive_infra_sequence = 0 ;
/*****************************************************************************
* Also handles: Accelerated Virtual Switch 'events' handler
* for receiving data port state change event
*
* Event strings are:-
* {"type":"port-state", "severity":"critical|major|clear"}
* severity:
* critical - port has failed and is not part of an aggregate
* or is the last port in an aggregate
* (degrade, disable services)
* major - port has failed and is part of an aggregate
* with other inservice-ports (degrade only)
* clear - port has recovered from a failed state and is
* operational (clear degrade, enable services)
*
* NOTE : The port status can transition from any of the above
* states to any other state.
*
* RMON monitors the vswitch ports at a 20 second interval(debounce value).
* If a port changes link state during the polling period, it will
* raise/clear the alarm, but now also calculates the impact of that port
* failure on the provider network data interface.
*
* The overall aggregated state across all provider network interfaces will
* be reported to maintenance when ports enter a link down or up state.
* The agent will also periodically send the current provider network port
* status to maintenance every 20 seconds.
*
* Return : MTC_EVENT_AVS_CLEAR|MAJOR|CRITICAL
*****************************************************************************/
/** Receive and process event messages from rmon **/
static int rmon_message_error = 0 ;
int service_rmon_inbox ( mtc_socket_type * sock_ptr, int & rmon_code, string & resource_name )
{
/* Max rmon message length */
#define RMON_MAX_LEN (100)
/* Max tries to receive rmon message */
#define MAX_TRIES (3)
char buf[RMON_MAX_LEN];
char res_name[RMON_MAX_LEN];
socklen_t len = sizeof(struct sockaddr_in) ;
char str[RMON_MAX_LEN];
int rc = FAIL;
int sequence = 0;
int bytes = 0 ;
int num_tries = 0;
do
{
memset ( buf,0,RMON_MAX_LEN);
memset ( str,0,RMON_MAX_LEN);
bytes = recvfrom( sock_ptr->rmon_socket, buf, RMON_MAX_LEN, 0,
(struct sockaddr *)&sock_ptr->mtc_cmd_addr, &len);
if ( bytes > 0 )
{
sscanf ( buf, "%99s %99s %d", res_name, str, &sequence );
string r_name(res_name);
resource_name = r_name;
if ( str[0] != '\0' )
{
mlog("%s \n",str);
// check if it is an AVS type message
if (regexUtil_string_startswith(str, "AVS_clear")) {
rmon_code = MTC_EVENT_AVS_CLEAR;
} else if (regexUtil_string_startswith(str, "AVS_major")) {
rmon_code = MTC_EVENT_AVS_MAJOR;
} else if (regexUtil_string_startswith(str, "AVS_critical")) {
rmon_code = MTC_EVENT_AVS_CRITICAL;
// process generic RMON messages
} else if (regexUtil_string_startswith(str, "cleared")) {
rmon_code = RMON_CLEAR;
} else if (regexUtil_string_startswith(str, "minor")) {
rmon_code = RMON_MINOR;
} else if (regexUtil_string_startswith(str, "major")) {
rmon_code = RMON_MAJOR;
} else if (regexUtil_string_startswith(str, "critical")) {
rmon_code = RMON_CRITICAL;
} else {
elog("Invalid rmon string: %s \n", str);
rc = FAIL;
return rc;
}
rmon_message_error = 0 ;
rc = PASS;
return rc;
}
else
{
wlog_throttled (rmon_message_error, 1, "rmond message with no severity specified (%s)\n",
resource_name.empty() ? "no resource" : resource_name.c_str());
if (( rmon_message_error == 1 ) && ( buf[0] != '\0' ))
{
ilog ("rmon message: [%s]\n", buf );
}
rc = FAIL_NULL_POINTER;
return rc;
}
}
else if (( 0 > bytes ) && ( errno != EINTR ) && ( errno != EAGAIN ))
{
elog("rmon event recv error (%d:%s) \n", errno, strerror(errno));
rc = FAIL;
}
} while (( bytes > 0 ) && ( ++num_tries < MAX_TRIES)) ;
return rc;
}
/* Receive and process commands from controller maintenance */
int mtc_service_command ( mtc_socket_type * sock_ptr, int interface )
{
@ -627,26 +511,7 @@ int mtce_send_event ( mtc_socket_type * sock_ptr, int cmd , const char * mtce_na
memset (&event, 0 , sizeof(mtc_message_type));
if (( cmd == MTC_EVENT_RMON_READY) ||
( cmd == MTC_EVENT_RMON_MINOR) ||
( cmd == MTC_EVENT_RMON_MAJOR) ||
( cmd == MTC_EVENT_RMON_CRIT ) ||
( cmd == MTC_EVENT_RMON_CLEAR ))
{
snprintf ( &event.hdr[0] , MSG_HEADER_SIZE, "%s", get_mtce_event_header() );
if ( mtce_name_ptr )
{
size_t len = strnlen ( mtce_name_ptr, MAX_MTCE_EVENT_NAME_LEN );
/* We don't use the buffer for mtce events to remove it from the size */
bytes = ((sizeof(mtc_message_type))-(BUF_SIZE-len));
snprintf ( &event.buf[0], MAX_MTCE_EVENT_NAME_LEN , "%s", mtce_name_ptr );
} else {
slog ("Internal Error - mtce_name_ptr is null\n");
}
}
else if ( cmd == MTC_EVENT_LOOPBACK )
if ( cmd == MTC_EVENT_LOOPBACK )
{
snprintf ( &event.hdr[0] , MSG_HEADER_SIZE, "%s", get_loopback_header() );

@ -502,44 +502,6 @@ int mtc_service_inbox ( nodeLinkClass * obj_ptr,
break ;
}
/*****************************************************************
* Resource Monitor Events *
*****************************************************************/
/* TODO: Remove - Suspecting OBS Command */
case MTC_EVENT_RMON_READY:
{
mlog ("%s RMON Ready\n", hostname.c_str());
obj_ptr->declare_service_ready ( hostname, MTC_SERVICE_RMOND );
break ;
}
case MTC_EVENT_RMON_CLEAR:
{
mlog ("%s rmond: '%s' recovered (clear)\n", hostname.c_str(), event.c_str());
obj_ptr->degrade_resource_clear ( hostname , event );
break ;
}
case MTC_EVENT_RMON_CRIT:
{
mlog ("%s rmond: '%s' failed (critical)\n", hostname.c_str(), event.c_str());
obj_ptr->critical_resource_failed ( hostname, event );
break ;
}
case MTC_EVENT_RMON_MAJOR:
{
mlog ("%s rmond: '%s' failed (major)\n", hostname.c_str(), event.c_str());
obj_ptr->degrade_resource_raise ( hostname, event );
break ;
}
case MTC_EVENT_RMON_MINOR:
{
mlog ("%s rmond: '%s' failed (minor)\n", hostname.c_str(), event.c_str());
/* Clear the degrade condition if one is present */
obj_ptr->degrade_resource_clear ( hostname , event );
obj_ptr->log_resource_failure ( hostname, event );
break ;
}
case MTC_EVENT_HWMON_CLEAR:
case MTC_DEGRADE_CLEAR:
{

@ -63,7 +63,6 @@ using namespace std;
extern "C"
{
#include "amon.h" /* for ... active monitoring utilities */
#include "rmon_api.h" /* for ... resource monitoring utilities */
}
@ -181,15 +180,6 @@ void _close_infra_tx_socket ( void )