Installing Nagios v1.2, v2.0b1 & 2.0b2

I am running || Linux SuSE 9.2 : Kernel 2.6.8-24.11 : Nagios v2.0b1

I have been following the instructions carefully and still need to know the following

  1. Where do the Nagios plugin files start (before you start to compile)

I have made a folder on my web server called nagios, copied the un-compiled file there and compiled.

  1. Now where do I put the Plugin files to compile them? Inside or out the web area?
    Edited ]

Linux file systems don’t have a /nagios directory, so that is mistake #1.
Look at your / filesystem. You will see things like /etc /usr /dev and so on. You should not add any more. So download nagios1-2.tar and save it to /home/cagen/nagios1-2.tar
untar it and now you have /home/cagen/nagios1.2 folder. cd into that folder and run ./configure
By default, nagios will install to /usr/local/nagios
run make then make install.
Same goes for the plugins. The default will be /usr/local/nagios when you run make install.
your plugins will now be in /usr/local/nagios/libexec.
You make the changes per the docs so that the cgi’s and html can be viewed by your website user’s. The cgi’s are in /usr/local/nagios/sbin
the html files are in /usr/local/nagios/share

REad the part about “Setting up the Web interface” and then restart apache when done changing your httpd.conf.
YOu now have a nagios website.I had to follow the instructions from start to finish, every time I set it up, so please don’t skip anything, read it again, 3 times if needed.

Thanks once again for your reply.
It is much clearer to me now. What I have done is not to change anything on the install and keep everything as default.

Gone throu all the stages untill I get to the make install-config stage.

Here is the error. Am I correct by implying that there are files missing here?
**
MrBurns:/home/michael/nagios-2.0b1 # make install-config
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg-sample
/usr/bin/install -c -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/checkcommands.cfg /usr/local/nagios/etc/checkcommands.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/contactgroups.cfg /usr/local/nagios/etc/contactgroups.cfg-sample
/usr/bin/install: cannot stat `sample-config/template-object/contactgroups.cfg’: No such file or directory
make: *** [install-config] Error 1
MrBurns:/home/michael/nagios-2.0b1 #**

When I visit my Nagios page and click on a menu option I get the following

Error: Could not read object configuration data!

Here are some things you should check in order to resolve this error:

Verify configuration options using the -v command-line option to check for errors.

Check the Nagios log file for messages relating to startup or status data errors.

What are my options here?

BTW - I have noticed that there is a new build up Nagios-2.0b2 which does fix the problem I mentioned eariler.

But even after all that, I’m now come to another stop
When I visit my Nagios page and click on a menu option I get the following

**Error: Could not read object configuration data!

Here are some things you should check in order to resolve this error:

Verify configuration options using the -v command-line option to check for errors.

Check the Nagios log file for messages relating to startup or status data errors. **

What are my options here? It’s not very clear to me :shock:

[quote]Thanks once again for your reply.
It is much clearer to me now. What I have done is not to change anything on the install and keep everything as default.

Gone throu all the stages untill I get to the make install-config stage.

Here is the error. Am I correct by implying that there are files missing here?
**

/usr/bin/install: cannot stat `sample-config/template-object/contactgroups.cfg’: No such file or directory
make: *** [install-config] Error 1
MrBurns:/home/michael/nagios-2.0b1 #**
[/quote]

There is a contactgroups.cfg file in my /home/tech/nagios-1.2/sample-config/template-object directory. If you don’t have one, then perhaps there where errors during the ./configure or make. Try again but start with make clean first.

[quote]
When I visit my Nagios page and click on a menu option I get the following

Error: Could not read object configuration data!

Here are some things you should check in order to resolve this error:

Verify configuration options using the -v command-line option to check for errors.

Check the Nagios log file for messages relating to startup or status data errors.

What are my options here?[/quote]

run
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
and report back what it says.
Usually, it tells you exactly what is wrong. I’m sure you will see right away what you need to fix. If you don’t have a /usr/local/nagios/etc/contactgroups.cfg file, that would be a problem right there.

I have obtained your latest build as of 9/2/2005

This is what that command reports back.

**MrBurns:/home/michael/nagios-2.0b2 # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Reading configuration data…

Error: Cannot open config file ‘/usr/local/nagios/etc/contactgroups.cfg’ for reading: No such file or directory

***> One or more problems was encountered while processing the config files…

 Check your configuration file(s) to ensure that they contain valid
 directives and data defintions.  If you are upgrading from a previous
 version of Nagios, you should be aware that some variables/definitions
 may have been removed or modified in this version.  Make sure to read
 the HTML documentation regarding the config files, as well as the
 'Whats New' section to find out what has changed.

MrBurns:/home/michael/nagios-2.0b2 #**

I have checked if that files exists within the nagios-2.0b2.tar.gz file. And it does not exist in there to start with.

This is the same file it stops at in the previous build also.

What to do next now?

What I have done is to download the previous build (1.:evil: and copy thr missing file from that build into the sample-config/template-objects folder and ran make clean then started the installation again.

Even after the installation has completed. We are still missing a few files.

Now I have

**MrBurns:/home/michael/nagios-2.0b2 # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Reading configuration data…

Error: Cannot open config file ‘/usr/local/nagios/etc/contacts.cfg’ for reading: No such file or directory

***> One or more problems was encountered while processing the config files…

 Check your configuration file(s) to ensure that they contain valid
 directives and data defintions.  If you are upgrading from a previous
 version of Nagios, you should be aware that some variables/definitions
 may have been removed or modified in this version.  Make sure to read
 the HTML documentation regarding the config files, as well as the
 'Whats New' section to find out what has changed.

MrBurns:/home/michael/nagios-2.0b2 #
**

All the files it’s said is missing has been copied from your previous build (1.:evil: and now I’m getting this

**
MrBurns:/home/michael/nagios-2.0b2 # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Reading configuration data…

Error: Could not add object definition in file ‘/usr/local/nagios/etc/escalations.cfg’ on line 51.
**

Now I am stuck.
I belive your builds from v2 are missing some config files. I have also noticed that even after the make install command. None of the missing files are referenced or being asked for.

Now I’m stuck with

**MrBurns:/home/michael/nagios-plugins-1.4 # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Reading configuration data…

Error: Could not add object definition in file ‘/usr/local/nagios/etc/escalations.cfg’ on line 51.
**

I would appreciate if you could email me with a copy of all the files needed to make this installation a successfull one.

I am trying to give you as much information as possible here.
I can see that others are able to install Nagios but why am I having problems. If they are using the same file I have downloaded. Then how comes they have all the files available and I seem to have not.

**MrBurns:/home/michael/nagios-plugins-1.4 # /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Nagios 2.0b2 starting… (PID=5879)
Error: Could not add object definition in file ‘/usr/local/nagios/etc/escalations.cfg’ on line 51.
Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=5879)
**

I have been at this now for 2 weeks. :frowning:

I think what I’ll be doing now is to once again - install from scratch untill someone here could help me. I do like the potential that this program has. :frowning:
Edited Mon Feb 14 2005, 12:24PM ]

Installing for the top once again.

Got to the make install-config step.

***** External command directory configured ***

You can continue with installing Nagios as follows (type 'make’
without any arguments for a list of all possible options):

make install-config
- This installs SAMPLE config files in /usr/local/nagios/etc
You’ll have to modify these sample files before you can
use Nagios. Read the HTML documentation for more info
on doing this. Pay particular attention to the docs on
object configuration files, as they determine what/how
things get monitored!

MrBurns:/home/michael/nagios-2.0b2 # make install-config
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg-sample
/usr/bin/install -c -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/bigger.cfg /usr/local/nagios/etc/bigger.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/minimal.cfg /usr/local/nagios/etc/minimal.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/checkcommands.cfg /usr/local/nagios/etc/checkcommands.cfg-sample
/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/misccommands.cfg /usr/local/nagios/etc/misccommands.cfg-sample

*** Sample config file installed ***
**

**NOTE: No mention of the m issing files I mentioned in previous postings here.

‘/usr/local/nagios/etc/escalations.cfg’
’/usr/local/nagios/etc/contacts.cfg’
’/usr/local/nagios/etc/contactgroups.cfg’
**

NAGIOS.CFG

These files dfo not exist anywhere.
**

You can split other types of object definitions across several

config files if you wish (as done here), or keep them all in a

single config file.

cfg_file=/usr/local/nagios/etc/contactgroups.cfg

cfg_file=/usr/local/nagios/etc/contacts.cfg

cfg_file=/usr/local/nagios/etc/dependencies.cfg

cfg_file=/usr/local/nagios/etc/escalations.cfg

cfg_file=/usr/local/nagios/etc/hostgroups.cfg

cfg_file=/usr/local/nagios/etc/hosts.cfg

cfg_file=/usr/local/nagios/etc/services.cfg

cfg_file=/usr/local/nagios/etc/timeperiods.cfg

Extended host/service info definitions are now stored along with

other object definitions:

#cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
#cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg
**

With those lines commented out -v
**
MrBurns:/usr/local/nagios/etc # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Error: There are no services defined!
Checked 0 services.
Checking hosts…
Error: There are no hosts defined!
Checked 0 hosts.
Checking host groups…
Error: There are no host groups defined!
Checked 0 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Error: There are no contacts defined!
Checked 0 contacts.
Checking contact groups…
Error: There are no contact groups defined!
Checked 0 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 22 commands.
Checking time periods…
Checked 0 time periods.
Checking extended host info definitions…
Checked 0 extended host info definitions.
Checking extended service info definitions…
Checked 0 extended service info definitions.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors: 5
**

I have removed the comments from those lines but not from lines 57 & 58

Now try to start Nagios

**
MrBurns:/usr/local/nagios/etc # /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

Nagios 2.0b2
Copyright © 1999-2005 Ethan Galstad (www.nagios.org)
Last Modified: 02-09-2005
License: GPL

Nagios 2.0b2 starting… (PID=8595)
Error: Cannot open config file ‘/usr/local/nagios/etc/contactgroups.cfg’ for reading: No such file or directory
Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=8595)
**

:shock:

I just now compiled nagios-2.0b2, and you are right, they are missing. If you don’t know the syntax used in the files, the docs show it. Also, you could copy the files from 1.2 and use those. Since this is the first time I’ve compiled this, I’m new also, but am willing to help fix this.
So copy the files and config them from a 1.2 distribution, and hopefully that will take care of the problem.

Don’t forget to
ls -la /usr/local/nagios/etc
and make sure all the files have correct permission’s.
-rw-rw-r-- 1 nagios nagios 9600 Feb 14 10:07 cgi.cfg

ok, this new version doesn’t make any sense at all to me.
In the nagios.cfg-sample they have a line…
cfg_file=/tmp/usr/local/nagios/etc/contacts.cfg
but yet they didn’t include a contacts.cfg-sample file.
I guess to someone it might not be a big deal, but hey, we shouldn’t have to figure all these small details out, just to install the thing.

Hi Jakkedup - After another 4 hours at work figuring this stuff ou. I think what was intended was that user were supposed to upgrade from version 1.2 to v2.

This was not made clear from the start.
Also. Even after upgrading from v1.2 to v2 there are still problems.

Here is how I got mine to work.
cp nagios.cfg-sample nagios.cfg
vi nagios.cfg
comment out and add one line like below …
cfg_file=/tmp/usr/local/nagios/etc/minimal.cfg
#cfg_file=/tmp/usr/local/nagios/etc/contactgroups.cfg
#cfg_file=/tmp/usr/local/nagios/etc/contacts.cfg
#cfg_file=/tmp/usr/local/nagios/etc/dependencies.cfg
#cfg_file=/tmp/usr/local/nagios/etc/escalations.cfg
#cfg_file=/tmp/usr/local/nagios/etc/hostgroups.cfg
#cfg_file=/tmp/usr/local/nagios/etc/hosts.cfg
#cfg_file=/tmp/usr/local/nagios/etc/services.cfg
#cfg_file=/tmp/usr/local/nagios/etc/timeperiods.cfg
#cfg_file=/tmp/usr/local/nagios/etc/checkcommands.cfg
#cfg_file=/tmp/usr/local/nagios/etc/misccommands.cfg

SO you see, they are putting all of there eggs mostly in one basket, i.e minimal.cfg
or use bigger.cfg or seperate them all , like nagios.cfg had defined in the first place.

What bugs me is this. If they have the nagios.cfg-sample configured wo have all of these files, then they should have supplied them. Otherwise, they should have had all of thoses missing files commented out, and a line added that points to minimal.cfg

Would it have killed them to be more precise?

Since it sounds like you have yours working now, what other problems do you have? I’m not going to upgrade until it gets out of Beta, since my 1.2 is working just fine. But I’d be happy to help you with any other items as you go along. As you can see, I had the same trouble with the new version as you, but at least I can run ~/bin/nagios -v ~/etc/nagios.cfg now with no errors, so I’ll continue on, if I need to, in order to help you out.

"Error: Invalid hostgroup object directive ‘contact_groups’"
There very own minimal.cfg isn’t even correct. Remove the line,
contact_groups admins
in the hostgroup’s section, since contact_groups is no longer a valid directive for hostgroups. Geees, you would think that since it’s there brand new nagios, that they could use the correct directives.

"Error: Host ‘localhost’ has no default contact group(s) defined!"
You have to add a line to minimal.cfg like this…
contact_groups admins
to the hosts section of that file. Oh man, what a poor job they did on this beta so far. How could they have not fixed these little things, so us poor slobs don’t have to figure out all there mistakes?