Top Five Open Source Packages for System Administrators
Pages: 1, 2, 3, 4
The cgi.cfg File
The cgi.cfg configuration file has several different functions with the Nagios system. Among the most important is authentication, allowing Nagios and its data to be restricted to appropriate people. Here are some sample directives related to authorization:
use_authentication=1
authorized_for_configuration_information=netsaintadmin,root,chavez
authorized_for_all_services=netsaintadmin,root,chavez,maresca
The first entry enables the access control mechanism. The next two entries
specify users who are allowed to view Nagios configuration information and
services status information (respectively). Note that all users also must be
authenticated to the Web server using the usual Apache htpasswd
mechanism.
This same configuration file is also used to store settings for icon-based status displays, as in these examples:
hostextinfo[janine]=;redhat.gif;;redhat.gd2;;168,36;,,;
hostextinfo[ishtar]=;apple.gif;;apple.gd2;;125,36;,,;
These entries specify extended attributes for the hosts defined in the entries labeled janine and ishtar. The filenames in this example specify images files for the host in status tables (GIF format--see Figure 3) and in the status map (GD2 format), and the two numeric values specify the device's location--for example, x and y coordinates--within the 2D status map. (Figure 4 provides an example status map display).
The resource.cfg File
The final configuration file we will consider is the resource.cfg
file. It is used to define site-specific macros, conventionally named
$USER1$ through $USER32$:
# $USER1$ = path to plugins directory
$USER1$=/usr/lib/nagiosplugins
...
# Store a username and password (hidden)
$USER3$=administrator
$USER4$=somepassword
The first macros defines the path to the Nagios plug-ins directory; this usage is assumed by the supplied sample configuration files.
The other two macros are used in this case to store a username and password. These items can be used in command definitions for added security. The resource.cfg file itself can be protected against all non-root access without compromising the ability of CGI programs to run successfully.
Pre-Checking a Nagios Configuration
Since Nagios configuration is somewhat involved, the package provides a command that can be used to verify it prior to running the program. Here is an example of its use:
# cd /usr/local/nagios/etc
# /usr/local/nagios/bin/nagios -v nagios.cfg
This will check the Nagios configuration, which uses nagios.cfg as its main configuration file.
|
Related Reading Essential System Administration Pocket Reference |
Resources
For more information about Nagios, including installation instructions, and how to initiate and manage monitoring, consult the following sources:
- Nagios home page
- Installing Nagios and Nagios, Part 2 by Oktay Altunergil.
- Chapter 8 of Essential System Administration, 3rd edition (discusses Netsaint and many other system monitoring tools).
If you liked this article and would like to receive the free ESA3 newsletter, you can sign up here.
You may also like AEleen's latest book, the just-released System Administration Pocket Reference.
Æleen Frisch has been a system administrator for over 20 years, tending a plethora of VMS, Unix, Macintosh, and Windows systems. If you liked this article and would like to receive the free ESA3 newsletter, you can sign up at http://www.aeleen.com/esa3_news.htm.
O'Reilly & Associates recently released (August 2002) Essential System Administration, 3rd Edition.
Sample Chapter 11, "Backup and Restore," is available free online.
You can also look at the Table of Contents, the Index, and the full description of the book.
For more information, or to order the book, click here.
Return to ONLamp.com.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 7 of 7.
-
Nagios vs Big Brother
2003-05-09 18:21:03 version7x [Reply | View]
I've heard that Nagios falls short when it comes to host specific type monitoring and it's ease of configuration leaves something to be desired. Is there any information on how it stacks up against the Big Brother package? -
Nagios vs Big Brother
2003-05-29 21:32:36 anonymous2 [Reply | View]
Nagios's recent change to template based configuration puts it on-par with the ease of configuration that Big Brother has but still allows you the flexibility to be very granular about how you define state monitoring for each host. Big Brother doesn't scale nearly as well as Nagios in a number of ways, making it fine for small shops. Enterprise scale monitoring requires Nagios.
-
where is #1?
2003-05-07 06:30:43 anonymous2 [Reply | View]
will there ever be published the last article of the five part installment?








Correct me if I'm wrong, but the only directives you can use in a host group are: hostgroup_name, alias, and members (meaning hosts). You can't put a hostgroup name into the members category either, because when you do the config check, nagios doesn't like it.
Just something to perhaps correct, if I'm indeed correct. Thanks!