1 |
swift 08/07/07 20:02:46 |
2 |
|
3 |
Modified: nagios-guide.xml |
4 |
Log: |
5 |
Configuring nrpe |
6 |
|
7 |
Revision Changes Path |
8 |
1.4 xml/htdocs/doc/en/nagios-guide.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/nagios-guide.xml?rev=1.4&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/nagios-guide.xml?rev=1.4&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/nagios-guide.xml?r1=1.3&r2=1.4 |
13 |
|
14 |
Index: nagios-guide.xml |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/nagios-guide.xml,v |
17 |
retrieving revision 1.3 |
18 |
retrieving revision 1.4 |
19 |
diff -u -r1.3 -r1.4 |
20 |
--- nagios-guide.xml 7 Jul 2008 19:04:38 -0000 1.3 |
21 |
+++ nagios-guide.xml 7 Jul 2008 20:02:46 -0000 1.4 |
22 |
@@ -1,5 +1,5 @@ |
23 |
<?xml version="1.0" encoding="UTF-8"?> |
24 |
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nagios-guide.xml,v 1.3 2008/07/07 19:04:38 swift Exp $ --> |
25 |
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nagios-guide.xml,v 1.4 2008/07/07 20:02:46 swift Exp $ --> |
26 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
27 |
|
28 |
<guide disclaimer="draft"> |
29 |
@@ -216,8 +216,11 @@ |
30 |
|
31 |
</body> |
32 |
</section> |
33 |
-<section> |
34 |
+</chapter> |
35 |
+<chapter> |
36 |
<title>Installing Client Daemons</title> |
37 |
+<section> |
38 |
+<title>Introduction</title> |
39 |
<body> |
40 |
|
41 |
<p> |
42 |
@@ -239,6 +242,12 @@ |
43 |
We first focus on using the NRPE method as it is the most popular one. |
44 |
</p> |
45 |
|
46 |
+</body> |
47 |
+</section> |
48 |
+<section> |
49 |
+<title>Installing NRPE</title> |
50 |
+<body> |
51 |
+ |
52 |
<p> |
53 |
With NRPE, each remote host runs a daemon (the NRPE deamon) which allows the |
54 |
main Nagios system to query for certain metrics. One can run the NRPE daemon by |
55 |
@@ -264,6 +273,81 @@ |
56 |
# <i>/etc/init.d/nrpe start</i> |
57 |
</pre> |
58 |
|
59 |
+<p> |
60 |
+Finally, we need to configure the main Nagios system to connect to this |
61 |
+particular NRPE instance and request the necessary metrics. To introduce you to |
62 |
+Nagios' object syntax, our next section will cover this a bit more throroughly. |
63 |
+</p> |
64 |
+ |
65 |
+</body> |
66 |
+</section> |
67 |
+<section> |
68 |
+<title>Configuring a Remote Host</title> |
69 |
+<body> |
70 |
+ |
71 |
+<note> |
72 |
+The following hands-on tutorial is an example, used to introduce the user to |
73 |
+Nagios' object model. Do not see this as the "Best Practice" for |
74 |
+configuring Nagios. |
75 |
+</note> |
76 |
+ |
77 |
+<p> |
78 |
+First, edit <path>/etc/nagios/nagios.cfg</path> and place a <c>cfg_dir</c> |
79 |
+directive. This will tell Nagios to read in all object configuration files in |
80 |
+the said directory - in our example, the directory will contain the definitions |
81 |
+for remote systems. |
82 |
+</p> |
83 |
+ |
84 |
+<pre caption="Editing /etc/nagios/nagios.cfg"> |
85 |
+cfg_dir=/etc/nagios/objects/remote |
86 |
+</pre> |
87 |
+ |
88 |
+<p> |
89 |
+Create the directory and start with the first file, |
90 |
+<path>nrpe-command.cfg</path>. In this file, we configure a Nagios command |
91 |
+called <c>check_nrpe</c> which will be used to trigger a plugin (identified by |
92 |
+the placeholder <c>$ARG1$</c>) on the remote system (identified by the |
93 |
+placeholder <c>$HOSTADDRESS$</c>). The <c>$USER1$</c> variable is a default |
94 |
+pointer to the Nagios installation directory (for instance, |
95 |
+<path>/usr/nagios/libexec</path>). |
96 |
+</p> |
97 |
+ |
98 |
+<pre caption="Defining the check_nrpe command"> |
99 |
+# <i>nano /etc/nagios/objects/remote/nrpe-command.cfg</i> |
100 |
+ |
101 |
+define command { |
102 |
+ command_name check_nrpe |
103 |
+ command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ |
104 |
+} |
105 |
+</pre> |
106 |
+ |
107 |
+<p> |
108 |
+Next, create a file <path>nrpe-hosts.cfg</path> where we define the remote |
109 |
+host(s) to monitor. In this example, we define two remote systems: |
110 |
+</p> |
111 |
+ |
112 |
+<pre caption="Defining two remote hosts"> |
113 |
+# <i>nano /etc/nagios/objects/remote/nrpe-hosts.cfg</i> |
114 |
+ |
115 |
+define host { |
116 |
+ use linux-server |
117 |
+ host_name webber |
118 |
+ alias Gentoo Linux Web Server |
119 |
+ address 192.168.2.1 |
120 |
+} |
121 |
+ |
122 |
+define host { |
123 |
+ use linux-server |
124 |
+ host_name isync |
125 |
+ alias Gentoo Linux RSync server |
126 |
+ address 192.168.2.2 |
127 |
+} |
128 |
+</pre> |
129 |
+ |
130 |
+<p> |
131 |
+Finally, define the service(s) you want to check on these hosts. |
132 |
+</p> |
133 |
+ |
134 |
</body> |
135 |
</section> |
136 |
</chapter> |
137 |
|
138 |
|
139 |
|
140 |
-- |
141 |
gentoo-doc-cvs@l.g.o mailing list |