Skip to main content

Install Nagios Server Monitoring on Ubuntu


Nagios monitors your entire IT infrastructure to ensure systems, applications, services, and business processes are functioning properly. In the event of a failure, Nagios can alert technical staff of the problem, allowing them to begin remediation processes before outages affect business processes, end-users, or customers. With Nagios, you’ll never be left having to explain why an unseen infrastructure outage hurt your organization’s bottom line.

Nagios runs periodic checks on critical parameters of application, network and server resources. It can monitor, for example, memory usage, disk usage, microprocessor load, the number of currently running processes and log files. Nagios also can monitor services, such as Simple Mail Transfer Protocol (SMTP), Post Office Protocol 3 (POP3), Hypertext Transfer Protocol (HTTP) and other common network protocols. Active checks are initiated by Nagios, while passive checks come from external applications connected to the monitoring tool.


Install Nagios Server Monitoring on Ubuntu 16.04

[1] Install Apache2


 root@Pirates:~# apt-get -y install apache2

[2]Configure Apache2


Change ~ ServerTokens



 This directive configures what you return as the Server HTTP response Header. The default is 'Full' which sends information about the OS-Type and compiled in modules.

root@Pirates:~#  vi /etc/apache2/conf-enabled/security.conf

# line 25: change

ServerTokens Prod


root@Pirates:~#vi /etc/apache2/mods-enabled/dir.conf



# line 2: add file name that it can access only by directory's name
DirectoryIndex index.html index.htm



Press Esc Then save the file with :wq!

root@udhaya-raav:~# vi /etc/apache2/apache2.conf

# line 70: add to specify server name

ServerName www.nagios-pirates.com  (any name)


Press Esc Then save the file with :wq

root@Pirates:~#  vi /etc/apache2/sites-enabled/000-default.conf

# line 11: change to webmaster's email

After the changes in 000-default.conf Save the configuration.

Now restart your apache service through Terminal.
root@Pirates:~#service apache2 restart

Access to "HTTP://(your server's hostname or IP address)/" with web browser. It's OK if the following page is shown. (default page) 






















[3]Install PHP & Configuration:

Install PHP,

root@Pirates:~# apt-get  install php php-cgi libapache2-mod-php php-common php-pear php-mbstring


Configure Apache2 to use PHP scripts.

root@Pirates:~# a2enconf php7.0-cgi
root@nagios:~#  vi /etc/php/7.0/apache2/php.ini


# line 924: uncomment and add your timezone
date.timezone = "Asia/Tokyo"


PressEsc button then  type :wq

root@Pirates:~# systemctl restart apache2.service

Create a PHP test page and access to it from any clients with the web browser. It's OK if the following page is shown.

root@nagios:~# vi /var/www/html/index.php

PressEsc button then  type :wq!


TEST PAGE :



 Now it's  Hero Time.Install Nagios and plugins from Ubuntu repo.

root@Pirates:~# apt-get -y install nagios3 nagios-plugins-basic

While installing, it will ask you to configure the password.Configure your own password.


EXTERNAL COMMAND OPTION

This option allows you to specify whether or not Nagios should check for external commands (in the command file defined below)

root@nagios:~# vi /etc/nagios3/nagios.cfg

# line 145: change        
check_external_commands=1



PressEsc button then  type :wq (For saving the file after mofify)

root@nagios:~# vi /etc/nagios3/apache2.conf

# line 40: change access permission
#Allow From All
 Allow From localhost 192.168.1.0/24

Instead of 192.168.1.0/24 config. your LAN network IP/Hole Subnet.


PressEsc button then  type :wq (For saving the file after mofify)

root@nagios:~#  vi /etc/nagios3/conf.d/localhost_nagios2.cfg

# line 22: comment out and add
# all partitions are monitored by default but it's unnecessary all,
# so change to specific partition to monitor (the example below specify root partition)
#check_command check_all_disks!20%!10%
check_command check_disk!20%!10%!/


PressEsc button then  type :wq (For saving the file after mofify)

root@nagios:~# chgrp -R www-data /var/lib/nagios3
root@nagios:~# chmod 750 /var/lib/nagios3/rw
root@nagios:~# systemctl restart nagios3.service apache2.service


Access to the "http://(Nagios server's hostname or IP address)/nagios3/" from a client which is in the network allowed by Nagios server and authenticate with the Nagios admin user "nagiosadmin" and password is newly configured one during installation.




After the sucessfull login, you will see Nagios admin panel.

Click that option of Tactical Overview then it will show All the notifications.
Click Host Groups option then you can see localhost server details.


 Credits: Udhaya Raav

Comments

Popular posts from this blog

My Life as Information security engineer Chapter 1: Tools

  Hi folks, here I am going to share the tools list that I am using in my daily life cycle. NMAP  Nmap (“Network Mapper”) is a free and open-source (license) utility for network discovery and security auditing. Basically, I will use it to discover the open ports and closed ports where I did Port Mapping in firewalls. We can use this in the local network as well as in the WAN network. Also with help of the NSE script, we do multiple things like vulnerability check, exploitation, etc., Ref: http://www.piratesshield.com/2017/11/nmap-network-mapper-securtiy-scanner.html CURL and WGET curl   is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). Normally using this tool to analyze the website headers when my web security device blocking some dynamic content websites and to create the Application signature in IPS. Wget   using to download files directly instead of opening and surfing the brow

AquaSec Container Security Solution ( DevSecOps ) - A quickView

  What is AquaSec?      The Aqua Platform is the leading Cloud Native Application Protection Platform (CNAPP) and provides prevention, detection, and response automation across the entire application lifecycle to secure the supply chain, secure cloud infrastructure, and secure running workloads wherever they are deployed.    Solutions : Cloud Native Security Platform CSPM Cloud Security Container Security Kubernetes Security Serverless Security Cloud VM Security Dynamic Threat Analysis (DTA) Container Vulnerability Scanning Aquasec offers a 14days trial to learn the container security / Automated DevSecOps. Use this link to get free trail  Sign In | Aqua (aquasec.com)   How to start with AquaSec? Once login into the portal click the nine dots in the left-side top > Aqua Hub  Then click the "Integrations" The Integration page has a lot of options to connect your container Platform Choosing your platform provides the required key to integrate. (follow the OEM documents ) The

What is IP Obfuscation ? How it's working ? how to use Cuteit tool ?

  What is IP  Obfuscation?     Which is a method to hide or convert a doted format IP address  (e.g. 192.168.192.2)   into an Integer or Hexadecimal value or Octal form by using some mathematical formula. It’s a kind of method to spoof the human eyes and web security services. dot format to Decimal Conversion   piratesshield.com 👉  [172.67.129.3] to translate (172 x256 3 )+(67×256 2 )+(129×256 1 )+(3×256 0 ) =  2890105091 Now you can use  https://2890105091  to access piratesshield.com This is one of the ways to do IP  Obfuscation.  The tool  ‘ Cuteit ‘ is  A simple python tool to help you to social engineer, bypass whitelisting firewalls, potentially break regex rules for command-line logging looking for IP addresses and obfuscate cleartext strings to C2 locations within the payload. HOW TO USE CUTEIT ? Download & Install Cuteit from the below link git :   git clone https://github.com/D4Vinci/Cuteit.git Direct link: https://github.com/D4Vinci/Cuteit/archive/master.zip usage: Cu