• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Urban Penguin

The Urban Penguin - Linux Training

  • Home
  • About
  • Live Training
  • Shop
  • Our Latest eBook Offer
  • Programming
    • Master Editing Text Files Using VIM
    • Learn Shell Scripting with BASH
    • PERL Scripting in Linux
    • Ruby Scripting in Linux
    • Scripting with PowerShell
    • Learn C Programming using Linux and the Raspberry Pi
    • General Java Tutorials
    • Java 7 OCA Exam 1ZO-803
  • OS Tutorials
    • Red Hat and CentOS Training
      • RHCE – EX294 – Automation With Ansible
    • Learning Ubuntu
    • LPI Training
      • LPI Linux Essentials
      • LPIC-1 Linux Administrator
      • LPIC-2 Certified Linux Engineer
      • LPIC-3 Senior Level Certification
        • LPIC-3 Exam 300 : Mixed Environments
        • LPIC-3 Exam 303 : Security
        • LPIC-3 Exam 304 : Virtualization and High Availability
    • Linux Technologies
      • Apache HTTPD Server
      • Learning PHP
      • Learning PUPPET
      • Learning SAMBA
      • Linux File-Systems
      • Monitoring with Nagios Core
      • MYSQL
      • openLDAP Directories on Linux
  • Pluralsight Courses
You are here: Home / Linux / nagios / Nagios – Using HostGroups

Nagios – Using HostGroups

October 25, 2013 by The Urban Penguin


Monitoring with Nagios CoreFor system administration we will be used to using groups to help us manage all aspects of our tasks and monitoring with Nagios Core is no different. We saw in a previous tutorial that we could create a service to monitor NTP. We that was fine as we only have the one NTP server that supplies time to other hosts, however, for services such as SSH we will have many servers to monitor. The default Nagios 3 package on Ubuntu defines a services for SSH and it is attached to a host group, ssh-servers. Host groups, as the name suggests groups hosts and can be used to assign services. User can become a member of the groups through the group definition itself and the members attribute as we can see from the definition below that just has the localhost as a member. Multiple host names should be separated by commas.

define hostgroup {
   hostgroup_name  ssh-servers
   alias           SSH servers
   members         localhost
 }

Hosts may also become a member of the group from with the host definition, using the hostgroups attribute.  Multiple hostgroups should be separated by commas.

define host {
  host_name store.tup.local
  alias store
  address 192.168.0.8
  hostgroups ssh-servers
  max_check_attempts 3
  check_period 24x7
  check_command check-host-alive
  contacts root
  notification_interval 60
  notification_period 24x7
}

By becoming a member of the hostgroup ssh-servers the SSH service is monitored on my store server. There is,  as you may guess, a service definition in place to monitor SSH. This, too, was part of the standard Nagios package installed onto Ubuntu.

define service {
        hostgroup_name                  ssh-servers
        service_description             SSH
        check_command                   check_ssh
        use                             generic-service
        notification_interval           0 ; set > 0 if you want to be renotified
}

 

 

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to print (Opens in new window)

Filed Under: nagios, Ubuntu

Primary Sidebar

Newest Video

The Urban Penguin On Youtube

Live Training

Powered by Eventbrite

Categories

Pages

  • About The Urban Penguin
  • Contact Us
  • Shop
    • Basket
    • Checkout
    • My Account
  • LPI Training from The Urban Penguin
    • Live and Pluralsight hosted courses
    • Complete Linux Essentials
    • Scheduled Linux Essentials Classes
    • LPIC-3 Senior Level Certification
      • LPIC-3 Exam 300 : Mixed Environments
      • LPIC-3 Exam 303 : Security
      • LPIC-3 Exam 304 : Virtualization and High Availability
    • LPIC-2 Certified Linux Engineer
    • LPIC-1 Linux Administrator
    • LPI Linux Essentials for Raspberry Pi
    • LPI Linux Essentials
  • Operating System Tutorials
    • Linux Foundation Training
    • Solaris 11 OCA 1ZO-821
    • Learning Ubuntu
    • Learning SUSE
    • Red Hat and CentOS Training
      • RHCE – EX294 – Automation With Ansible
  • Scripting – the power of repetition!
    • Java 7 OCA Exam 1ZO-803
    • General Java Tutorials
    • Learn C Programming using Linux and the Raspberry Pi
    • Ruby Scripting in Linux
    • Scripting with PowerShell
    • PERL Scripting in Linux
    • Learn Shell Scripting with BASH
    • Master Editing Text Files Using VIM
  • Linux Technologies
    • Learning PUPPET
    • openLDAP Directories on Linux
    • Monitoring with Nagios Core
    • Linux File-Systems
    • Learning SAMBA
    • Apache HTTPD Server
    • Learning PHP
    • MYSQL
  • OpenStack
    • Pluralsight
    • Udemy
    • Raspberry Pi Tutorials
    • Citrix Videos
  • Courses

© 2019 The Urban Penguin · All Rights Reserved

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok