# Function to install_nagios
Install_nagios (){
Useradd nagios-s/sbin/nologin
Cd $ install_dir
Tar zxf restart nagios_version.tar.gz
Cd $ NAGIOS_VERSION
$ NAGIOS_COMPILE_COMMAND
Sleep 2
Make all
Make install
Make install-init
Make install-commandmode
Make install-config
Sleep 2
Cd ..
Rm-rf $ NAGIOS_VERSION
Echo "nagios install is OK"
Sleep 3
}
# Function to Install_nagios-plugins
Install_plugins (){
Cd $ install_dir
Tar zxf zookeeper nagios_plugins_version#.tar.gz
Cd $ {NAGIOS_PLUGINS_VERSION}
$ NAGIOS_PLUGINS_COMPILE_COMMAND
Sleep 2
Make; make install
Sleep 2
Cd ..
Rm-rf $ {NAGIOS_PLUGINS_VERSION}
Echo "nagios-plugins install is OK"
Sleep 3
}
# Function to install nrpe
Function Install_nrpe (){
Cd $ install_dir
Tar zxf restart nrpe_version.tar.gz
Cd $ NRPE_VERSION
$ NRPE_COMPILE_COMMAND
Sleep 2
Make all & make install
Sleep 2
Cp $ NRPE_PREFIX/libexec/check_nrpe $ NAGIOS_PREFIX/libexec/
Cp $ NAGIOS_PREFIX/libexec/{check_disk, check_load, check_ping, check_procs} $ NRPE_PREFIX/libexec/
Mkdir $ NRPE_PREFIX/etc
Cp $ install_dir/$ NRPE_VERSION/sample-config/nrpe. cfg $ NRPE_PREFIX/etc/
Chown-R nagios. nagios $ NRPE_PREFIX/libexec
Chown-R nagios. nagios $ NRPE_PREFIX/etc
Chown-R nagios. nagios $ NAGIOS_PREFIX/libexec
Chown-R nagios. nagios $ NAGIOS_PREFIX/etc
Cd ..
Rm-rf $ NRPE_VERSION
Echo "nrpe install is OK"
Sleep 3
}
# Function to install fetion
Install_fetion (){
Cd $ install_dir/fetion
Mkdir-p $ NAGIOS_PREFIX/libexec/sms
Cp libACE * libcrypto * libssl * fetion $ NAGIOS_PREFIX/libexec/sms
Echo "fetion install is OK"
Sleep 3
}
# Function to create web auth user
Function Auth_user (){
Chown-R nagios. nagios $ NAGIOS_PREFIX/etc
Clear
Read-p "Please enter web author:" AUTH_USER
$ APACHE_PREFIX/bin/htpasswd-c $ NAGIOS_PREFIX/etc/htpasswd $ AUTH_USER
Cat <
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service