Moogsoft Docs

Uninstall Moogsoft AIOps

Follow the instructions in this topic if you need to uninstall Moogsoft AIOps and its supporting packages.

Be sure to backup any files that you may need again for another installation.

Stop Core Moogsoft AIOps and Supporting Services

1. Stop all core Moogsoft AIOps services:

service moogfarmd stop
service logfilelamd stop
service restlamd stop
service socketlamd stop
service trapdlamd stop

2. Stop any additional moog_farmd or lam instances running as services.

service <service name> stop

3. As a precaution, forcibly kill any remaining core Moogsoft AIOps processes:

kill -9 $(ps -ef|grep java|grep lam|awk '{print $2}') 2>/dev/null
kill -9 $(ps -ef|grep java|grep moog_farmd|awk '{print $2}') 2>/dev/null

4. Stop all supporting services:

service nginx stop
service elasticsearch stop
service apache-tomcat stop
service mysqld stop
service rabbitmq-server stop
Uninstall Core Moogsoft AIOps Packages and Remove Directories and Users

1. Uninstall Core Moogsoft AIOps Packages

yum remove $(rpm -qa|grep moogsoft)

If the above command produces errors such as 'Error in PREUN scriptlet' then the following command can be run to bypass script errors:

yum -y --setopt=tsflags=noscripts remove $(rpm -qa|grep moogsoft)

2. Remove Core Moogsoft AIOps Directories

rm -rf /usr/share/moogsoft
rm -rf /var/lib/moogsoft
rm -rf /var/log/moogsoft
rm -rf /var/run/moogsoft

3. Remove any Moogsoft crontab entries with this command:

crontab -l | egrep -v "moog|JAVA_HOME" | crontab -

4. Remove Moogsoft system users (and their home directories):

userdel -r moogsoft
userdel -r moogadmin
userdel -r moogtoolrunner
groupdel moogsoft
Uninstall Supporting Applications

Follow these steps to remove the supporting applications Apache-Tomcat, ElasticSearch, MySQL, Nginx and RabbitMQ.

Uninstalling Apache Tomcat

Note

Assumption: The Apache Tomcat service has already been stopped as per previous instructions above

To uninstall Apache Tomcat remove the installation directories and the service script:

Note

Please note: Apache Tomcat is not actually installed as an rpm package but is deployed as a tarball (via the moog_init_ui.sh script).

rm -rf /usr/share/apache-tomcat
rm -rf /var/run/apache-tomcat
rm -f /etc/init.d/apache-tomcat

To remove the tomcat system user and its home directory:

userdel -r tomcat
Uninstalling Elasticsearch

Note

Assumption: The Elasticsearch service has already been stopped as per previous instructions above.

To remove the Elasticsearch package:

yum remove elasticsearch

To remove related directories run the following commands:

rm -rf /usr/share/elasticsearch
rm -rf /var/lib/elasticsearch
Uninstalling MySQL

Note

Assumption: The mysqld service has already been stopped as per previous instructions above.

Remove the MySQL community packages with the following command:

yum remove $(rpm -qa|grep mysql)

To remove the related directories:

rm -rf /usr/share/mysql
rm -rf /var/lib/mysql

To remove the MySQL system user and its home directory and group:

userdel -r mysql
Uninstalling Nginx

Note

Assumption: The Nginx service has already been stopped as per previous instructions above.

Remove the nginx and supporting packages with the following command:

yum remove nginx

To remove related directories:

rm -rf /etc/nginx
rm -rf /usr/lib64/nginx
rm -rf /usr/share/nginx
rm -rf /var/log/nginx
rm -rf /var/lib/nginx

To remove the Nginx system user and its home directory and group:

userdel -r nginx
Uninstalling RabbitMQ

Note

Assumption: RabbitMQ server service has already been stopped as per previous instructions above.

Remove the rabbitmq-server package with the following command:

yum remove rabbitmq-server

To remove related directories:

rm -rf /etc/rabbitmq
rm -rf /usr/lib/ocf/resource.d/rabbitmq
rm -rf /var/log/rabbitmq
rm -rf /var/lib/rabbitmq

To stop the erlang epmd daemon:

epmd -kill

Note

Please note: The above command may not be necessary on EL7 installs.

To remove the RabbitMQ system user and its home directory and group:

userdel -r rabbitmq
Uninstall Remaining Packages and Remove Yum Repositories

Optionally, follow these steps to remove the remaining packages that are typically added during a Moogsoft AIOps installation and clean up the Yum repositories:

Remove remaining packages:

Warning

Important: Note that the below list of packages is based on reverting back to a "minimal" installation of CentOS 6.9 and will vary with different versions of Linux and installation level.

Care should be taken not to remove packages that impact other important applications that may be installed on the server.

Review carefully the yum summary before proceeding with the removal - specifically any other packages listed in the "Removing for dependencies:" output.

In the list of removal packages below, the libX* and perl* packages may typically impact other applications.

To remove the remaining packages, run these commands:

yum remove GeoIP GeoIP-GeoLite-data GeoIP-GeoLite-data-extra \
apr compat-readline5 erlang fontconfig freetype gd geoipupdate jdk1.8.0_121 \
libX11 libX11-common libXau libXpm libgfortran libjpeg-turbo libkqueue libpng libxcb libxslt \
nginx-filesystem \
perl perl-DBI perl-Module-Pluggable perl-Pod-Escapes perl-Pod-Simple perl-libs perl-version \
socat tomcat-native
Remove Yum Repositories:

Remove EPEL Yum Repository:

yum remove epel-release
rm -f /etc/yum.repos.d/epel*

Remove MySQL Community Yum Repository:

yum remove mysql-community-release
rm -f /etc/yum.repos.d/mysql*

Remove remaining Yum Repositories:

rm -f /etc/yum.repos.d/elasticsearch.repo
rm -f /etc/yum.repos.d/moog.repo
rm -f /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo