File: starting.html

package info (click to toggle)
nagios2 2.6-2%2Betch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 6,856 kB
  • ctags: 4,475
  • sloc: ansic: 64,870; sh: 4,676; makefile: 787; perl: 722
file content (122 lines) | stat: -rw-r--r-- 4,266 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Starting Nagios</title>

<STYLE type="text/css">
<!--
        .Default { font-family: verdana,arial,serif; font-size: 8pt; }
        .PageTitle { font-family: verdana,arial,serif; font-size: 12pt; font-weight: bold; }
-->      
</STYLE>

</head>

<body bgcolor="#FFFFFF" text="black" class="Default">

<p>
<div align="center">
<h2 class="PageTitle">Starting Nagios</h2>
</div>
</p>
<hr>

<p>
<font color="red"><strong>IMPORTANT:</strong></font>  Before you actually start Nagios, you'll have to make sure that you have <a href="config.html">configured</a> it properly and <a href="verifyconfig.html">verified the config data</a>! </p>

<p>
<strong><u>Methods For Starting Nagios</u></strong>
</p>

<p>
There are basically four different ways you can start Nagios:
</p>
<p>
<ol>
<li>Manually, as a foreground process (useful for initial testing and debugging)
<li>Manually, as a background process
<li>Manually, as a daemon
<li>Automatically at system boot
</ol>
</p>

<p>
Let's examine each method briefly...
</p>

<p>
<strong><u>Running Nagios Manually as a Foreground Process</u></strong>
</p>

<p>
If you enabled the debugging options when running the configure script (and recompiled Nagios), this would
be your first choice for testing and debugging.  Running Nagios as a foreground process at a shell
prompt will allow you to more easily view what's going on in the monitoring and notification processes.
To run Nagios as a foreground process for testing, invoke Nagios like this...
</p>
<p>
<strong><font color="red">/usr/local/nagios/bin/nagios &lt;main_config_file&gt;</font></strong>
</p>
<p>
Note that you must specify the path/filename of the <a href="configmain.html">main configuration file</a> (i.e. <i>/usr/local/nagios/etc/nagios.cfg</i>) on the command line.
</p>
<p>
To stop Nagios at any time, just press CTRL-C.  If you've enabled the debugging options you'll probably want to
redirect the output to a file for easier review later.
</p>

<p>
<strong><u>Running Nagios Manually as a Background Process</u></strong>
</p>
<p>
To run Nagios as a background process, invoke it with an ampersand as follows...
</p>
<p>
<strong><font color="red">/usr/local/nagios/bin/nagios &lt;main_config_file&gt; &amp;</font></strong>
</p>
<p>
Note that you must specify the path/filename of the <a href="configmain.html">main configuration file</a> (i.e. <i>/usr/local/nagios/etc/nagios.cfg</i>) on the command line.
</p>

<p>
<strong><u>Running Nagios Manually as a Daemon</u></strong>
</p>
<p>
In order to run Nagios in daemon mode you must supply the <b>-d</b> switch on the command line as follows...
</p>
<p>
<strong><font color="red">/usr/local/nagios/bin/nagios -d &lt;main_config_file&gt;</font></strong>
</p>
<p>
Note that you must specify the path/filename of the <a href="configmain.html">main configuration file</a> (i.e. <i>/usr/local/nagios/etc/nagios.cfg</i>) on the command line.
</p>

<p>
<strong><u>Running Nagios Automatically at System Boot</u></strong>
</p>
<p>
When you have tested Nagios and are reasonably sure that it is not going to crash, you will probably
want to have it start automatically at boot time.  To do this (in Linux) you will have to create a startup script
in your <b>/etc/rc.d/init.d/</b> directory.  You will also have to create a link to the script in
the runlevel(s) that you wish to have Nagios to start in.  I'll assume that you know what I'm talking about and are able to do this.
</p>
<p>
A sample init script (named <b>daemon-init</b>) is created in the base directory of the Nagios distribution when you run the configure script.  You can install the sample script to your /etc/rc.d/init.d directory using the '<font color="red"><strong>make install-init</strong></font>' command, as outlined in the <a href="installing.html#installing">installation</a> instructions.
</p>
<p>
The sample init scripts are designed to work under Linux, so if you want to use them under FreeBSD, Solaris, etc. you may have to do a little hacking...
</p>

<p>
<strong><u>Stopping and Restarting Nagios</u></strong>
</p>

<p>
Directions on how to stop and restart Nagios can be found <a href="stoprestart.html">here</a>.
</p>

<hr>

</body>
</html>