Last night, I have updated a good script to automate the installation of nagios in few steps. Using this script, you are able to install Nagios 4.0.8 and nagios plugins 2.0.3 with just single command.
1 – First download the Nagios script from this link.
2 – Extract the file to your home directory.
3 – cd the directory where you extracted the script and run the following command:
[root@mel-centos7 ~]# chmod 777 Nagios-auto.sh
4 – Now run script under root.
[root@mel-centos7 ~]# ./Nagios-auto.sh
#############################################################
#############################################################
## ##
## Welcome to Nagios Auto Installation Script ##
## Written By Yogesh Panchal ##
## Edited By Pirat9 from Unixmen Admin ##
#############################################################
#############################################################
Hi Nagios Installation Requires
***** Apache *****
***** PHP *****
***** GCC compiler *****
***** GD development libraries *****
First Install Above Pre-requesites Then continue with this script
or You will face problems with nagios installation.
You can Install Prerequisites using following commands
To install Apache >>> yum install httpd
To install PHP >>> yum install php
To install GCC compiler >>> yum install gcc glibc glibc-common
To install GD development libraries >>> yum install gd gd-devel
If You have already installed Prerequisites ignore above warning & continue with this script...!
If you have no time. let me do this command for you : yum -y install httpd php gcc glibc glibc-common gd gd-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.transip.nl
* epel: epel.mirror.nucleus.be
* extras: mirror2.bbln.org
* updates: mirror2.bbln.org
Package httpd-2.4.6-18.el7.centos.x86_64 already installed and latest version
Package php-5.4.16-23.el7_0.x86_64 already installed and latest version
Package gcc-4.8.2-16.2.el7_0.x86_64 already installed and latest version
Package glibc-2.17-55.el7_0.1.x86_64 already installed and latest version
Package glibc-common-2.17-55.el7_0.1.x86_64 already installed and latest version
Package gd-2.0.35-26.el7.x86_64 already installed and latest version
Package gd-devel-2.0.35-26.el7.x86_64 already installed and latest version
Nothing to do
Do You Want to continue with this script? [ y/n ]
i have tested this script under my centos 7 and its working fine.
[출처] https://www.unixmen.com/nagios-auto-install-script-fedora-1920-centos-67/
[오류시 참조] http://blog.naver.com/ssass0404/220152825522