| Server IP : 198.38.94.67 / Your IP : 216.73.217.142 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/lib64/nagios/plugins/ |
Upload File : |
#!/bin/bash
# Ref - SYSENG-21578 - add backup network IP to cPanel Reserved IP list if not exists already
# - alert if an SRT has less than 2 dedicated IPs available
#
local_ip=$(ifconfig | grep "inet 10\." | awk '{print $2}')
reserved_ips="/etc/reservedips"
available_ips=$(wc -l < /etc/ipaddrpool)
minimum_ips="2"
# if local IP 10. exists, reserve it and rebuild ip pool
reserve_private_ip() {
if [ -n "${local_ip}" ]; then
if ! grep -q "${local_ip}" "${reserved_ips}"; then
echo "Adding ${local_ip} and rebuilding ip pool"
echo "${local_ip}" >> "${reserved_ips}"
/scripts/rebuildippool
fi
fi
}
reserve_private_ip >> /var/log/check_extra_ips.log
if [ "${available_ips}" -lt "${minimum_ips}" ]; then
echo "this server has ${available_ips} dedicated ip(s) available, please add /28 ips"
exit 1
fi