Difference between revisions of "Nagios"

From Briki
Jump to: navigation, search
(Created page with '== Change default start page == Edit ''/usr/share/nagios3/htdocs/index.html'' and change: <pre> <FRAME SRC="main.html" NAME="main"> </pre> to <pre> <FRAME SRC="/cgi-bin/nagios3/s…')
 
 
(2 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
<FRAME SRC="/cgi-bin/nagios3/status.cgi?host=all" NAME="main">
 
<FRAME SRC="/cgi-bin/nagios3/status.cgi?host=all" NAME="main">
 
</pre>
 
</pre>
 +
 +
== Enabling external commands ==
 +
From ''/usr/share/doc/nagios3-common/README.Debian'':
 +
<pre>
 +
Nagios 3 is not configured to look for external commands in the
 +
default configuration as a security feature. To enable external
 +
commands, you need to allow the web server write access to the
 +
nagios command pipe.  the simplest way of doing this is to
 +
set check_external_commands=1 in your nagios configuration,
 +
and then change the permissions in a way which will be maintained
 +
across package upgrades (otherwise dpkg will overwrite your
 +
permission changes).  The following is the recommended approach:
 +
 +
- activate external command checks in the nagios configuration. this
 +
  can be done by setting check_external_commands=1 in the file
 +
  /etc/nagios3/nagios.cfg.
 +
 +
- perform the following commands to change directory permissions and
 +
  to make the changes permanent:
 +
 +
/etc/init.d/nagios3 stop
 +
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
 +
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
 +
/etc/init.d/nagios3 start
 +
</pre>
 +
 +
== Creating a MySQL user for monitoring ==
 +
Locally:
 +
<pre>
 +
GRANT USAGE ON *.* TO 'nagios'@'localhost'
 +
</pre>
 +
Remotely:
 +
<pre>
 +
GRANT USAGE ON *.* TO 'nagios'@'%'
 +
</pre>
 +
 +
== NagiosGrapher ==
 +
=== Initial setup ===
 +
* Ensure that ''/etc/nagiosgrapher/ngraph.ncfg'':'''step''' matches the ''normal_check_interval'' for your services in nagios (otherwise you'll get blank graphs since nagios isn't supplying data often enough)
 +
 +
=== Changing default refresh interval ===
 +
* Edit ''/usr/share/perl5/NagiosGrapher/HTML.pm'' and change the refresh value in DEFAULTS (there may be a better way to do this via config, but I haven't found it).

Latest revision as of 18:05, 1 February 2010

Change default start page

Edit /usr/share/nagios3/htdocs/index.html and change:

<FRAME SRC="main.html" NAME="main">

to

<FRAME SRC="/cgi-bin/nagios3/status.cgi?host=all" NAME="main">

Enabling external commands

From /usr/share/doc/nagios3-common/README.Debian:

Nagios 3 is not configured to look for external commands in the
default configuration as a security feature. To enable external
commands, you need to allow the web server write access to the
nagios command pipe.  the simplest way of doing this is to
set check_external_commands=1 in your nagios configuration,
and then change the permissions in a way which will be maintained
across package upgrades (otherwise dpkg will overwrite your
permission changes).  The following is the recommended approach:

- activate external command checks in the nagios configuration. this
  can be done by setting check_external_commands=1 in the file
  /etc/nagios3/nagios.cfg.

- perform the following commands to change directory permissions and
  to make the changes permanent:

/etc/init.d/nagios3 stop
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
/etc/init.d/nagios3 start

Creating a MySQL user for monitoring

Locally:

GRANT USAGE ON *.* TO 'nagios'@'localhost'

Remotely:

GRANT USAGE ON *.* TO 'nagios'@'%'

NagiosGrapher

Initial setup

  • Ensure that /etc/nagiosgrapher/ngraph.ncfg:step matches the normal_check_interval for your services in nagios (otherwise you'll get blank graphs since nagios isn't supplying data often enough)

Changing default refresh interval

  • Edit /usr/share/perl5/NagiosGrapher/HTML.pm and change the refresh value in DEFAULTS (there may be a better way to do this via config, but I haven't found it).