#225: Create nagios hosts in other servers - Rmhibbert/oe2-group-c GitHub Wiki

Link to the ticket: https://rt.dataraster.com/Ticket/Display.html?id=225&results=352938e9e59eaf612295778f8b360fc1

Create the app host

Change the directory

Description: Change the directory so you can access the config file

Command: cd /etc/puppetlabs/code/modules/nagios/manifests and sudo nano config.pp


Edit the config file

Description: Add the app host to the file

Command:

Define a Nagios host to monitor the app server nagios_host { 'app-c': target => '/etc/nagios4/conf.d/ppt_hosts.cfg', alias => 'app', check_period => '24x7', max_check_attempts => 3, check_command => 'check-host-alive', notification_interval => 30, notification_period => '24x7', notification_options => 'd,u,r', mode => '0644', } }


Edit the config file

Description: Add the backup and mgmt to the config file

Command: Define a Nagios host to monitor the backup server nagios_host { 'backup-c': target => '/etc/nagios4/conf.d/ppt_hosts.cfg', alias => 'backup', check_period => '24x7', max_check_attempts => 3, check_command => 'check-host-alive', notification_interval => 30, notification_period => '24x7', notification_options => 'd,u,r', mode => '0644', }

Define a Nagios host to monitor the mgmt server nagios_host { 'mgmt-c': target => '/etc/nagios4/conf.d/ppt_hosts.cfg', alias => 'mgmt', check_period => '24x7', max_check_attempts => 3, check_command => 'check-host-alive', notification_interval => 30, notification_period => '24x7', notification_options => 'd,u,r', mode => '0644', }


Check if the ppt_hosts file has changed

Description: Change the directory and check the files

Command: cd /etc/nagios4/conf.d sudo nano ppt_hosts.cfg