yum update -y sudo yum install httpd sudo service httpd start ifconfig eth0 | grep inet | awk '{ print $2 }'
yum install wget -y wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm md5sum mysql57-community-release-el7-9.noarch.rpm sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
sudo grep 'temporary password' /var/log/mysqld.log
sudo /usr/bin/mysql_secure_installation Enter current password for root (enter for none): OK, successfully used password, moving on...
By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL!
sudo yum install php php-mysql sudo service mysqld start sudo chkconfig httpd on sudo chkconfig mysqld on
sudo vi /var/www/html/info.php
sudo service httpd restart
sudo yum install gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd unzip
sudo useradd nagios sudo groupadd nagcmd sudo usermod -a -G nagcmd nagios
cd ~ curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
tar xvf nagios-*.tar.gz cd nagios-* ./configure --with-command-group=nagcmd
make all sudo make install sudo make install-commandmode sudo make install-init sudo make install-config sudo make install-webconf
sudo usermod -G nagcmd apache cd ~ curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz tar xvf nagios-plugins-*.tar.gz cd nagios-plugins-* ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make sudo make install cd ~ curl -L -O http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz tar xvf nrpe-*.tar.gz cd nrpe-* ./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all sudo make install sudo make install-xinetd sudo make install-daemon-config
sudo vi /etc/xinetd.d/nrpe
only_from = 127.0.0.1 10.128.0.2
:wq sudo service xinetd restart
sudo vi /usr/local/nagios/etc/nagios.cfg Now find an uncomment this line by deleting the #: #cfg_dir=/usr/local/nagios/etc/servers Save and exit. :wq
sudo mkdir /usr/local/nagios/etc/servers
sudo vi /usr/local/nagios/etc/objects/contacts.cfg email youremailid@company.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ****** Save and exit. :wq
sudo vi /usr/local/nagios/etc/objects/commands.cfg Add the following to the end of the file: define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } Save and exit. :wq
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin Enter a password at the prompt. Remember this login, as you will need it to access the Nagios web interface.
sudo systemctl daemon-reload sudo systemctl start nagios.service sudo systemctl restart httpd.service sudo chkconfig nagios on
http://nagios_server_public_ip/nagios