diff --git a/assets/default.nginxconf b/assets/default.nginxconf index 25a8745..0749fb3 100644 --- a/assets/default.nginxconf +++ b/assets/default.nginxconf @@ -80,7 +80,7 @@ server { stub_status on; access_log off; allow 127.0.0.1; - # allow ZABBIX-SERVER-IP; + # allow CURRENT-SERVER-IP; deny all; } } diff --git a/bin/zabbix.sh b/bin/zabbix.sh index 4675682..4b5a359 100755 --- a/bin/zabbix.sh +++ b/bin/zabbix.sh @@ -34,6 +34,8 @@ apt-get update -y apt-get install zabbix-agent -y # configure +echo -n "Please provide the current server's public ip : " +read _cur_ip echo -n "Please provide the zabbix-server's ip : " read _ip echo -n "Please provide the hostname of this agent : " @@ -78,7 +80,7 @@ cp "$_assets"/zabbix/userparameter_mysql.conf "$_agent_conf_d"/ # NGINX # https://github.com/sfuerte/zbx-nginx # nginxconf already included in default.nginxconf asset -sed -i "s/# allow ZABBIX-SERVER-IP/allow $_ip/g" /etc/nginx/sites-available/default +sed -i "s/# allow CURRENT-SERVER-IP/allow $_cur_ip/g" /etc/nginx/sites-available/default cp "$_assets"/zabbix/userparameter_nginx.conf "$_agent_conf_d"/ mkdir /etc/zabbix/zabbix_agentd.scripts cp "$_assets"/zabbix/scripts/nginx-stat.py /etc/zabbix/zabbix_agentd.scripts/