# HOWTO: Configure Nagios with MySQL and Apache2

## dsf

What's Nagios?

It's an insanely great open source monitoring system used at many places. 

It was formerly known as Netsaint until the author ran into some legal naming issues involving an unrelated company, so he changed the name to Nagios and kept moving ahead.

It doesn't have some of the more advanced features of more expensive monitoring software, but it's fairly well-rounded, easily extended, and has a smaller learning curve than for most monitoring software. And, hey, you can't beat the price!  :Very Happy: 

http://www.nagios.org

How to install and configure Nagios:

This document assumes that either:

You have 'mysql' listed in your USE flags in /etc/make.conf

OR

You may have an entry in /etc/portage/package.use that says 'net-analyzer/nagios-core mysql' and 'net-analyzer/nagios-plugins mysql' in it.

You may choose to use PostgreSQL instead of MySQL, but I will only document what it takes to integrate Nagios with MySQL. Most of the steps are probably identical for PostgreSQL with a few minor changes, I'd imagine.

The database is used to store polled data about hosts and services.

This will install the various Nagios-related ebuilds:

```
# emerge nagios
```

Now you need to set up your configuration files -- this assumes it is a first time install of Nagios:

```
# cd /etc/nagios

# cp /usr/share/doc/nagios-core-1.2-r2/sample-configs/* .

# gunzip *.gz
```

If you are doing this with bash, you can do this to rename the files:

```
# for file in *-sample

do

     mv "$file" "${file/%-sample/}"

done
```

Edit the config files using your favorite text editor. I chose vi, so:

```
# vi *.cfg
```

Some tips about configuring these files:

You will have to remove any hosts, services, or service groups that you aren't planning on using, or to comment them out, or Nagios will complain about them when it starts up.

You can leave the 'define command' stanzas in checkcommands.cfg alone, though.

Most of the defaults in various configuration files are already sane, so uncomment them.

Don't worry about resources.cfg right now. We'll come back to it later.

Also ignore the database-specific portion of cgi.cfg (at the end) but do work on most of that config file.

Alter any options to your liking -- for instance, I changed the notifications from workhours to 24x7, and enabled my nagios admin account for getting full viewing/modifying access.

It's trivial to add an entry for ssh (nagios-plugins ebuild already comes with check_ssh) in checkcommands.cfg, if you like.

My suggestion for the first-time Nagios admin is to start out very, very small with services and hosts. Suggestion: 1 service (ping), 1 host (same machine), no host groups. You can always add in all the hosts/services you want later, once all this is fully working.

So I defined a service in services.cfg that calls check_ping for the same machine the Nagios server runs on, and defined the host information in hosts.cfg. That's the most basic setup you can have for services/hosts.

How to configure Apache:

Nagios also requires a web server -- I chose apache2.

If you haven't installed apache 2.0, then:

```
# emerge apache
```

To enable Nagios in Apache 2:

```
# vi /etc/conf.d/apache2
```

And change APACHE2_OPTS to include -D NAGIOS

You need to create at least one Nagios user that will have access to the web site. This assumes you have not created the file previously:

```
# htpasswd2 -c /etc/nagios/htpasswd.users nagadm
```

(and enter the desired password when prompted above.)

If you want to add more users, do not use the '-c' flag to htpasswd2. -c means create, which will overwrite if the file already exists.

For long-term administrative ease, I also created a group file:

```
# vi /etc/nagios/htpasswd.group

nagios: nagadm foobob johndoe janedoe
```

Set up a .htaccess file to actually apply the access control:

```
# vi /usr/nagios/sbin/.htaccess

AuthName "Nagios Access"

AuthType Basic

AuthUserFile /etc/nagios/htpasswd.users

AuthGroupFile /etc/nagios/htpasswd.group

require group nagios
```

How to configure MySQL:

Now you need to set up the initial MySQL database tables (assuming this is the first time you've installed it on your machine):

```
# mysql_install_db
```

Now you need to set a password for the MySQL user named 'root' to avoid getting easily cracked. Pick a well chosen password, please.

To do this, you need to start the MySQL server:

```
# /etc/init.d/mysql start
```

Now do the actual password creation for the root DB user:

```
# mysqladmin -u root -h <FQDN hostname of your machine> password <MySQL's root password>

# mysqladmin -u root password <MySQL's root password>
```

The password for the root account is NOT the same as what you will use for Nagios! Do NOT use the same password for both! Also, do NOT use the same root password for /etc/shadow as the same root password for the DB user named 'root'!

MySQL will run on port 3306, but will bind to 127.0.0.1 by default (according to /etc/mysql/my.cnf) for security reasons. This is fine, since Nagios runs on the same machine in my single-machine setup.

If your Nagios and MySQL setups are on separate machines, then you will obviously need to adjust your configs to point to the right place and also apply some sort of security filtering (e.g. iptables, router ACLs, etc) as a final layer of protection. YOU DO NOT WANT TO GET HACKED!

But if you run MySQL and Nagios on the same machine, then you have no need to adjust anything else.

Create the Nagios database itself -- it will be devoid of tables; we'll get to that shortly:

```
# mysqladmin -u root -p create nagios
```

(We do not need to name it nagios. You could call it icecream if you wanted, as long as all the config files and grant SQL statements matched the chosen database name. But since I'm boring, we'll use nagios as the database name for Nagios.  :Very Happy:  )

Having created the Nagios DB, we now need to create the various tables in it:

```
# mysql -u root -p

mysql> use nagios

mysql> source /usr/nagios/contrib/database/create_mysql

mysql> quit
```

Now you need to:

1) Invent a DB username and password for the Nagios stuff to dump info in  the DB

2) Invent a different DB username and password for the Nagios *CGIs* to read information from the DB

The user/pass for #1 and #2 should be different, especially since they have different needs, access, and privileges.

Pick any username/password you like -- it will reside only in the DB, and not in /etc/passwd on your machine.

For #1, I chose nagios-db. For #2, I chose nagios-cgi.

We will now create these users in the DB with 'vi mknagios-sql.sh':

```
#!/bin/sh

# Name: mknagios-sql.sh

#

# Purpose: This file will ask the user for the Nagios DB user/pass and

# for the Nagios CGI user/pass, then generate a file with the SQL

# statements required to set up access for both users.

#

# How to run: This script takes no input arguments; it prompts for the info.

#

# Note: This assumes Nagios and MySQL will be running on the same

# server. If this assumption is false, then modify nagios_host variable to

# match the FQDN hostname of the Nagios server.

#

# License: Public domain with no redistribution or modification limitations.

# Clean up stuff in case we abort due to ctrl-c'ing out early

trap "stty echo ; rm -f /tmp/mknagios.sql >/dev/null 2>&1 ; exit 1" 2

# Define key variables

outfile="/tmp/mknagios.sql"

nagios_host="localhost"

dbusr_tables="hostdowntime servicedowntime hostcomments servicecomments"

dbusr_tables="${dbusr_tables} programstatus hoststatus"

dbusr_tables="${dbusr_tables} servicestatus programretention"

dbusr_tables="${dbusr_tables} hostretention serviceretention"

cgiusr_tables="hostdowntime servicedowntime hostcomments servicecomments"

cgiusr_tables="${cgiusr_tables} programstatus hoststatus servicestatus"

cgiusr_tables="${cgiusr_tables} hostextinfo serviceextinfo"

# If the output file already exists from a previous run, be nice and

# move it out of the way instead of nuking it.

mv -f ${outfile} ${outfile}.old >/dev/null 2>&1

# Inform the user they may accept default usernames but MUST enter a password

echo "Note: you may press enter for the username choices if you accept the"

echo "suggested default names."

echo

echo "You MUST enter a password, and the passwords echo SHOULD be different."

echo

# Ask for desired nagios DB username

echo -n "Please enter the Nagios DB username: [nagios-db] "

read dbusr

# Select the default username if user pressed return to accept it

if [ -z "${dbusr}" ]; then

        dbusr="nagios-db"

fi

# Ask for desired nagios DB password

echo -n "Please enter the Nagios DB password: "

stty -echo

read dbpass

stty echo

echo

echo

# Did the user enter a password? If not, bail out

if [ -z "${dbpass}" ]; then

        echo "Oops. You didn't enter a password. Exiting."

        exit 1

fi

# Ask for desired nagios CGI username

echo -n "Please enter the Nagios CGI username: [nagios-cgi] "

read cgiusr

# Select the default username if user pressed return to accept it

if [ -z "${cgiusr}" ]; then

        cgiusr="nagios-cgi"

fi

# Ask for desired nagios CGI password

echo -n "Please enter the Nagios CGI password: "

stty -echo

read cgipass

stty echo

echo

echo

# Did the user enter a password? If not, bail out

if [ -z "${cgipass}" ]; then

        echo "Oops. You didn't enter a password. Exiting."

        exit 1

fi

# Create output file with SQL statements

for table in ${dbusr_tables}

do

        (echo -n "GRANT select,insert,update,delete"

         echo -n " ON nagios.${table}"

         echo -n " TO '${dbusr}'@'${nagios_host}'"

         echo -n " IDENTIFIED BY '${dbpass}';"

         echo ) >> ${outfile}

done

for table in ${cgiusr_tables}

do

        (echo -n "GRANT select"

         echo -n " ON nagios.${table}"

         echo -n " TO '${cgiusr}'@'${nagios_host}'"

         echo -n " IDENTIFIED BY '${cgipass}';"

         echo ) >> ${outfile}

done

(echo -n "GRANT lock tables ON nagios.* TO '${dbusr}'@'${nagios_host}'"

echo " IDENTIFIED BY '${dbpass}';" ) >> ${outfile}

(echo -n "GRANT lock tables ON nagios.* TO '${cgiusr}'@'${nagios_host}'"

echo " IDENTIFIED BY '${cgipass}';" ) >> ${outfile}

echo "FLUSH PRIVILEGES;" >> ${outfile}

# Inform user the file is ready and where to pick it up.

echo "You may use ${outfile} for the next step of Nagios+MySQL

installation."

# We're done, go in peace.

exit 0
```

To run the script:

```
# chmod 700 mknagios-sql.sh

# ./mknagios-sql.sh

Note: you may press enter for the username choices if you like the

suggested default names.

You MUST enter a password, and the passwords echo SHOULD be different.

Please enter the Nagios DB username: [nagios-db] 

Please enter the Nagios DB password: 

Please enter the Nagios CGI username: [nagios-cgi] 

Please enter the Nagios CGI password: 

You may use /tmp/mknagios.sql for the next step of Nagios+MySQL installation.
```

Some comments about the script's generated SQL statements:

FLUSH PRIVILEGES is to make MySQL apply the GRANTs immediately. Saves us from having to restart MySQL!

Also, note that the access specifies it will be done via localhost, which is what we want if we're running Nagios and MySQL on the same machine. If this is not the case, then change localhost to whatever hostname or IP the SQL stuff from Nagios will come from.

Why do we not do the GRANT select ON nagios.* TO 'nagios-cgi'? Because the CGI only needs select access on certain tables. Likewise for the nagios-db user. So to remain secure, we spend a little more time and effort to specify the full table name instead of wildcarding it.

The GRANT lock tables SQL statement is specific to MySQL with a BerkDB database. It is needed by nagios-db to briefly lock the db from changes long enough to insert new data then unlock. That way, the CGI won't get partial data during a query.

This is required because MySQL doesn't have transactional processing with BerkDB databases, though it does support transactions with an InnoDB database. Long story made short: the default MySQL ebuild will use a BerkDB database by default.

If you are using PostgreSQL, the GRANT lock tables stuff may or may not apply. 

Now we will actually execute these SQL statements by:

```
# mysql -u root -p

mysql> source /tmp/mknagios.sql
```

It should output a bunch of lines saying 'QUERY OK, 0 rows affected'. If it didn't, then you likely have a problem somewhere... especially if it complains of a SQL syntax error. If any problems pops up, fix them before proceeding further.

Let's go back to a key Nagios config file now:

```
# vi /etc/nagios/resource.cfg
```

Basically, uncomment everything.

I'm not sure if you need $USER3$ and $USER4$, so can probably leave these commented out. I haven't seen any issues from leaving them commented out, and I see no references to $USER3$ or $USER4$ in any of the Nagios config files, so I think we're safe leaving these two lines commented out.

Change all *_host references to point to localhost (unless the SQL server is on a separate machine or IP).

Change all *_port to 3306 (MySQL default port, unless otherwise configured).

Change all *_database to nagios (unless you used a different database name in the CREATE and GRANT stuff from earlier).

Change all *_username to nagios-db

Change all *_password to the password chosen for nagios-db

Now, edit one more file:

```
# vi /etc/nagios/cgi.cfg
```

Do similar changes for the *_host/*_port/*_database/*_username like you did with resource.cfg.

Only, this time, use nagios-cgi as the username and whatever password you chose for the nagios-cgi user.

nagios-db and nagios-cgi SHOULD NOT have the same password!

Getting ready to start up everything:

Start the web server:

```
# /etc/init.d/apache2 start
```

Since we installed Nagios with MySQL support, I would suggest modifying the init startup script to ensure it will start the database before starting Nagios.

```
# vi /etc/init.d/nagios
```

...and change depend() to read:

```
depend() {

need net mysql

use dns logger

after mysql

}
```

There is a small chance you would need to add a 'sleep 2' statement to the beginning of the start() function if your MySQL database doesn't fully initialize quickly enough before Nagios runs. You probably don't want to add this unless you notice problems with Nagios starting and trying to do stuff before the database has fully loaded.

One last thing before starting Nagios... let's check the configs for sanity:

```
# /usr/nagios/bin/nagios -v /etc/nagios/nagios.cfg
```

It MUST have 0 errors, and SHOULD have 0 warnings.

I would strongly recommend you edit the config files in /etc/nagios if necessary until you have both 0 errors and 0 warnings.

-v is the mode where Nagios only checks the configs for sanity. It does not start up when -v is specified.

And now, the grand finale:

```
# /etc/init.d/nagios start
```

It should automatically start MySQL if it isn't already running, and then start Nagios.

If everything went well, you can fire up your favorite web browser and go to http://localhost/nagios

Click on any of the links along the left side to check them out, though I'm particularly fond of the 'Service Detail' link. (It may take a minute or two for the very first Nagios run to poll data.)

Clicking on various links should prompt you for an user/pass to enter; enter nagadm and whatever password you created with htpasswd2 before. 

I made up 'nagadm', but it could be any username you wanted -- 'foobar' is fine, as long as it's in the nagios group list in htpasswd.group and has an encrypted password in htpasswd.users.

Once you have entered an username/password that is valid at the browser's auth dialog box (when prompted), you won't need to enter it again for a while.

If you want Nagios/MySQL to start at boot time, permanently:

```
# rc-update add nagios default
```

(No need to do a rc-update for MySQL since Nagios will start it if necessary.)

You probably also want to make sure your web server starts at boot time:

```
# rc-update add apache2 default
```

It is not required to have a web server running to enjoy some of Nagios' benefits since Nagios will, on its own, send email/pages and execute actions. But without a web server running, it's hard to keep a close eye on things. So I highly recommend running a web server.

Documentation:

http://127.0.0.1/nagios/docs/toc.html

http://www.nagios.org/docs/

http://dev.mysql.com/doc/mysql/en/index.html

http://httpd.apache.org/docs-2.0/

Stuck? Having problems?

With something as involved as this, and many 'moving parts', it is quite likely that something will not work. Don't get frustrated and lose hope! It took me a few hours to figure out everything.

If you get really stuck, just post a query on the 'Other Things Gentoo' forum, detail what you've done (step by step), any error messages that seems relevant, along with the output of:

```
# qpkg -I -v nagios

# qpkg -I -v mysql

# emerge -pv nagios-core

# emerge -pv mysql
```

(You will need to 'emerge gentoolkit' to get qpkg if you haven't already done that. HIGHLY recommended.)

Useful log files to look at would be:

/var/log/mysql/mysql.log

/var/nagios/nagios.log

mysql.log will only exist if you temporarily enable SQL query logging by uncommenting the 'log = /var/log/mysql/mysql.log' line in /etc/mysql/my.cnf, and then doing '/etc/init.d/mysql restart'.

You REALLY SHOULD disable SQL query logging (and then restart mysql) as soon as the problem is resolved because it can grow in size fast and eat a lot of disk I/O, slowing down overall system performance. (For a single user workstation, no big deal. Could be more of an issue on a really busy large production server.)

You probably only need to enable SQL query logging if you're getting SQL access errors in the Nagios logs and don't have enough detail to see what user the CGI is logging in to MySQL as, what the queries are, which tables, etc.Last edited by dsf on Thu Dec 09, 2004 6:00 am; edited 7 times in total

----------

## ali3nx

Hey thanks ! Solar has a very nice eggdrop plugin for nagios that may be of interest. I think it's in his devspace. I've been meaning to use nagios for some time but alas a tutor is everyone's best learning aid  :Embarassed: 

----------

## Esteban

Hi,

I followed all your HowTo... All runs quite well...

My only problem is I don't get /var/nagios/status.log file...

Do you have the same problem ?

----------

## grimm26

 *Quote:*   

> Having created the Nagios DB, we now need to create the various tables in it by:
> 
> Code:
> 
> # /usr/nagios/contrib/database/create_mysql
> ...

 

That file is not an executable script.  How do I  use it?  I tried sourcing it from within the mysql interface, but it errored.

----------

## dsf

Oops! That was the only step I couldn't remember how exactly I'd done it except it was straightforward. Sorry about that.

Let's see... looks like you can try:

```
# mysql -u root -p

mysql> use nagios

mysql> source /usr/nagios/contrib/database/create_mysql

mysql> quit
```

If that doesn't work, let me know, and I'd be happy to redo the install steps on a clean setup to double check the right way.

----------

## grimm26

Looks like that was it.  thanks!

----------

## dsf

Cool, thanks for the update. I've updated the original post to reflect the changes.

----------

## dsf

 *Esteban wrote:*   

> 
> 
> My only problem is I don't get /var/nagios/status.log file...
> 
> Do you have the same problem ?

 

Nagios doesn't have status.log. It has nagios.log.

Are you missing /var/nagios/nagios.log ?

If so, is the /var/nagios directory owned by user nagios and group nagios and has user write permissions enabled?

Here's what it looks like on my machine:

```
% ls -l /var/nagios

total 8

drwxr-xr-x  2 nagios nagios  192 Dec  7 00:00 archives

-rw-r--r--  1 root   root      6 Dec  5 05:35 nagios.lock

-rw-r--r--  1 nagios nagios 1203 Dec  7 17:35 nagios.log

drwxr-xr-x  2 nagios apache   72 Dec  4 05:05 rw

-rw-r--r--  1 nagios nagios    0 Dec  5 05:35 status.sav
```

----------

## dsf

I wrote a script, mknagios-sql.sh that generates the SQL statements used to create the Nagios SQL users and permissions.

Reason? Because it was a lot easier to set up the user/pass and statements with a script doing the hard work than to hand-edit the file.

So I've put that script in the HOWTO.

If you've already done 'source mknagios.sql' then you don't need to bother with this script.

If you haven't done that step yet, then the script will help a lot.

----------

## Esteban

In the main configuration file (/etc/nagios/nagios.cfg), I have the line : 

```
status_file=/var/nagios/status.log
```

I have this on my machine :

```
ls -al /var/nagios/

total 8

drwxr-xr-x   4 nagios nagios 216 déc  8 00:00 .

drwxr-xr-x  17 root   root   464 déc  7 21:15 ..

drwxr-xr-x   2 nagios nagios 112 déc  8 00:00 archives

-rw-r--r--   1 nagios nagios   0 déc  7 21:35 .keep

-rw-r--r--   1 root   root     6 déc  7 23:47 nagios.lock

-rw-rw-r--   1 nagios nagios  33 déc  8 00:00 nagios.log

drwxr-xr-x   2 nagios apache 104 déc  7 23:47 rw

-rw-r--r--   1 nagios nagios   0 déc  7 23:47 status.sav
```

----------

## dsf

 *Esteban wrote:*   

> In the main configuration file (/etc/nagios/nagios.cfg), I have the line : 
> 
> ```
> status_file=/var/nagios/status.log
> ```
> ...

 

Ahhh! I see what you mean. What you describe is okay to have, because the comment above that line in nagios.cfg says:

```
# STATUS FILE

# This is where the current status of all monitored services and

# hosts is stored.  Its contents are read and processed by the CGIs.

# The contentsof the status file are deleted every time Nagios

#  restarts.
```

So deletion at startup time is normal, and I think the CGIs reads the status data from the MySQL database instead of from that flat file.

For example, the MySQL database has these status databases: programstatus, hoststatus, and servicestatus.

My guess is that if you had run Nagios without MySQL or PostgreSQL database support, then Nagios would write data to that file instead of inserting data in the database and CGIs would read from that file.

But because we use MySQL,  Nagios writes status information to the MySQL database, and CGIs query the database for that stored information instead of from a flat file.

So I think that what you noticed is actually not a problem. I'm not a big expert on Nagios' inner workings, but that is my hypothesis.

----------

## Ox-

I'm finally getting nagios configured the way I want it, but can't seem to get the icons and background image working for the status map.  In the meantime, while I'm trying to figure that out, anyone know where I can get a good gentoo icon to use for my gentoo hosts in the status map?

----------

## dsf

 *Ox- wrote:*   

> I'm finally getting nagios configured the way I want it, but can't seem to get the icons and background image working for the status map.  In the meantime, while I'm trying to figure that out, anyone know where I can get a good gentoo icon to use for my gentoo hosts in the status map?

 

Looks like a nice one:

http://www.thinkwiki.org/images/7/72/Gentoo_logo.png

...and to convert it into something that can be used:

```
$ pngtogd2 Gentoo_logo.png Gentoo_logo.gd2 0 1
```

If you don't have pngtogd2 already installed, you can do:

```
# emerge media-libs/gd
```

Also, some more image packs for other stuff:

```
http://www.nagiosexchange.org/Image_Packs.75.0.html
```

I haven't perfected it yet, but you can get images loaded by:

```
$ mysql -u root -p

mysql> use nagios

mysql> INSERT INTO hostextinfo (host_name, icon_image, gd2_icon_image) \

        VALUES ('myhostname','Gentoo_logo.png','Gentoo_logo.gd2');

mysql> quit
```

(substitute 'myhostname' for whatever host is listed in /etc/nagios/hosts.cfg -- i.e., which host you want to have the Gentoo logo.)

Put the files in /usr/nagios/share/images/logos/ and make sure that httpd can read them.

I have only one issue with this image... it's displayed off-center. I'm not sure if you need to adjust x_2d and y_2d in the SQL table or not. I tried setting both to 0 (0,0 = origin at upper left corner) but didn't seem to help. Not sure if problem is due to image size or positioning.

Also, someone suggested that you make the image transparent before converting it into a GD2 image. For example:

```
$ pnmtopng -transparent rgb:ff/ff/ff Gentoo_logo.pnm > Gentoo_logo.png
```

I don't think transparency works out too well for this particular image.  :Smile: 

----------

## Ox-

Ah, I see.  I was trying to add the hostextinfo in cgi.cfg and then trying the extended template way with hostextinfo.cfg.  Didn't think it would come from the database   :Wink: 

Yeah, that logo needs a bit of work, so I'm just using linux40.gd2 for now.  I'll work on the logo soon when I have a free moment.

Still can't get statusmap_background_image working, but that's not critical   :Laughing: 

Thanks!

----------

## dsf

Ugh... I should note my instructions are for Nagios 1.3.

I just found out that 2.0 drops support for MySQL and PostgreSQL  :Sad: 

I can understand the reasoning -- one less thing to confuse first-timers; most of whom won't use or don't need a SQL back-end.

The Nagios maintainer says it should be possible to support SQL through the new event broker mechanism, though nobody has yet written SQL-specific code for that.

Just something to keep in mind.

----------

## no_hope

 *Esteban wrote:*   

> 
> 
> My only problem is I don't get /var/nagios/status.log file...
> 
> 

 

This happens when Nagios is using a database to store its data:

http://www.nagios.org/faqs/viewfaq.php?faq_id=170

In 1.2 ebuild of nagios the script is broken, so you have to edit /usr/nagios/libexec/check_nagios_db.pl and make the $CFG_DEF variable to point to your cgi.cfg

----------

## tecknojunky

Man, this is like doing a medecine degree so you can put a plaster on.

Anything simpler?  I find Nagios utterly complicated with a complex syntax, completely unintuitive. Gee, with all the CMS out there, it astound me to find a web apps that must be configured thrue config files.

I'm giving up on Nagios, until they make it simpler to setup and maintain.

----------

## ghettodev

thanks for the howto, got mine up and running.  only problem was perms in /etc/nagios.  files werent set to 644.

----------

## ryanmr

Great job on the walkthrough. I've got Nagios running fine with one exception. I keep seeing: "Warning: Monitoring process may not be running!". Being an idiot, I cant figure out how to fix this. Any ideas?

Thanks!

===EDIT===

Ok, I did some more poking around and found that nothing is ever being written to /var/nagios/status.log

I checked nagios.cfg and this is the file that is specified there so now I'm really stumped. Anyone have any idea why the file just isnt being written? everything else on Nagios is working so why not this?

-ryanmr

----------

## Zentoo

Hi !

   Really a great howto !!! i've start to configure nagios several times but never finish it dues to a lack of mysql skills.

So you save me so lot !!! a huge thanx !

  Everythings go smoothly but i get a problem, once i connect to the web server, everythings is ok but i can't acces some items on the left menu. They are:

   Reporting:

       - Network Outages

       - Process Info

       - Scheduling Queue

       - Event Log

   Configuration:

       - View Config

and if i click on it, i get this kind of message:

 *Quote:*   

> It appears as though you do not have permission to view the configuration information you requested...
> 
> If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
> 
> and check the authorization options in your CGI configuration file.

 

Did i get something wrong ?

If you have some clues to detect the problem, i'm listening ...

[EDIT][SOLVED]

It was my mistake, i have fill a wrong user in /etc/nagios/cgi.cg.

So everything is OK.

[/EDIT][/SOLVED]

----------

## njcwotx

 *Quote:*   

> It appears as though you do not have permission to view the configuration information you requested... 
> 
> If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI 
> 
> and check the authorization options in your CGI configuration file.

 

It appears I have this error too, nothing else appears wrong and the sanity check works without any errors.  I checked my user names but I see no problems.  I will continue to poke around myself, but if anyone has some tidbits of wisdom I would be happy to check them out.  Thanks.

PS...I have disabled CGI authentication for now (in cgi.cfg) and all works well.  Now only to figure out where I screwed it up.

OK, One more edit on my part...

I think I may have missed something in the cgi.cfg obviously.  When following the instructions on the how to, I only uncommented the stuff below 'DG EXTENDED DATA' section.  Perhaps I missed something along the way, is there any other options that should have the comment removed?

----------

## Zentoo

ôk could u put your cgi.cfg somewhere on internet to check it ?

 For me, there is another problem right now:

i get this on the upper left corner on each page in the little tabloid:

```
Warning: Monitoring process may not be running!

Click here for more info.

```

and if i click on  *Quote:*   

> Process Information

  item, i get this on the upper right corner:

```

Process Commands

It appears as though Nagios is not running, so commands are temporarily unavailable... 
```

and on the bottom:

```
Process Status:   

  UNKNOWN  

Check Command Output:    Nagios check command did not return any output 

```

Nagios is running since all the item and probes are displayed on the board... Process Status Information

What should it display there ?

what's wrong in my configuration ?

i don't understand since everything works great but i though there are maybe the lack of some functionality dues to this error...

Any Idea ?

----------

## njcwotx

search the cgi.cfg, there is a section that mentions something about getting the monitoring process error.  I saw it when I was looking through it for my problem.  Dont know if it will help you, but I did see something.

----------

## pava_rulez

Hi, why can't I see nagios icons in the status map? Am I missing something??

EDIT: solved, I had to work with mysql statements...

----------

## njcwotx

I got it working, but I cant access nagios from a browser via another workstation.  I can access fine from the server itself.  Apache is running and I made the configuration in the instructions above.

[Solved]

added .htaccess to /usr/nagios/share

----------

## njcwotx

when I try to execute a command from the web interface, I get

 *Quote:*   

>  "Error: Could not open command file '/var/nagios/rw/nagios.cmd' for update!"

 

Playing with permissions, I found as a test I could 

```
'chmod 777 /var/nagios/rw/nagios.cmd' 
```

and get it to work.  however eventually it will change back to this...

```
prw-rw----  1 nagios nagios     0 Aug 9 13:30 nagios.cmd
```

So, I am having some form of permissions problem.

---added later --

apparently if I set rw to all others, it will work, so I must not be settings a user setup correctly..

[Solved]

added apache user to nagios group.  sounds like a security hole to me...if anyone has anything better.

----------

## jmarcus

Not sure if I missed this information in the thread but here is the stuff I needed to put in commonapache2.conf

```
###

### Nagios Stuff

###

ScriptAlias /nagios/cgi-bin/ /usr/nagios/sbin/

<Directory "/usr/nagios/sbin">

    AllowOverride AuthConfig

    Options ExecCGI

    Order allow,deny

    Allow from all

</Directory>

Alias /nagios /usr/nagios/share

<Directory "/usr/nagios/share">

    Options NOne

    AllowOverride AuthConfig

    Order allow,deny

    Allow from all

</Directory>
```

```
/etc/init.d/apache2 restart
```

----------

## morlix

i have exactly the same problem as Tuttle.

if i executed the nagios_check_command on the shell i get

```
Nagios ok: located 1 process, status log updated 15 seconds ago
```

i searched and searched and searched, but i didn´t find a error...

does someone know how to get this fixed?

grZ morlix

*** Update ***

if i disable the nagios_check_commnd everything is working fine, except that i become the following message

Check Command Output: 	No process check command has been defined in your CGI configuration file.

Nagios process is assumed to be running properly.

----------

## richard.scott

I had the same problem and this fixed it for me:

```
#chmod +rx -R /usr/nagios/libexec/
```

it seems that the execution rights for the plugins are restricted to just the group and owner of nagios.

so another way to fix it is to add apache to the nagios group with the following if you want to keep the restrictive execution rights on the plugins:

```
usermod -g apache -G nagios apache
```

----------

## JofCore

Hello, 

I have manually installed Nagios 2.0b4 on my Gentoo box (2.0 wasn't in portage...).  Everything is configured and working great, but I have one problem:  Nagios won't start on boot.

when the machine boots, I see all the services being started fine, but when it gets to nagios, all I get is the syntax of the startup script:

```
Usage: nagios {start|stop|restart|reload|force-reload|status}

```

instead of the normal "ok" or "!!" indicator.

After the machine boots, I checked it out and sure enough nagios wasn't running.  The /etc/init.d/nagios startup script runs fine if I run it as root from the CLI though...

Upon further investigation, I believe I know why it's not starting on boot, but I don't know how to fix it.  I looked @ the top of the nagios init script and noticed that the bang line is using #!/bin/sh instead of #!/sbin/runscript like most of the gentoo startup scripts do.  If I change the bang line to #!/sbin/runscript, then I get the same behaviour out of the script that I'm seeing on boot (only displays the syntax).

Also, I have noticed that the "rc-status" command on gentoo never shows nagios running, even if it is:

```
sendmail                                                            [ started ] 

snmpd                                                               [ started ] 

named                                                               [ started ] 

tomcat5                                                             [ started ] 

distccd                                                             [ started ] 

gkrellmd                                                            [ started ] 

ntpd                                                                [ started ] 

lm_sensors                                                          [ started ] 

nagios                                                                [   off ]
```

And nagios is definately running:

```
/etc/init.d/nagios status

  PID TTY          TIME CMD

 9415 ?        00:01:53 nagios

```

So I guess what I'm wondering is what needs to be changed in the init script to make it work better w/gentoo.  As I said, I tried changing the bang line to #!/sbin/runscript, but that just makes the script not run at all...  I'm assuming that the ebuild (1.0) version of Nagios doesn't exhibit these problems that I'm seeing(?)

I can post the init script too if need be, just didn't want to make this too big if it wasn't needed.

Thanx!

k

----------

## grimm26

Check out the Gentoo doc on init scripts for info on writing a proper init script.  Check out the 1.x init script at /usr/portage/net-analyzer/nagios-core/files/nagios.  You may be able to pretty much copy that one.  I haven't tried 2.0, so I don't know.

----------

## JofCore

 *grimm26 wrote:*   

> Check out the Gentoo doc on init scripts for info on writing a proper init script.  Check out the 1.x init script at /usr/portage/net-analyzer/nagios-core/files/nagios.  You may be able to pretty much copy that one.  I haven't tried 2.0, so I don't know.

 

Thanks for the good info.  I knew there was an init script for v1, but I didn't know where it was kept.

I have modified the init script for nagios, using the v1 init script as a guide.  I believe that I now have a working nagios v2 gentoo init script.

Here it is if anyone else is interested: 

(you'll probably want to modify the "prefix" var to match wherever u have nagios installed... I have it installed in a vhost dir which isn't exactly the "standard"  :Smile:  )

```
#!/sbin/runscript

# 

# chkconfig: 345 99 01

# description: Nagios network monitor

#

# File : nagios

#

# Author : Jorge Sanchez Aymar (jsanchez@lanchile.cl)

#   modified for Gentoo 20051019 kmh

# 

# Changelog :

#

# 1999-07-09 Karl DeBisschop <kdebisschop@infoplease.com>

#  - setup for autoconf

#  - add reload function

# 1999-08-06 Ethan Galstad <nagios@nagios.org>

#  - Added configuration info for use with RedHat's chkconfig tool

#    per Fran Boon's suggestion

# 1999-08-13 Jim Popovitch <jimpop@rocketship.com>

#  - added variable for nagios/var directory

#  - cd into nagios/var directory before creating tmp files on startup

# 1999-08-16 Ethan Galstad <nagios@nagios.org>

#  - Added test for rc.d directory as suggested by Karl DeBisschop

# 2000-07-23 Karl DeBisschop <kdebisschop@users.sourceforge.net>

#  - Clean out redhat macros and other dependencies

# 2003-01-11 Ethan Galstad <nagios@nagios.org>

#  - Updated su syntax (Gary Miller)

# 2005-10-19 Kevin Hanser <gentoo@hanser.org>

#  - Modified script for use on Gentoo, based on original nagios v2 

#   init script, and nagios v1 Gentoo init script

#

# Description: Starts and stops the Nagios monitor

#              used to provide network services status.

#

opts="${opts} reload checkconfig"

depend() {

   need net

}

  

prefix=/var/www/vhosts/nagios

exec_prefix=${prefix}

NagiosBin=${exec_prefix}/bin/nagios

NagiosCfgFile=${prefix}/etc/nagios.cfg

NagiosStatusFile=${prefix}/var/status.dat

NagiosTempFile=${prefix}/var/nagios.tmp

NagiosRetentionFile=${prefix}/var/retention.dat

NagiosCommandFile=${prefix}/var/rw/nagios.cmd

NagiosVarDir=${prefix}/var

NagiosRunFile=${prefix}/var/nagios.lock

NagiosLockDir=/var/lock/subsys

NagiosLockFile=nagios

NagiosCGIDir=${exec_prefix}/sbin

NagiosUser=nagios

NagiosGroup=nagios

          

reload()

{

   checkconfig || return 1

   ebegin "Reloading configuration"

   killall -HUP nagios &>/dev/null

   eend $?

}

checkconfig() {

   # copied from Gentoo's init script for nagios v1 and modified

   # Silent Check

   $NagiosBin -v $NagiosCfgFile &>/dev/null && return 0

   # Now we know there's problem - run again and display errors

   $NagiosBin -v $NagiosCfgFile

   eend $? "Configuration Error. Please fix your configfile"

}

start() {

   checkconfig || return 1

   ebegin "Starting network monitor: nagios"

   su - $NagiosUser -c "touch $NagiosVarDir/nagios.log $NagiosRetentionFile"

   #chown $NagiosUser:$NagiosGroup $NagiosRunFile

   rm -f $NagiosCommandFile

   start-stop-daemon --quiet --start \

      --startas $NagiosBin \

      --pidfile $NagiosRunFile \

      -- -d $NagiosCfgFile

   eend $?

}

stop() {

   ebegin "Stopping network monitor: nagios"

   start-stop-daemon --quiet --stop \

      --pidfile $NagiosRunFile

   rm -f $NagiosStatusFile $NagiosTempFile $NagiosRunFile $NagiosLockDir/$NagiosLockFile $NagiosCommandFile

   eend $?

}

svc_restart() {

   checkconfig || return 1

   ebegin "Restarting nagios"

   svc_stop

   svc_start

   eend $?

}

# End of this script

```

----------

## wan-geek

I've noticed this behavior on recent builds.  Seems that something has changed w. mysql that it no longer accepts the "default value" that is set in the db create script.

```

CREATE TABLE hostcomments (

   hostcomment_id int(11) DEFAULT '0' NOT NULL auto_increment, <--- problem line ---

   host_name varchar(75) NOT NULL,

   entry_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,

   persistent tinyint(4) DEFAULT '0' NOT NULL,

   author_name varchar(75) NOT NULL,

   comment_data blob NOT NULL,

   PRIMARY KEY (hostcomment_id)

);

```

When I edit the create_mysql script to the following, everything works ok again.

```

hostcomment_id int(11) NOT NULL auto_increment,

```

(obviously for all other code stanzas as well)

Anyone else seeing this or know the cause? This system is less than 2 weeks old.

Cheers,

-Chris

----------

## jasewong

hi all,

i have a similar problem.... nagios is running fine... except on the web page, it says nagios is not running.  then i noticed that, when i start apache2, it complains about fqdn.  then i modify my hosts file to include my fqdn.  finally, all working properly.  thanks.

----------

## demonpengu

Hi all,

I have been running nagios-1.2-r4 fine for months now, however did an update the other day which upgraded to 1.3, and suddenly all the hostextinfo stopped working.  It is all setup in the database.  Any ideas?

Thanks

Andy

----------

## f0llia

hi,

i've installed and configured nagios as in the how to but when i go to the web interface (http://localhost/nagios) and i select devide details or something else in the menu in the left it requires autentication, i put my user: nagiosadmin and passwd but it don't autenticate me.. it requires another time user and pass...

what's wrong ??   :Crying or Very sad: 

----------

## xenoscr

Hey,

I just got everything up and running with the exception of the hostextinfo. I added entries for my servers in the hostextinfo table and when I run a query to display it, it looks fine. I have added gif, png, and gd2 images. The logo files are located in /usr/nagios/share/images/logos and are owned by apache:apache and have permissions set to 644.

I do not see any errors in the Apache or Nagios log files in /var/log. Is there another place in the database that I need to look for errors now that I am using MySQL as opposed to the flat file method that I was more familiar with?

I'm at work now and can not access my Nagios server to get any specific information from it now but, if there are any configs or information that I can provide to help you help me I would be happy to provide it as soon as I am back home.

XeNoS

----------

## xenoscr

 *xenoscr wrote:*   

> Hey,
> 
> I just got everything up and running with the exception of the hostextinfo. I added entries for my servers in the hostextinfo table and when I run a query to display it, it looks fine. I have added gif, png, and gd2 images. The logo files are located in /usr/nagios/share/images/logos and are owned by apache:apache and have permissions set to 644.
> 
> I do not see any errors in the Apache or Nagios log files in /var/log. Is there another place in the database that I need to look for errors now that I am using MySQL as opposed to the flat file method that I was more familiar with?
> ...

 

I was able to work around this. After doing some digging, it seems that the 1.x versions have trouble reading the "hostextinfo" from the mysql database. I used the "xedtemplate_config_file" method of adding a hostextinfo.cfg file to my cgi.cfg file and all was right again.

XeNoS

----------

## bluland

thats my problem my nagios running (almost) normally but the service command says: "It appears as though Nagios is not running, so commands are temporarily unavailable..."

Anybody has some ideas??

thanks for all advices...

best regard

ENzo

----------

## BrassMan83

/usr/nagios/contrib/database/create_mysql does not exist on the latest version of Nagios. There isn't even a contrib directory. I know all that does is create the tables for Nagios to use, so is there a script or file I could download that will do the equivalent? My knowledge of SQL syntax is minimal at best. Even if all you do is cat /usr/nagios/contrib/database/create_mysql and paste it here, any help is appreciated.

----------

## bluland

thks for ur help im going to serch some info about it.

 :Laughing: 

Enzo

----------

## seblonacs

Hey,

you find the Scripts for SQL at /usr/doc/nagios-core-*/contrib/database/

Bye

seblonacs

----------

## DigiCompI

Based on seblonacs's suggestion above, I found create_mysql in /usr/share/doc/nagios-core-1.3/contrib/database

----------

## tedj

In 2.5, its missing again. There is no sql setup information in /usr/share/doc/nagios-core-2.5/

----------

## njcwotx

This comes from the Nagios FAQ for versions 2.x, I had mysql support for Ntop 1.x and migrated to 2.x recently and did not use mysql and did not notice any terrible degradation or performance problems watching around 350 services on 120 hosts and using cacti and mrtg on the same box.

from the 2.x faq

Native DB Support Dropped - Native support for storing various types of data (status, retention, comment, downtime, etc.) in MySQL and PostgreSQL has been dropped. Stop whining. I expect someone will develop an alternative using the new event broker sometime in the near future. Besides, DB support was not well implemented and dropping native DB support will make things easier for newbies to understand (one less thing to figure out).

----------

## anidabi

I was going throught nagios howto in gentoo-wiki and discovered that this line doesn't work for me: 

```
for file in `ls *-sample`; do new=`echo $file|cut -d"-" -f1`;mv $file $new;done
```

It gave me this output: 

```
mv: cannot stat `\033[00m\033[00mbigger.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mcgi.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mcheckcommands.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mminimal.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mmisccommands.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mnagios.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[00mresource.cfg-sample\033[00m': No such file or directory

mv: cannot stat `\033[m': No such file or directory

```

Any ideas, how to corrent this?

Anyway, I renamed the files manually, since the oneline script didn't work.

----------

## anidabi

 *njcwotx wrote:*   

> 
> 
> from the 2.x faq
> 
> Native DB Support Dropped - Native support for storing various types of data (status, retention, comment, downtime, etc.) in MySQL and PostgreSQL has been dropped. Stop whining. I expect someone will develop an alternative using the new event broker sometime in the near future. Besides, DB support was not well implemented and dropping native DB support will make things easier for newbies to understand (one less thing to figure out).

 

I'm just trying to make nagios work and wiki seems to be a littlebit outdated since I'm installing nagios-2.5, so does this mean I should skip the mysql part all a long?

----------

## anidabi

Anyone, help!

----------

## njcwotx

 *anidabi wrote:*   

> I was going throught nagios howto in gentoo-wiki and discovered that this line doesn't work for me: 
> 
> ```
> for file in `ls *-sample`; do new=`echo $file|cut -d"-" -f1`;mv $file $new;done
> ```
> ...

 

the '\033... stuff is because you are using color in your ls command.. add --color=none and the stat errors should go away.

for file in `ls --color=none *-sample `; do new=`echo $file|cut -d"-" -f1`;mv $file $new;done

I have been out of town lately, but if you still need assistance repost your questions and ill see what I can do for ya.  I have 2.5 version running now.  The old instructions are outdated and are more for version 1.x with sql support.  2.5 without sql seems to run just fine for me performance wise.  In fact, we run mrtg and cacti on the same box and the cpu and network traffic are not too heavily taxed.

----------

## anidabi

How about this error what I get!?

```

[1159482124] Nagios 2.5 starting... (PID=2339)

[1159482124] LOG VERSION: 2.0

[1159482125] You do not have permission to write to /var/run/nagios.pid

[1159482125] Bailing out due to errors encountered while attempting to daemonize... (PID=2339)

```

----------

## njcwotx

Its a permissions problem...ok, I know its kind of obvious..but check these things...

in nagios.cfg find the lock file setting and see where it points...does it post to /var/run/nagios.pid ?

basically from what I can tell, the username setup in the nagios_user and nagios_group must be able to access this lock file.

in my case, I point all the /var stuff to a folder called /var/nagios and give the /var/nagios folder permissions to the user in my nagios_user and nagios_group settings.

let me know if this helps please or you have more questions.

----------

## anidabi

 *njcwotx wrote:*   

> Its a permissions problem...ok, I know its kind of obvious..but check these things...
> 
> in nagios.cfg find the lock file setting and see where it points...does it post to /var/run/nagios.pid ?
> 
> basically from what I can tell, the username setup in the nagios_user and nagios_group must be able to access this lock file.
> ...

 

Yes, this was just the case. Thanks for the information, now it works. I just had to change /var/run/nagios.pid to /var/nagios/nagios.pid.  :Smile: 

But now, I had this in my nagios logs:

```

SERVICE ALERT: localhost;Total Processes;UNKNOWN;SOFT;1;check_procs: Unknown argument - (null)

```

It doesn't seem to be a big problen yet so, I'll have to google about it more later.

Oh, one more thing. Has the config files changet since I didn't have any of those /etc/nagios/timeperiods.cfg, /etc/nagios/contactgroups.cfg, hostgroups.cfg, /etc/nagios/hostgroups.cfg, /etc/nagios/contacts.cfg, /etc/nagios/services.cfg, /etc/nagios/hosts.cfg in my /etc/nagio by default? I had to create them and when I tried to start nagios, it complained duplicate configuration information in /etc/nagios/cgi.cfg. So I had to comment out almost all from there and afterwards I noticed that atleast almost all those config parameter that are in separete files, are in separete section in /etc/nagios/cgi.cfg file. Isn't it more practical to use one big config file rather than several smaller ones?

----------

## njcwotx

 *anidabi wrote:*   

>  *njcwotx wrote:*   Its a permissions problem...ok, I know its kind of obvious..but check these things...
> 
> in nagios.cfg find the lock file setting and see where it points...does it post to /var/run/nagios.pid ?
> 
> basically from what I can tell, the username setup in the nagios_user and nagios_group must be able to access this lock file.
> ...

 

Try this link, its in the right direction.  (the guy responding to the question seems a little terse doesnt he?)

http://www.meulie.net/portal_plugins/forum/forum_viewtopic.php?1437

seems the command in the checkcommands.cfg file for check_procs is looking for 3 arguments, find the "check_local_procs" entry in your services.cfg file and you will find something like "check_command check_local_procs!90!120!Z"  (note this is a correct example I believe, yours may be missing a value in between the !!'s).  Its possible the check command in the services.cfg file does not list the appropriate number of arguments.

 *anidabi wrote:*   

> 
> 
> Oh, one more thing. Has the config files changet since I didn't have any of those /etc/nagios/timeperiods.cfg, /etc/nagios/contactgroups.cfg, hostgroups.cfg, /etc/nagios/hostgroups.cfg, /etc/nagios/contacts.cfg, /etc/nagios/services.cfg, /etc/nagios/hosts.cfg in my /etc/nagio by default? I had to create them and when I tried to start nagios, it complained duplicate configuration information in /etc/nagios/cgi.cfg. So I had to comment out almost all from there and afterwards I noticed that atleast almost all those config parameter that are in separete files, are in separete section in /etc/nagios/cgi.cfg file. Isn't it more practical to use one big config file rather than several smaller ones?

 

Hard to tell.  Thare are changes.  I setup nagios 1.x originally and migrated my files over to the newer 2.x versions.  I can tell you I had them before and had to create them as blank if I remember.  What I found most annoying was that the designer moved some config entries from one file to another and I had to use some fancy editing to fix the configs to several hundred lines in my configs to make them work properly.

----------

## pikkumyy

After trying desperately for several weeks to install Nagios based on this documentation, I gave up completely.

There is a webconfig shit somewhere on sourceforge. Tried using it, but the fucking nagios shit just won't bloody fucking start, so I could use something pleasant to configure it. No, having to manually edit closer to two dozen config files is not pleasant; it compares to pouring liquid nitrogen to my rectum.

----------

## Earthwings

 *pikkumyy wrote:*   

> After trying desperately for several weeks to install Nagios based on this documentation, I gave up completely.
> 
> There is a webconfig shit somewhere on sourceforge. Tried using it, but the fucking nagios shit just won't bloody fucking start, so I could use something pleasant to configure it. No, having to manually edit closer to two dozen config files is not pleasant; it compares to pouring liquid nitrogen to my rectum.

 

Please change your language to an appropriate level.

----------

## Hideki

Why don't you just middle-slash his words off...

And about Nagios...

I cannot believe how Nagios author felt like locking everything from top to bottom with the way he prefers...

Any web application forcing you to use apache/mysql combination or editing of httpd.conf just to run it is really getting old nowadays.

At least I got to get it running to show the top screen with the browser, and since I didn't need authentication, because the entire web server was already configured to run internally only, then I have no way of logging in, because Nagios relies on Apache authentication via .htaccess method... Not to mention, Nagios puts everything under it's own subdirectory... (/usr/nagios, /var/nagios... why doesn't it try to comply with the rest of the system?)

And developer think complication is something cool... great...

I found about Fruity to ease the administration, but... if there is an alternative that acts as just as good as Nagios, I'll never use Nagios for sure...which takes a week to get it to work as you want, which is sort of a joke.

Btw, does anyone know if I can somehow pass the htpasswd authentication username to server scripts without the htpasswd authentication without editing every CGI file to give environmental variables?

[Edit] : Never mind... found out how to turn off authentication in the config by grep'ing for 'auth' in the config dir  :Wink:  Too much config and doc won't make me read but rather grep for keyword instead...

----------

## Hideki

Seriously... I gave up... bye nagios...

[The last thing I did with nagios... finally reading this 2 year old howto, got to set up a new host entry, but since it never updates the information, I go to update it manually, Nagios claims how I have turned off authentication is troublesome and how I should turn off the safe guard to invite trouble to proceed and I should read the CGI section of the very very long doc (which I can't even find, but my patience was already out) and I'm sure I'm not inviting trouble by using the system on my own but thanks for alerting... Every step is like walking in the deep mud... I'd go look for a much more modern implementation of similar service.]

Too bad people say this is the best OSS for this purpose.

----------

