Конфигурирование Nagios для мониторинга хостов (Автоматизация)
new_host.sh
./newhost server1.busycorp.com
./newhost 192.168.1.1 server1.busycorp.com
./newhost 192.168.1.1 server1.busycorp.com server1
./newhost 192.168.1.1 server1.busycorp.com server1 linux-servers
cat servers
10.10.50.1 server1.busycorp.com
10.10.50.2 server2.busycorp.com
10.10.50.3 server3.busycorp.com
10.10.50.4 server4.busycorp.com
10.10.50.5 server5.busycorp.com
10.10.50.6 server6.busycorp.com
10.10.50.7 server7.busycorp.com
10.10.50.8 server8.busycorp.com
10.10.50.9 server9.busycorp.com
10.10.50.10 server10.busycorp.com
cat servers |
while read i; do ./newhost %i; done |
# ./newhost server2.busycorp.com
# ./newhost server2.busycorp.com >> /etc/nagios/objects/hosts.cfg
# tail /etc/nagios/objects.cfg
# source npasswd
# setTemplate server2.busycorp.com dnsservers
# tail /etc/nagios/objects.cfg
# joinGroup server2.busycorp.com mailservers
# ls /etc/nagios/objects/
# less /etc/nagios/objects/hostgroups.cfg