CHips L MINI SHELL

CHips L pro

Current Path : /proc/3/task/3/cwd/proc/3/root/opt/zabbix_scripts/
Upload File :
Current File : //proc/3/task/3/cwd/proc/3/root/opt/zabbix_scripts/stats_phpVersionCount.sh

#!/bin/bash
#########################################################################
#                                                                       #
# Plugin name:  stats_phpVersionCount                                   #
# Description:  Count number of sites using a given vesion of PHP.      #
# Author:       William Overko                                          #
# Version:      20191024                                                #
#                                                                       #
#########################################################################

if [ ! -e /usr/sbin/whmapi1  ]
then
    exit
fi

phpVersion=`echo $1 | sed 's/\.//'`

phpVersionCount=`/usr/sbin/whmapi1 php_get_vhost_versions | grep -E 'version: ea-php'${phpVersion} | cut -d: -f2 | cut -d' ' -f2 | wc -l`
phpVersionRPMCount=`/bin/rpm -qa | grep -i ea-php${phpVersion} | wc -l`

if [ ${phpVersionRPMCount} == 0 ]
then
    phpVersionCount="x"
fi

echo $phpVersionCount

Copyright 2K16 - 2K18 Indonesian Hacker Rulez