Detecteert installaties van Apache HTTP-server (voor Linux). Deze detectie test de computer met een script om installaties van Apache HTTP-server te herkennen.
Knowledge Base article:
Samenvatting
Deze detectieregel detecteert installaties met Apache HTTP-server voor Linux-servers. Een exemplaar van een Apache HTTP-server wordt pas bewaakt als de CIM-provider voor de Apache-bewaking is geïnstalleerd. Deze module kan worden geïnstalleerd vanaf de Operations-console met de taak Apache CIM-module installeren/upgraden.
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