How To Hide User Input In The Bash Script

Usually, if we create a bash script to ask the user for input we use the command called read. The command will display input from user to terminal so a user can read it in the monitor. What about if we want to create a bash script to ask the user to input the password? It is very dangerous if someone sees the password when the user types it. The example we create a bash script to display all database in MySQL or MariaDB:
Continue reading

Install NConf To Manage Hosts In Nagios Via Web-Based

In the previous article, we explained about adding hosts to Nagios using NRPE agent or not. But maybe it is very hard and confuses too many users because we must add hosts using the command line. This time, we will add hosts using NConf, the application to manage hosts to Nagios via web-based. The application was built using PHP and Perl by Fabian Gander, Angelo Gargiulo, and Bernhard Waldvogel and release latest stable version on 2011 and as of this writing, no more releases since version 1.3.0 is released until now.
Continue reading

How To Add Windows Host To Nagios Using NSClient++

In the previous article, we already explain how to add Linux host to Nagios. Now, the article will explain how to add Windows host to Nagios. If we want to add Windows host to Nagios, we must install NSClient++ agent in windows host. You can download the agent in SourceForge site and choose whether using 32 bit or 64 bit based on your Windows architecture. I use IP 192.168.56.101 for Nagios Server, IP 192.168.56.103 for Windows host and 64 bit 0.4.1.90 version of NSClient++ for this article.
Continue reading

How To Add Linux Host To Nagios Using NRPE Plugin

In the previous article, we already explain how to add Linux host to Nagios but we do not use Nagios plugin to do that. Now, we want to add Linux host to Nagios using Nagios plugin called NRPE or Nagios Remote Plugin Executor. NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines and monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with some of the Windows agent add-ons, so you can execute scripts and check metrics on remote Windows machines as well. In this article, we want to add Linux centOS 7 to Nagios with IP 192.168.56.102 using NRPE and IP Nagios Server is 192.168.56.101. Please disable SELinux and IPTables on each server.
Continue reading

How To Move Full Folder On The Partition / To The New Hard Disk

Sometimes when I install Linux, I do not do the partition configuration on Linux so that my Linux only has one partition that is partition /. This will cause problems if one folder commonly used by the system such as /var or /usr folder size is getting larger so the server cannot run normally due to partition / lack of space. Therefore, this article will explain how to move the full folder that resides on the partition / to the new hard disk. This article uses CentOS 7 and it should be applicable to another Linux.
Continue reading

How to Access Linux Server Without Password Using SSH

By default, if we want to access the Linux server using ssh then we have to enter the username and password of the server. But it is very inconvenient for a sysadmin if always write a password when want to access the Linux server using ssh. So, this article will explain how to access Linux server using ssh without using a password. I use CentOS 7 and should this article be applicable to OS other than CentOS.
Continue reading

How to Display Email Subject in Sendmail Log on CentOS 7

Sendmail is a default mail server in some Linux distro like CentOS that is often used by system administrators to email and its use is easy. Unfortunately, by default sendmail log (in /var/log/maillog) do not display the subject, so sysadmins will have difficulties if they have to search for an email based on the title in the log. This article will explain how to display titles in the log in CentOS 7.
Continue reading

Protect SSH Servers Using DenyHosts on CentOS 7

One way to improve ssh server security is by blocking IPs that often try to access the server. We can do it by install denyhosts application made by Phil Schwartz from python script. The application analyzes the messages in ssh log to determine which IP hosts are trying to access into our system. This article will explain how to install denyHosts on CentOS 7. We first install EPEL repository for CentOS 7 then we do the install by:
Continue reading