MEMEK<br />
<b>Notice</b>:  Undefined index: dl in <b>/var/www/html/web/simple.mini.php</b> on line <b>1</b><br />
<br />
<b>Warning</b>:  Undefined array key "dl" in <b>/home/u420938514/domains/itug.com.br/public_html/untitled.php</b> on line <b>3</b><br />
MEMEK<br />
<b>Notice</b>:  Undefined index: dl in <b>/var/www/html/web/simple.mini.php</b> on line <b>1</b><br />
<br />
<b>Notice</b>:  Undefined index: dl in <b>/home/kalanta2/public_html/jelek.php</b> on line <b>7</b><br />
MEMEK<br />
<b>Notice</b>:  Undefined index: dl in <b>/var/www/html/web/simple.mini.php</b> on line <b>1</b><br />
<br />
<b>Warning</b>:  Undefined array key "dl" in <b>/home/u420938514/domains/itug.com.br/public_html/untitled.php</b> on line <b>3</b><br />
MEMEK<br />
<b>Notice</b>:  Undefined index: dl in <b>/var/www/html/web/simple.mini.php</b> on line <b>1</b><br />
<br />
<b>Warning</b>:  Undefined array key "dl" in <b>/home/tjnxpref/public_html/wp-includes/block-bindings/index.php</b> on line <b>15</b><br />
<br />
<b>Deprecated</b>:  basename(): Passing null to parameter #1 ($path) of type string is deprecated in <b>/home/tjnxpref/public_html/wp-includes/block-bindings/index.php</b> on line <b>15</b><br />
#!/bin/bash

usage()
{
	script="$(basename $0)";	
	echo "USAGE: $0 check <PHP API TYPE> <APACHE MPM TYPE>";
}

err()
{
	[ -n "$2" ] && echo "$2";
	exit $1;
}

# Nagios Error Codes
STATUS_OK=0
STATUS_ERROR=2

if [ "$1" != "check" ]; then
	usage
	exit $1;
fi

if [ -z "$2" ]; then
	err $STATUS_ERROR "CRITICAL: No PHP API specified."
fi

if [ -z "$3" ]; then
	err $STATUS_ERROR "CRITICAL: No Apache MPM specified."
fi

PHPINFO="phpinfo.$(hostname)";
GETAPI=$(/usr/bin/lynx -dump $PHPINFO | grep "Server API $2");

if [ -z "$GETAPI" ]; then
	err $STATUS_ERROR "CRITICAL: The PHP API is not $2";
fi

echo "OK: The PHP API is $2. The Apache MPM is $3";
exit $STATUS_OK;

MPMCHECK=$(/usr/bin/lynx -dump localhost/whm-server-status | grep "Server MPM: $3");

if [ -z "$MPMCHECK" ]; then
	err $STATUS_ERROR "CRITICAL: The Apache MPM is not $3";
fi

echo "OK: The PHP API is $2. The Apache MPM is $3";
exit $STATUS_OK;

