Introduction, |
|
Installation, |
|
|
|
|
|
Introduction:
- It is an open source monitoring software like cloudwatch in AWS.
Installation: Nagios_server or Local Host
- Create an AWS ubuntu instance: Nagios_server
- security group open the following ports:
- Custom TCP 0-65535 Anywhere
- HTTP 80 Anywhere
- Open ICMP V4 echoReply Anywhere
- #sudo apt-get update
- #sudo apt-get install nagios3- popup will appear, select following
- postfix configuration: use tab and ok
- general type of mail configuration: internet site: ok
- system mail name: nagios_server: ok
- Nagios web administration password: India123
- To check nagios is installed: copy AWS instance public DNS & paste in browser: ec2-3-9-174-109.eu-west-2.compute.amazonaws.com/nagios3
- Default username: nagiosadmin, password: India123 (during installation)
- in nagios3 dashboard, select services: it will display current network status of nagios_server or local host.
Add Remote servers to Nagios3:
- To add any remote server to which perform monitoring through nagios server.
- #sudo vi /etc/nagios3/nagios.cfg
- check_external_command=1 (in Line 145 change 0 to 1, save & Exit)
- #sudo vi /etc/group
- add nagios:x:118:www.data (in line58, save & Exit)
- #sudo chmod g+w /var/lib/nagios3/rw
- #sudo chmod g+w /var/lib/nagios3
- #sudo service apache2 restart
- #sudo service nagios3 restart
- create a new config file for each remote servers.
- #sudo vi /etc/nagios3/conf.d/ #ls (display all .cfg files)
- create a new file for remote server (nagios_remote_server1) for more details: https://www.theurbanpenguin.com/nagios-defining-a-new-host/
- #sudo vi nagios_remote_server1.cfg
- copy and paste the following. and change the host_name , alias , address ( private_ip )
-
define host { host_name ec2-3-8-137-244.eu-west-2.compute.amazonaws.comec2-3-8-137-244.eu-west-2.compute.amazonaws.com alias store nagios_remote_server1 address max_check_attempts 3 check_period 24x7 check_command check-host-alive contacts root notification_interval 60 notification_period 24x7 } |
- Restart nagios3
$ sudo /etc/init.d/nagios3 restart
- Go to nagios home page and refresh
select host groups
We can see the new host.