How To Monitor Linux and Windows Server And Network Using Nagios

This is a user contributed tutorial.

Nagios is free, open source host, service and network monitoring services. Nagios provides an extensible framework, that can monitor pretty much anything using plugins. Some of the items that can be monitored using Nagios plugins are listed below.

=> Disk space usage of remote Linux and Windows server
=> CPU Usage
=> Memory usage
=> Hardware Temperature
=> VPN tunnels
=> Router and Switches
=> Databases
=> Network services (DHCP, DNS, LDAP, SMTP etc.)

Nagios Configurations are very granular and managed using following three different category of configuration files:

  • Nagios server and web console configuration files can be used to configure the Nagios server itself. For e.g. Use the nagios.cfg and cgi.cfg
  • Resource files can be used to store user defined macros and sensitive configuration informations such as passwords.
  • Object definition configuration files are used to store information about the hosts, services, commands, contacts, notification period etc.

Nagios has a web front end to display the status. Apart from getting the notification about the hosts and service status through email, SMS etc., you can also see the hosts, services, status through nagios web front end. You can project is on the NOC (Network Operation Center) to view the current status of your whole data center. You can also perform few actions on the web console such as disable and enable notification for a specific service. If you have defined the relationship between your hosts properly in the nagios configuration files, you can use the 3D display view to see a graphical representation of the whole data center visually. This also provides reporting feature where you can view the historic data such as availability of a particular service on a specific host over a period of time.

(Fig. 01 – Nagios web UI displaying status of various services on a Linux host)

Notification process on the Nagios is defined at a very granular level that it covers a wide range of possible scenarios on the notification including escalation process where a specific contact group can be notified if an issues has not been fixed after certain number of initial notifications. This is very helpful to automatically notify the management team about a critical service that was not fixed immediately.

Nagios can also be configured in a distributed setup, where datacenters from different parts of the world can be monitored using local nagios server that can report the status back to a central nagios server. This is achieved by NSCA (Nagios Service Check Acceptor) sending monitoring results from the local nagios server to the central server.

Following articles from The Geek Stuff blog, explains about everything that is required to get a jumpstart on the Nagios installation, configuration on Linux. This also explains about how to monitor Linux and Windows host.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • CHRIS Oct 9, 2009 @ 4:18


  • Me Nov 27, 2009 @ 14:16

    If you aren’t into unix machines I wouldn’t recommend using this. You will have lots frustrations and end up with nothing.

  • anurag sharma May 27, 2010 @ 21:05

    Dear kindly add some advance topics like monitoring mysql with all details and also like monitoring jboss, tomcat from nagios and other services which are in normal use.bcoz nagios installtion and configuration help is available on many sites but other services like mysql its is very confusing on net.
    kindly add some topics regarding this in your great blog


    • karthik Jun 13, 2011 @ 6:34

      for my sql u can ndo utils and monitor it

  • Atul Khachane Sep 18, 2011 @ 19:28

    Any information how to configure distributed nagios with GUI?

    e.g. lets assume there are 2 (1 in america + 1 in europe) servers with nagios installed on them and 100′s (same) of host(all services such as HTTP, ICMP,etc…) are configured on these 2 nagios servers

    Now, can we install distributed nagios on any other 3rd server and manage all hosts configured under above 2 nagios and monitor them from single nagios for both above different continents?

    How about op5′s merlin, ninja, etc….. ?

    Thank you.

  • Iyyappan V Oct 13, 2011 @ 10:38

    I have configured nagios to monitor one linux and one windows .how to configure for 100 hosts in windows cfg…i have 100 users n another 48 servers running locally..

  • Iyyappan V Oct 13, 2011 @ 11:03

    I have configured nagios to monitor one linux and one windows .how to configure for 100 hosts in windows cfg…i have 100 users n another 48 servers running locally.. should i add host separately for 148 users and add service accordingly . then windows.cfg will be fully loaded right….kindly help….

  • Syed Jeelan Aug 28, 2012 @ 10:44

    By default nagios monitors few services, if we want to monitor services like mysqld,vsftpd,smbd. How can we configure for additional services
    It will be helpful if you completely show for any one service (mysqld) .
    And for alerts, is it possible to set sound alerts apart sending mail or sms.

  • Satyam Sundar panda Nov 18, 2015 @ 11:09

    Any one know about How Nagios Monitoring in real time environment? please share that link.thnq

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum