1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5
<title>Fedora Quickstart</title>
7
<STYLE type="text/css">
9
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
10
.PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
16
<body bgcolor="#FFFFFF" text="black" class="Default">
19
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
20
<h1 class="PageTitle">Fedora Quickstart</h1>
26
<img src="images/upto.gif" border="0" align="middle" alt="Up To" title="Up To">Up To: <a href="toc.html">Contents</a><br>
27
<img src="images/seealso.gif" border="0" align="middle" alt="See Also" title="See Also"> See Also: <a href="quickstart.html">Quickstart Installation Guides</a>, <a href="security.html">Security Considerations</a>
31
<strong><u>Introduction</u></strong>
35
This guide is intended to provide you with simple instructions on how to install Nagios from source (code) on Fedora and have it monitoring your local machine inside of 20 minutes. No advanced installation options are discussed here - just the basics that will work for 95% of users who want to get started.
39
These instructions were written based on a standard <b>Fedora Core 6</b> Linux distribution.
43
<strong><u>What You'll End Up With</u></strong>
47
If you follow these instructions, here's what you'll end up with:
51
<li>Nagios and the plugins will be installed underneath /usr/local/nagios</li>
52
<li>Nagios will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)</li>
53
<li>The Nagios web interface will be accessible at http://localhost/nagios/</li>
57
<strong><u>Prerequisites</u></strong>
61
During portions of the installation you'll need to have <b>root</b> access to your machine.
65
Make sure you've installed the following packages on your Fedora installation before continuing.
71
<li><a href="http://www.boutell.com/gd/">GD</a> development libraries</li>
75
You can use <i>yum</i> to install these packages by running the following commands (as root):
81
yum install glibc glibc-common
82
yum install gd gd-devel
86
<strong><u>1) Create Account Information</u></strong>
98
Create a new <i>nagios</i> user account and give it a password.
102
/usr/sbin/useradd -m nagios
107
Create a new <i>nagcmd</i> group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
111
/usr/sbin/groupadd nagcmd
112
/usr/sbin/usermod -a -G nagcmd nagios
113
/usr/sbin/usermod -a -G nagcmd apache
117
<strong><u>2) Download Nagios and the Plugins</u></strong>
121
Create a directory for storing the downloads.
130
Download the source code tarballs of both Nagios and the Nagios plugins (visit <a href="http://www.nagios.org/download/">http://www.nagios.org/download/</a> for links to the latest versions). At the time of writing, the latest versions of Nagios and the Nagios plugins were 3.0.3 and 1.4.11, respectively.
134
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
135
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
139
<strong><u>3) Compile and Install Nagios</u></strong>
143
Extract the Nagios source code tarball.
148
tar xzf nagios-3.0.6.tar.gz
153
Run the Nagios configure script, passing the name of the group you created earlier like so:
157
./configure --with-command-group=nagcmd
161
Compile the Nagios source code.
169
Install binaries, init script, sample config files and set permissions on the external command directory.
176
make install-commandmode
180
Don't start Nagios yet - there's still more that needs to be done...
184
<strong><u>4) Customize Configuration</u></strong>
188
Sample <a href="config.html">configuration files</a> have now been installed in the <i>/usr/local/nagios/etc</i> directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...
192
Edit the <i>/usr/local/nagios/etc/objects/contacts.cfg</i> config file with your favorite editor and change the email address associated with the <i>nagiosadmin</i> contact definition to the address you'd like to use for receiving alerts.
196
vi /usr/local/nagios/etc/objects/contacts.cfg
200
<strong><u>5) Configure the Web Interface</u></strong>
204
Install the Nagios web config file in the Apache conf.d directory.
212
Create a <i>nagiosadmin</i> account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
216
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
220
Restart Apache to make the new settings take effect.
224
service httpd restart
228
<img src="images/note.gif" border="0" align="bottom" alt="Note" title="Note"> Note: Consider implementing the ehanced CGI security measures described <a href="cgisecurity.html">here</a> to ensure that your web authentication credentials are not compromised.
233
<strong><u>6) Compile and Install the Nagios Plugins</u></strong>
237
Extract the Nagios plugins source code tarball.
242
tar xzf nagios-plugins-1.4.11.tar.gz
243
cd nagios-plugins-1.4.11
247
Compile and install the plugins.
251
./configure --with-nagios-user=nagios --with-nagios-group=nagios
258
<strong><u>7) Start Nagios</u></strong>
262
Add Nagios to the list of system services and have it automatically start when the system boots.
266
chkconfig --add nagios
271
Verify the sample Nagios configuration files.
275
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
279
If there are no errors, start Nagios.
287
<strong><u>8) Modify SELinux Settings</u></strong>
291
Fedora ships with SELinux (Security Enhanced Linux) installed and in Enforcing mode by default. This can result in "Internal Server Error" messages when you attempt to access the Nagios CGIs.
295
See if SELinux is in Enforcing mode.
303
Put SELinux into Permissive mode.
311
To make this change permanent, you'll have to modify the settings in <i>/etc/selinux/config</i> and reboot.
315
Instead of disabling SELinux or setting it to permissive mode, you can use the following command to run the CGIs under SELinux enforcing/targeted mode:
319
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
320
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
324
For information on running the Nagios CGIs under Enforcing mode with a targeted policy, visit the NagiosCommunity.org wiki at <a href="http://www.nagioscommunity.org/wiki">http://www.nagioscommunity.org/wiki</a>.
328
<strong><u>9) Login to the Web Interface</u></strong>
332
You should now be able to access the Nagios web interface at the URL below. You'll be prompted for the username (<i>nagiosadmin</i>) and password you specified earlier.
336
http://localhost/nagios/
340
Click on the "Service Detail" navbar link to see details of what's being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time.
344
<strong><u>10) Other Modifications</u></strong>
348
Make sure your machine's firewall rules are configured to allow access to the web server if you want to access the Nagios interface remotely.
352
Configuring email notifications is out of the scope of this documentation. While Nagios is currently configured to send you email notifications, your system may not yet have a mail program properly installed or configured. Refer to your system documentation, search the web, or look to the <a href="http://www.nagioscommunity.org/wiki">NagiosCommunity.org wiki</a> for specific instructions on configuring your system to send email messages to external addresses. More information on notifications can be found <a href="notifications.html">here</a>.
356
<strong><u>11) You're Done</u></strong>
360
Congratulations! You sucessfully installed Nagios. Your journey into monitoring is just beginning. You'll no doubt want to monitor more than just your local machine, so check out the following docs...
364
<li><a href="monitoring-windows.html">Monitoring Windows machines</a></li>
365
<li><a href="monitoring-linux.html">Monitoring Linux/Unix machines</a></li>
366
<li><a href="monitoring-netware.html">Monitoring Netware servers</a></li>
367
<li><a href="monitoring-routers.html">Monitoring routers/switches</a></li>
368
<li><a href="monitoring-publicservices.html">Monitoring publicly available services (HTTP, FTP, SSH, etc.)</a></li>
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
9
<title>Fedora Quickstart</title>
13
<STYLE type="text/css">
17
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
19
.PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
31
<body bgcolor="#FFFFFF" text="black" class="Default">
37
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
39
<h1 class="PageTitle">Fedora Quickstart</h1>
51
<img src="images/upto.gif" border="0" align="middle" alt="Up To" title="Up To">Up To: <a href="toc.html">Contents</a><br>
53
<img src="images/seealso.gif" border="0" align="middle" alt="See Also" title="See Also"> See Also: <a href="quickstart.html">Quickstart Installation Guides</a>, <a href="security.html">Security Considerations</a>
61
<strong><u>Introduction</u></strong>
69
This guide is intended to provide you with simple instructions on how to install Nagios from source (code) on Fedora and have it monitoring your local machine inside of 20 minutes. No advanced installation options are discussed here - just the basics that will work for 95% of users who want to get started.
77
These instructions were written based on a standard <b>Fedora Core 6</b> Linux distribution.
85
<strong><u>What You'll End Up With</u></strong>
93
If you follow these instructions, here's what you'll end up with:
101
<li>Nagios and the plugins will be installed underneath /usr/local/nagios</li>
103
<li>Nagios will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)</li>
105
<li>The Nagios web interface will be accessible at http://localhost/nagios/</li>
113
<strong><u>Prerequisites</u></strong>
121
During portions of the installation you'll need to have <b>root</b> access to your machine.
129
Make sure you've installed the following packages on your Fedora installation before continuing.
141
<li>GCC compiler</li>
143
<li><a href="http://www.boutell.com/gd/">GD</a> development libraries</li>
151
You can use <i>yum</i> to install these packages by running the following commands (as root):
159
yum install httpd php
161
yum install gcc glibc glibc-common
163
yum install gd gd-devel
171
<strong><u>1) Create Account Information</u></strong>
179
Become the root user.
195
Create a new <i>nagios</i> user account and give it a password.
203
/usr/sbin/useradd -m nagios
213
Create a new <i>nagcmd</i> group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.
221
/usr/sbin/groupadd nagcmd
223
/usr/sbin/usermod -a -G nagcmd nagios
225
/usr/sbin/usermod -a -G nagcmd apache
233
<strong><u>2) Download Nagios and the Plugins</u></strong>
241
Create a directory for storing the downloads.
259
Download the source code tarballs of both Nagios and the Nagios plugins (visit <a href="http://www.nagios.org/download/">http://www.nagios.org/download/</a> for links to the latest versions). These directions were tested with Nagios 3.1.1 and Nagios Plugins 1.4.11.
267
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
269
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
277
<strong><u>3) Compile and Install Nagios</u></strong>
285
Extract the Nagios source code tarball.
295
tar xzf nagios-3.2.0.tar.gz
305
Run the Nagios configure script, passing the name of the group you created earlier like so:
313
./configure --with-command-group=nagcmd
321
Compile the Nagios source code.
337
Install binaries, init script, sample config files and set permissions on the external command directory.
351
make install-commandmode
359
Don't start Nagios yet - there's still more that needs to be done...
367
<strong><u>4) Customize Configuration</u></strong>
375
Sample <a href="config.html">configuration files</a> have now been installed in the <i>/usr/local/nagios/etc</i> directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...
383
Edit the <i>/usr/local/nagios/etc/objects/contacts.cfg</i> config file with your favorite editor and change the email address associated with the <i>nagiosadmin</i> contact definition to the address you'd like to use for receiving alerts.
391
vi /usr/local/nagios/etc/objects/contacts.cfg
399
<strong><u>5) Configure the Web Interface</u></strong>
407
Install the Nagios web config file in the Apache conf.d directory.
423
Create a <i>nagiosadmin</i> account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
431
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
439
Restart Apache to make the new settings take effect.
447
service httpd restart
455
<img src="images/note.gif" border="0" align="bottom" alt="Note" title="Note"> Note: Consider implementing the ehanced CGI security measures described <a href="cgisecurity.html">here</a> to ensure that your web authentication credentials are not compromised.
465
<strong><u>6) Compile and Install the Nagios Plugins</u></strong>
473
Extract the Nagios plugins source code tarball.
483
tar xzf nagios-plugins-1.4.11.tar.gz
485
cd nagios-plugins-1.4.11
493
Compile and install the plugins.
501
./configure --with-nagios-user=nagios --with-nagios-group=nagios
515
<strong><u>7) Start Nagios</u></strong>
523
Add Nagios to the list of system services and have it automatically start when the system boots.
531
chkconfig --add nagios
541
Verify the sample Nagios configuration files.
549
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
557
If there are no errors, start Nagios.
573
<strong><u>8) Modify SELinux Settings</u></strong>
581
Fedora ships with SELinux (Security Enhanced Linux) installed and in Enforcing mode by default. This can result in "Internal Server Error" messages when you attempt to access the Nagios CGIs.
589
See if SELinux is in Enforcing mode.
605
Put SELinux into Permissive mode.
621
To make this change permanent, you'll have to modify the settings in <i>/etc/selinux/config</i> and reboot.
629
Instead of disabling SELinux or setting it to permissive mode, you can use the following command to run the CGIs under SELinux enforcing/targeted mode:
637
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
639
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
647
For information on running the Nagios CGIs under Enforcing mode with a targeted policy, visit the <a href="http://support.nagios.com" target="_blank">Nagios Support Portal</a> or <a href="http://wiki.nagios.org" target="_blank">Nagios Community Wiki</a>.
655
<strong><u>9) Login to the Web Interface</u></strong>
663
You should now be able to access the Nagios web interface at the URL below. You'll be prompted for the username (<i>nagiosadmin</i>) and password you specified earlier.
671
http://localhost/nagios/
679
Click on the "Service Detail" navbar link to see details of what's being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time.
687
<strong><u>10) Other Modifications</u></strong>
695
Make sure your machine's firewall rules are configured to allow access to the web server if you want to access the Nagios interface remotely.
703
Configuring email notifications is out of the scope of this documentation. While Nagios is currently configured to send you email notifications, your system may not yet have a mail program properly installed or configured. Refer to your system documentation, search the web, or look to the <a href="http://support.nagios.com" target="_blank">Nagios Support Portal</a> or <a href="http://wiki.nagios.org" target="_blank">Nagios Community Wiki</a> for specific instructions on configuring your system to send email messages to external addresses. More information on notifications can be found <a href="notifications.html">here</a>.
711
<strong><u>11) You're Done</u></strong>
719
Congratulations! You sucessfully installed Nagios. Your journey into monitoring is just beginning. You'll no doubt want to monitor more than just your local machine, so check out the following docs...
727
<li><a href="monitoring-windows.html">Monitoring Windows machines</a></li>
729
<li><a href="monitoring-linux.html">Monitoring Linux/Unix machines</a></li>
731
<li><a href="monitoring-netware.html">Monitoring Netware servers</a></li>
733
<li><a href="monitoring-routers.html">Monitoring routers/switches</a></li>
735
<li><a href="monitoring-publicservices.html">Monitoring publicly available services (HTTP, FTP, SSH, etc.)</a></li>
b'\\ No newline at end of file'