Discovers installations of Apache HTTP Server (for Linux). This discovery probes the computer with a script to identify installations of Apache HTTP Server.
Knowledge Base article:
Summary
This discovery rule discovers installations of Apache HTTP Server for Linux servers. An Apache HTTP Server instance is not monitored until the Apache monitoring CIM provider is installed. This module can be installed from the Operations Console with the "Install/Upgrade Apache CIM Module" task.
if [ $isrpm -eq 1 ]
then
pkgname=""
pkgFullName=""
version=""
vendor=""
if [ `rpm -q httpd |grep httpd- |wc -l` -eq 1 ]
then
pkgname="httpd"
fi
if [ `rpm -q apache2 |grep apache2-| wc -l` -eq 1 ]
then
pkgname="apache2"
fi
if [ -n "${pkgname}" ]
then
pkgFullName=`rpm -qi $pkgname |grep Name |head -n 1|awk '{print $3}'`
conffile=`rpm -ql $pkgname |grep etc |grep -e 'httpd\.conf$'`
printf "name=$pkgFullName,conffile=$conffile"
fi
fi
if [ $isdpkg -eq 1 ]
then
if [ `dpkg -l apache2 |grep -e '^ii' |wc -l` -eq 1 ]
then
pkgFullName=`dpkg --status apache2 |grep Package |awk '{print $2}'`
conffile="/etc/apache2/apache2.conf"
printf "name=$pkgFullName,conffile=$conffile"
fi
fi
#Check source
if [ -e "/usr/local/apache2/conf/httpd.conf" ]
then
pkgFullName=""
conffile="/usr/local/apache2/conf/httpd.conf"
printf "name=$pkgFullName,conffile=$conffile"
fi