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

Depends-On: https://review.openstack.org/#/c/643739
Change-Id: I927862895272fdd024d281ab49e0a128465b1b3f
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
Eric MacDonald 2019-03-16 19:25:42 -04:00
parent 81a1a248cb
commit c0617ebb53
6 changed files with 5 additions and 264 deletions

View File

@ -17,7 +17,7 @@ index a16660a..ec85fc2 100644
Patch1004: bz1568589-4-aliyun-vpc-move-ip-bundled.patch
+# STX
+Patch1105: filesystem_rmon.patch
+
+Patch1106: new_ocf_return_codes.patch
+Patch1107: ipaddr2_check_if_state.patch
+Patch1108: copyright.patch
@ -26,7 +26,7 @@ index a16660a..ec85fc2 100644
+Patch1111: pgsql.patch
+
+
+Patch1114: notify-rmon-of-shutdown-before-shutting-down.patch
+
+Patch1115: Fix-VG-activity-bug-in-heartbeat-LVM-script.patch
+Patch1116: ocf-shellfuncs_change_logtag.patch
+Patch1117: lvm_cleanup_refs_on_stop.patch
@ -42,7 +42,7 @@ index a16660a..ec85fc2 100644
%endif
+# STX
+%patch1105 -p1
+
+%patch1106 -p1
+%patch1107 -p1
+%patch1108 -p1
@ -51,7 +51,7 @@ index a16660a..ec85fc2 100644
+%patch1111 -p1
+
+
+%patch1114 -p1
+
+%patch1115 -p1
+%patch1116 -p1
+%patch1117 -p1

View File

@ -1,202 +0,0 @@
From a4b297ec4b5decaa1752a2f867ba890604804159 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 15:12:25 -0400
Subject: [PATCH 01/13] WRS: Patch1105: filesystem_rmon.patch
---
heartbeat/Filesystem | 59 +++++++++++++++++++++++++++++++++++++++++++++++++---
heartbeat/LVM | 58 +++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 110 insertions(+), 7 deletions(-)
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
index d834096..8cd9c6b 100755
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -19,6 +19,7 @@
# OCF_RESKEY_run_fsck
# OCF_RESKEY_fast_stop
# OCF_RESKEY_force_clones
+# OCF_RESKEY_rmon_rsc_name
#
#OCF_RESKEY_device : name of block device for the filesystem. e.g. /dev/sda1, /dev/md0
# Or a -U or -L option for mount, or an NFS mount specification
@@ -30,6 +31,7 @@
#OCF_RESKEY_fast_stop : fast stop: yes(default)/no
#OCF_RESKEY_force_clones : allow running the resource as clone. e.g. local xfs mounts
# for each brick in a glusterfs setup
+#OCF_RESKEY_rmon_rsc_name: resource name to use when notifing RMON
#
#
# This assumes you want to manage a filesystem on a shared (SCSI) bus,
@@ -822,18 +824,63 @@ if [ "$OP" != "monitor" ]; then
ocf_log info "Running $OP for $DEVICE on $MOUNTPOINT"
fi
+RMON_NOTIFY="/usr/local/bin/rmon_resource_notify"
+
+rmon_notify() {
+ local RSC_STATE=$1 TIMEOUT=$2
+
+ if [ -z "OCF_RESKEY_rmon_rsc_name" ]
+ then
+ ocf_log err "No RMON resource name given for $OCF_RESKEY_directory"
+ return
+ fi
+
+ if [[ -x $RMON_NOTIFY ]]
+ then
+ $RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+ --resource-state $RSC_STATE \
+ --resource-type mount \
+ --device $OCF_RESKEY_device \
+ --mount-point $OCF_RESKEY_directory \
+ --timeout $TIMEOUT \
+ >/dev/null 2>&1
+ else
+ ocf_log err "$RMON_NOTIFY not available, failed to execute: \
+$RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+--resource-state $RSC_STATE --resource-type mount \
+--device $OCF_RESKEY_device --mount-point $OCF_RESKEY_directory \
+--timeout $TIMEOUT"
+ fi
+}
+
case $OP in
status) Filesystem_status
- exit $?
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc
;;
monitor) Filesystem_monitor
- exit $?
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc
;;
validate-all) Filesystem_validate_all
exit $?
;;
stop) Filesystem_stop
- exit $?
+ rc=$?
+ rmon_notify "disabled" 300
+ exit $rc
;;
esac
@@ -879,6 +926,12 @@ fi
case $OP in
start) Filesystem_start
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc
;;
*) usage
exit $OCF_ERR_UNIMPLEMENTED
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 425a60a..ba6c198 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -22,6 +22,7 @@
#
# OCF parameters are as below:
# OCF_RESKEY_volgrpname
+# OCF_RESKEY_rmon_rsc_name
#
#######################################################################
# Initialization:
@@ -406,6 +407,34 @@ then
exit $OCF_ERR_CONFIGURED
fi
+RMON_NOTIFY="/usr/local/bin/rmon_resource_notify"
+
+rmon_notify() {
+ local RSC_STATE=$1 TIMEOUT=$2
+
+ if [ -z "OCF_RESKEY_rmon_rsc_name" ]
+ then
+ ocf_log err "No RMON resource name given for $OCF_RESKEY_volgrpname"
+ return
+ fi
+
+ if [[ -x $RMON_NOTIFY ]]
+ then
+ $RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+ --resource-state $RSC_STATE \
+ --resource-type lvg \
+ --volume-group $OCF_RESKEY_volgrpname \
+ --timeout $TIMEOUT \
+ >/dev/null 2>&1
+ else
+ ocf_log err "$RMON_NOTIFY not available, failed to execute: \
+$RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+--resource-state $RSC_STATE --resource-type lvg \
+--volume-group $OCF_RESKEY_volgrpname \
+--timeout $TIMEOUT"
+ fi
+}
+
# Get the LVM version number, for this to work we assume(thanks to panjiam):
#
# LVM1 outputs like this
@@ -449,16 +478,37 @@ case "$1" in
start)
LVM_validate_all
LVM_start $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc;;
stop) LVM_stop $VOLUME
- exit $?;;
+ rc=$?
+ rmon_notify "disabled" 300
+ exit $rc;;
status) LVM_status $VOLUME $1
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
monitor) LVM_status $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
validate-all) LVM_validate_all
;;
--
2.7.4

View File

@ -1,48 +0,0 @@
From f658722ec239a258cd3ec2e828ca3f37ba2fe536 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
Date: Fri, 17 Jun 2016 00:31:20 -0400
Subject: [PATCH 1/1] Notify rmon of shutdown before shutting down LVM and
Filesystem
---
heartbeat/Filesystem | 5 +++--
heartbeat/LVM | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
index 05e4097..d5f3417 100755
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -883,9 +883,10 @@ case $OP in
validate-all) Filesystem_validate_all
exit $?
;;
- stop) Filesystem_stop
- rc=$?
+ stop)
rmon_notify "disabled" 300
+ Filesystem_stop
+ rc=$?
exit $rc
;;
esac
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 38092f9..893ece8 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -601,9 +601,10 @@ case "$1" in
fi
exit $rc;;
- stop) LVM_stop $VOLUME
- rc=$?
+ stop)
rmon_notify "disabled" 300
+ LVM_stop $VOLUME
+ rc=$?
exit $rc;;
status) LVM_status $VOLUME $1
--
2.7.4

View File

@ -104,8 +104,6 @@ destination d_openstack { file("/var/log/openstack.log" template(t_openstack));
destination d_sm { file("/var/log/sm.log"); };
# Maintenance Log destinations
destination d_rmon { file("/var/log/rmond.log" template(t_mtc)); };
destination d_rmon_notify { file("/var/log/rmond_notify.log" template(t_mtc)); };
destination d_pmon { file("/var/log/pmond.log" template(t_mtc)); };
destination d_lmon { file("/var/log/lmond.log" template(t_mtc)); };
destination d_hostwd { file("/var/log/hostwd.log" template(t_mtc)); };
@ -350,8 +348,6 @@ filter f_local6 { facility(local6); };
filter f_local7 { facility(local7); };
# Maintenance Log Filters
filter f_rmon { facility(local5) and program(rmond); };
filter f_rmon_notify { facility(local5) and program(rmon_resource_notify); };
filter f_pmon { facility(local5) and program(pmond); };
filter f_lmon { facility(local5) and program(lmond); };
filter f_hostw { facility(local5) and program(hostwd); };
@ -471,8 +467,6 @@ log { source(s_src); filter(f_local2); destination(d_openstack); };
log { source(s_src); filter(f_local3); destination(d_sm); };
# Maintenance Log Paths
log { source(s_src); filter(f_rmon); destination(d_rmon); };
log { source(s_src); filter(f_rmon_notify); destination(d_rmon_notify); };
log { source(s_src); filter(f_pmon); destination(d_pmon); };
log { source(s_src); filter(f_lmon); destination(d_lmon); };
log { source(s_src); filter(f_hostw); destination(d_hostwd); };

View File

@ -75,7 +75,7 @@ STORAGE_SERVICE_LIST=ceph-mon ceph-osd ceph-manager ceph-rest-api
RABBITMQ_QUEUE_LIST=notifications.info versioned_notifications.info
[CommonServices]
COMMON_SERVICE_LIST=dnsmasq ceilometer-polling haproxy hwmond pmond rmond fsmond sw-patch-agent sysinv-agent syslog-ng hostwd iscsid io-monitor-manager acpid hbsClient logmgmt mtcClient mtcalarmd mtclogd sshd ntpd ptp4l phc2sys smartd sm sm-eru sm-watchdog sm-api ceilometer keyring cinder-rtstool tuned polkitd lldpd IPaddr2 dnsmasq systemd-udevd systemd-journald logrotate collectd
COMMON_SERVICE_LIST=dnsmasq ceilometer-polling haproxy hwmond pmond fsmond sw-patch-agent sysinv-agent syslog-ng hostwd iscsid io-monitor-manager acpid hbsClient logmgmt mtcClient mtcalarmd mtclogd sshd ntpd ptp4l phc2sys smartd sm sm-eru sm-watchdog sm-api ceilometer keyring cinder-rtstool tuned polkitd lldpd IPaddr2 dnsmasq systemd-udevd systemd-journald logrotate collectd
[StaticServices]
STATIC_SERVICE_LIST=occtop memtop schedtop top.sh iostat.sh netstats.sh diskstats.sh memstats.sh filestats.sh ceph.sh postgres.sh rabbitmq.sh vswitch.sh

View File

@ -116,9 +116,6 @@ do
"hbsClient")
pmon_managed_processes=(${pmon_managed_processes[@]} "hbsClient:0")
;;
"rmond")
pmon_managed_processes=(${pmon_managed_processes[@]} "rmond:0")
;;
"hostwd")
pmon_managed_processes=(${pmon_managed_processes[@]} "hostwd:0")
;;