diff --git a/tools/collector/debian-scripts/collect_ceph.sh b/tools/collector/debian-scripts/collect_ceph.sh index 1a5863ed..cb3259ac 100755 --- a/tools/collector/debian-scripts/collect_ceph.sh +++ b/tools/collector/debian-scripts/collect_ceph.sh @@ -14,15 +14,6 @@ SERVICE="ceph" LOGFILE="${extradir}/ceph.info" echo "${hostname}: Ceph Info .........: ${LOGFILE}" -function is_service_active { - active=`sm-query service management-ip | grep "enabled-active"` - if [ -z "$active" ] ; then - return 0 - else - return 1 - fi -} - function exit_if_timeout { if [ "$?" = "124" ] ; then echo "Exiting due to ceph command timeout" >> ${LOGFILE} @@ -59,7 +50,7 @@ if [ "$nodetype" = "controller" ] ; then timeout 30 ceph osd crush dump >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG} exit_if_timeout - is_service_active + is_active_controller if [ "$?" = "0" ] ; then exit 0 fi diff --git a/tools/collector/debian-scripts/collect_dc.sh b/tools/collector/debian-scripts/collect_dc.sh index 8da44e9a..6f3ed4bb 100755 --- a/tools/collector/debian-scripts/collect_dc.sh +++ b/tools/collector/debian-scripts/collect_dc.sh @@ -13,15 +13,6 @@ source /usr/local/sbin/collect_utils SERVICE="distributed_cloud" LOGFILE="${extradir}/${SERVICE}.info" -function is_active_controller { - active_controller=`sm-query service management-ip | grep "enabled-active"` - if [ -z "$active_controller" ] ; then - return 0 - else - return 1 - fi -} - function is_distributed_cloud_env { distributed_cloud=`sm-query service-group distributed-cloud-services | grep "active"` if [ -z "$distributed_cloud" ] ; then diff --git a/tools/collector/debian-scripts/collect_fm.sh b/tools/collector/debian-scripts/collect_fm.sh index 6f9e45e2..4aeac17d 100644 --- a/tools/collector/debian-scripts/collect_fm.sh +++ b/tools/collector/debian-scripts/collect_fm.sh @@ -12,21 +12,12 @@ source /usr/local/sbin/collect_utils SERVICE="alarms" LOGFILE="${extradir}/${SERVICE}.info" -function is_service_active { - active=`sm-query service management-ip | grep "enabled-active"` - if [ -z "$active" ] ; then - return 0 - else - return 1 - fi -} - ############################################################################### # Only Controller ############################################################################### if [ "$nodetype" = "controller" ] ; then - is_service_active + is_active_controller if [ "$?" = "0" ] ; then exit 0 fi diff --git a/tools/collector/debian-scripts/collect_sysinv.sh b/tools/collector/debian-scripts/collect_sysinv.sh index 52e5e6f9..7966fe2e 100755 --- a/tools/collector/debian-scripts/collect_sysinv.sh +++ b/tools/collector/debian-scripts/collect_sysinv.sh @@ -14,17 +14,8 @@ SERVICE="inventory" LOGFILE="${extradir}/${SERVICE}.info" INVENTORY=${4} -function is_service_active { - active=`sm-query service management-ip | grep "enabled-active"` - if [ -z "$active" ] ; then - return 0 - else - return 1 - fi -} - function collect_inventory { - is_service_active + is_active_controller if [ "$?" = "0" ] ; then exit 0 fi diff --git a/tools/collector/debian-scripts/collect_utils b/tools/collector/debian-scripts/collect_utils index bc41ce04..cdec5d47 100755 --- a/tools/collector/debian-scripts/collect_utils +++ b/tools/collector/debian-scripts/collect_utils @@ -111,6 +111,16 @@ HOST_COLLECT_ERROR_LOG="/tmp/host_collect_error.log" DCROLE_SYSTEMCONTROLLER="systemcontroller" DCROLE_SUBCLOUD="subcloud" +function is_active_controller +{ + active=`sm-query service-group controller-services | grep "controller-services active"` + if [ -z "$active" ] ; then + return 0 + else + return 1 + fi +} + function source_openrc_if_needed { # get the node and subfunction types