Current File : //opt/zabbix/scripts/cpanel/check_dnsdown.sh
#!/bin/bash
#Script to check if there are failed DNS Cluster server connections

valor=$(ls -la /var/cpanel/clusterqueue/status | grep down | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | wc -l)

if [ $valor != "0" ];
then
  zabbix=1
else
  zabbix=0
fi

if [ -z $zabbix ]; then
zabbix=1
echo $zabbix
else
echo $zabbix
fi