Setting up NRPE on Debian server » History » Version 2
Jamila Khan, 08/19/2014 05:09 PM
1 | 1 | Jamila Khan | h1. Setting up NRPE on Debian server |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | Process: |
||
6 | |||
7 | 2 | Jamila Khan | h2. on client server |
8 | 1 | Jamila Khan | |
9 | 2 | Jamila Khan | h3. Install NRPE |
10 | |||
11 | 1 | Jamila Khan | <pre> |
12 | aptitude install nagios-nrpe-server nagios-plugins-basic |
||
13 | </pre> |
||
14 | |||
15 | h3. Edit config file |
||
16 | |||
17 | <pre> |
||
18 | vim /etc/nagios/nrpe.cfg |
||
19 | </pre> |
||
20 | |||
21 | * Add IP_v4_of_Nagios_server to allowed_hosts |
||
22 | |||
23 | h3. start service |
||
24 | |||
25 | <pre> |
||
26 | service nagios-nrpe-server restart |
||
27 | </pre> |
||
28 | |||
29 | h3. check that service is running |
||
30 | |||
31 | <pre> |
||
32 | netstat -tpln | grep 5666 |
||
33 | </pre> |
||
34 | |||
35 | h3. edit local config to add specified checks |
||
36 | |||
37 | <pre> |
||
38 | vim /etc/nagios/nrpe_local.cfg |
||
39 | </pre> |
||
40 | |||
41 | 2 | Jamila Khan | Add a NRPE test check and a disk check. |
42 | 1 | Jamila Khan | |
43 | <pre> |
||
44 | 0 octavia:/etc/nagios# cat nrpe_local.cfg |
||
45 | ###################################### |
||
46 | # Do any local nrpe configuration here |
||
47 | ###################################### |
||
48 | |||
49 | command[check_nrpe_daemon]=/bin/echo "NRPE OK" |
||
50 | |||
51 | # disk checks |
||
52 | 2 | Jamila Khan | command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/root |
53 | |||
54 | 1 | Jamila Khan | </pre> |
55 | |||
56 | 2 | Jamila Khan | h3. restart service |
57 | 1 | Jamila Khan | |
58 | 2 | Jamila Khan | <pre> |
59 | service nagios-nrpe-server restart |
||
60 | </pre> |
||
61 | 1 | Jamila Khan | |
62 | 2 | Jamila Khan | |
63 | h2. on monitoring server |
||
64 | |||
65 | h3. test connection |
||
66 | |||
67 | On Nagios/Icinga server test that that worked: |
||
68 | |||
69 | <pre> |
||
70 | /usr/lib/nagios/plugins/check_nrpe -H clientserveruri.com -c check_nrpe_daemon |
||
71 | NRPE OK |
||
72 | </pre> |
||
73 | |||
74 | h3. set up checks. |
||
75 | |||
76 | example service config file |
||
77 | |||
78 | <pre> |
||
79 | ############################################################################### |
||
80 | ############################################################################### |
||
81 | # |
||
82 | # SERVICE DEFINITIONS |
||
83 | # |
||
84 | ############################################################################### |
||
85 | ############################################################################### |
||
86 | |||
87 | define service{ |
||
88 | use generic-service ; Inherit default values from a template |
||
89 | host_name clientserver |
||
90 | service_description SSH |
||
91 | check_command check_ssh |
||
92 | } |
||
93 | |||
94 | define service{ |
||
95 | use generic-service ; Inherit default values from a template |
||
96 | host_name clientserver |
||
97 | service_description HTTP |
||
98 | check_command check_http |
||
99 | } |
||
100 | |||
101 | define service{ |
||
102 | use generic-service ; Inherit default values from a template |
||
103 | host_name clientserver |
||
104 | service_description Users |
||
105 | check_command check_nrpe_1arg!check_users |
||
106 | } |
||
107 | |||
108 | define service{ |
||
109 | use generic-service ; Inherit default values from a template |
||
110 | host_name clientserver |
||
111 | service_description Load |
||
112 | check_command check_nrpe_1arg!check_load |
||
113 | } |
||
114 | |||
115 | define service{ |
||
116 | use generic-service ; Inherit default values from a template |
||
117 | host_name clientserver |
||
118 | service_description Zombie Processes |
||
119 | check_command check_nrpe_1arg!check_zombie_procs |
||
120 | } |
||
121 | |||
122 | define service{ |
||
123 | use generic-service ; Inherit default values from a template |
||
124 | host_name clientserver |
||
125 | service_description Total Processes |
||
126 | check_command check_nrpe_1arg!check_total_procs |
||
127 | } |
||
128 | |||
129 | define service{ |
||
130 | use generic-service ; Inherit default values from a template |
||
131 | host_name clientserver |
||
132 | service_description Disk Space /root |
||
133 | check_command check_nrpe_1arg!check_disk_root |
||
134 | } |
||
135 | </pre> |
||
136 | |||
137 | |||
138 | |||
139 | sources: |
||
140 | 1 | Jamila Khan | http://xmodulo.com/2014/03/nagios-remote-plugin-executor-nrpe-linux.html |
141 | https://wiki.icinga.org/display/howtos/Setting+up+NRPE+with+Icinga |