Error: /usr/local/nagios/etc/objects missing


#1

Hi ,
Can any body help me out in the problem that i am facing regarding the installation of Nagios 3.0a4 on my Fedora Core 6 machine. The problem is that the important directory of /usr/local/etc/objects is not created, and i also didn’t get any errors during the installation of nagios on my machine. i need to make necessary changes to the files supposedly to be present in this directory. Any help in this regard is highly appreciated.

Thanks.
Shoaib Akbar.
ANE WOL Lahore.


#2

Hi

Same on my machine on Ubuntu.

I did:

apt-get install build-essential
apt-get install libgd2-xpm-dev
apt-get install apache2
apt-get install nagios-plugins
apt-get install nagios3
apt-get install nsca

I add new admin to user

and it’s working, i can see web on localhost/nagios3/ and can see monitoring localhost

But Objects folder and all files inside are missing i.e. windows.cfg etc.

When im trying to :

[code]root@tretos-desktop:/etc/nagios3# nagios3 stop

Nagios 3.0.2
Copyright © 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL

Error: Cannot open main configuration file ‘/etc/nagios3/stop’ for reading!
Warning: Cannot open log file ‘/var/lib/nagios3/nagios.log’ for writing
Nagios 3.0.2 starting… (PID=6641)
Warning: Cannot open log file ‘/var/lib/nagios3/nagios.log’ for writing
Local time is Fri Jan 16 16:41:23 GMT 2009
Warning: Cannot open log file ‘/var/lib/nagios3/nagios.log’ for writing
Warning: Cannot open log file ‘/var/lib/nagios3/nagios.log’ for writing
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=6641)

root@tretos-desktop:/etc/nagios3# nagios3 -v nagios.cfg

Nagios 3.0.2
Copyright © 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Checked 7 services.
Checking hosts…
Checked 2 hosts.
Checking host groups…
Checked 5 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 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 142 commands.
Checking time periods…
Checked 4 time periods.
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: 0

Things look okay - No serious problems were detected during the pre-flight check
root@tretos-desktop:/etc/nagios3#
[/code]

Can someone please tell me what im doing wrong and how to fix it ?


#3

Did you install example config files?

maybe this is the problem?


#4

i didnt cause i installed this like this:

apt-get install build-essential apt-get install libgd2-xpm-dev apt-get install apache2 apt-get install nagios-plugins apt-get install nagios3 apt-get install nsca

It wasnt installed from source. You know how can i install those samples manually ? Fix this somehow ? I cannot get nagios to work with any other machine. Only Localhost.


#5

You can download tar archive of nagios unpack it and then
./configure
make

This will create sample configurations files in sample-config/ directory. You can simple copy them into /usr/local/nagios/etc (only *cfg) and /usr/local/nagios/etc/objects dir.

Specify the problem

Cheers!


#6

That what i got after i changed this line in nagios.cfg:

# Definitions for monitoring a Windows machine cfg_file=/etc/nagios3/objects/windows.cfg

[code]:/etc/nagios3$ nagios3 -v nagios.cfg

Nagios 3.0.2
Copyright © 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL

Reading configuration data…

Error: Cannot open resource file ‘/etc/nagios3/resource.cfg’ for reading!
Error in configuration file ‘/etc/nagios3/nagios.cfg’ - Line 465 (Check result path is not a valid 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.

tretos@tretos-desktop:/etc/nagios3$ ls
apache2.conf commands.cfg htpasswd.users nagios.cfg~ resource.cfg
cgi.cfg conf.d nagios.cfg objects stylesheets
tretos@tretos-desktop:/etc/nagios3$ [/code]

And thats the Resource.cfg

[code]###########################################################################

RESOURCE.CFG - Resource File for Nagios

You can define $USERx$ macros in this file, which can in turn be used

in command definitions in your host config file(s). $USERx$ macros are

useful for storing sensitive information such as usernames, passwords,

etc. They are also handy for specifying the path to plugins and

event handlers - if you decide to move the plugins or event handlers to

a different directory in the future, you can just update one or two

$USERx$ macros, instead of modifying a lot of command definitions.

The CGIs will not attempt to read the contents of resource files, so

you can set restrictive permissions (600 or 660) on them.

Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)

Resource files may also be used to store configuration directives for

external data sources like MySQL…

###########################################################################

Sets $USER1$ to be the path to the plugins

$USER1$=/usr/lib/nagios/plugins

Sets $USER2$ to be the path to event handlers

#$USER2$=/usr/lib/nagios/plugins/eventhandlers

Store some usernames and passwords (hidden from the CGIs)

#$USER3$=someuser
#$USER4$=somepassword[/code]

Nagios is running, i can login to webpage and see localhost monitored.

Now i just want to have windows monitored and it doesnt work…

I heard about nagios configurator, do you know which one is good ? You think this will help ?


#7

eh… I will install this again from source. Not using apt-get.

Im running ubuntu on Virtual box so I can always go back…


#8

I setup all nagios manually. I don’t trust any configurations :slight_smile:
And all I can say. check all paths and permissions twice because this was my problem number 1 in 99% of cases.

Or install nagios from source. You can always control all settings.

Good Luck!


#9

Yes, thats what i did. And works fine :slight_smile:

Do you how can I change the name of the host under: Hostgroup Overview

Now is taking name from Hostname, but i want to show the Alias.

Any idea how to change this ?


#10

As far as I know there is a special attribute ‘display_name’ which can be set to custom host name, but this feature will be available in some of the next Nagios release :slight_smile:

The only way is to change localhost name to the custom. in nagios.cfg there is a illegal_object_name_chars attribute where you can define which characters cant be used in host name.

Cheers!