Project

General

Profile

Add Host » History » Version 2

chin-yeh, 09/09/2010 10:58 AM

1 1 chin-yeh
h1. Add Host
2
3
A host should be grouped under a specify host group to ease the configuration tasks.
4 2 chin-yeh
5
*[Important]* Before begin, the following items should be prepared and ready:
6
* *host name* - a short name to identify the host
7
* *alias* - a longer name or description to identify the host
8
* *IP address* - IP address of the host. *Should not use hostname as it rely on DNS*
9
* *host group* - the host group of the host
10
11
If the host is a not *nix machine, please consult the administrator.
12
13
h2. Steps
14
15
# login to the nagios server with *nagios* user
16
# edit the @/usr/local/nagios/etc/ecosway/hosts/hosts.cfg@
17
<pre>
18
nagios$ vi /usr/local/nagios/etc/ecosway/hosts/hosts.cfg
19
</pre>
20
* Template:
21
<pre>
22
define host{
23
        use                     linux-server
24
        host_name               host name
25
        alias                   alias
26
        address                 IP address
27
        }
28
</pre>
29
* Example:
30
<pre>
31
define host{
32
        use                     linux-server
33
        host_name               cwydb1
34
        alias                   database server
35
        address                 192.168.2.68
36
        }
37
</pre>
38
39
# assign the host to a host group (_the host group should exist and prepare by administrator_)
40
## edit the @/usr/local/nagios/etc/ecosway/hosts/host_groups.cfg@
41
<pre>
42
nagios$ vi /usr/local/nagios/etc/ecosway/hosts/host_groups.cfg 
43
</pre>
44
* Template:
45
<pre>
46
define hostgroup{
47
        hostgroup_name  development-nodes
48
        alias           Development Nodes
49
        members         host name
50
        }
51
</pre>
52
* Example:
53
<pre>
54
define hostgroup{
55
        hostgroup_name  development-nodes
56
        alias           Development Nodes
57
        members         cwydb1
58
        }
59
</pre>