Nagios Hosts configuration

From Bashlinux
Revision as of 15:54, 8 June 2015 by Manpaz (talk | contribs) (Created page with "== Host setup == # Add the host definition into the proper file into the <tt>/etc/nagios/hosts</tt> folder, the files are named based on group name: #* linux.cfg #* printers.c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Host setup

  1. Add the host definition into the proper file into the /etc/nagios/hosts folder, the files are named based on group name:
    • linux.cfg
    • printers.cfg
    • routers.cfg
  2. Add the host recently defined to a host group into the hostgroups.cfg file

The groups that are not used must be commented out.

Hosts definitions

A host definition could be a terminal, printer, router, ups, etc. Any individual unit.

= How to add a network switch

To add a network switch with the host name netopia and the ip address 11.22.33.44:

define host{
       host_name               netopia
       alias                   Netopia
       address                 11.22.33.44
       }

= How to add a Linux terminal

To add the host with the host name blnx-cl01 and the ip address 10.0.0.168:

define host{
       use			bashlinux-template
       host_name		blnx-cl01
       parents			netopia
       address			10.0.0.168
       }

How to add adding a printer

To add a printer with the host name hp5000 and the ip address 10.0.0.250 attached to the terminal blnx-cl01:

define host{
        host_name		hp5000
        alias 			HP 5000
        parents		blnx-cl01
        address		10.0.0.250
        }

How to create Host groups

Once each unit are defined, they must be added one host existent group, or if there is no group that make sense for the kind of unit then the group could be created. Note that cannot be created a group without members.

  • Adding Linux terminal group *

To add the host blnx-cl01 to the host group blnx-linux<tt>:

define hostgroup{
        hostgroup_name 	blnx-linux
        alias			Linux
        members		volante-cl00, volante-cl01
        }

The members is a comma-separated list. The same structure apply for all other groups.

Service groups

  • Api*
  • Apache
    • status
  • MySQL
    • Process
    • Status
  • Messaging*
  • Java
    • Procs
    • Threads
    • Classes
  • xmlBlaster
    • Clients
    • Memory
    • Subscriptions
    • Topics
  • Net*
  • Cisco
    • Uptime
    • Bandwidth
    • Environment
    • FastEthernet0
    • Memory
    • VLan
  • Netopia
    • Uptime
    • Bandwidth
    • NICs status
  • Switch
    • NICs status
    • Uptime
  • Server*
  • Windows on DELL
    • Bandwidth
    • Memory
    • Ping
    • Services
    • Storage
    • Uptime
  • Terminal*
  • Mac hosts
    • Memory
    • NIC
    • Ping
    • Storage
    • Swap
    • Uptime

Configuration files

/etc/nagios

Main configuration folder

htpasswd format.

/etc/nagios/hosts

All the hosts configurations are done in this folder

to one of the hostgroups specified in this file.

/etc/nagios/servicegroups

All the services executions on each hosts are done in this folder