Solved

Cannot get Nagios 3 on Ubuntu Desktop 8.10 to monitor any hosts

Posted on 2009-04-07
7
4,795 Views
Last Modified: 2013-11-15
I have installed Ubuntu 8.10 Desktop and all 270MB of updates. I followed the install instructions located here (http://beginlinux.com/blog/2008/11/install-nagios-3-on-ubuntu-810/). Within a few minutes i was using the web-interface to  view the localhost.
I proceeded to the next step; monitoring a Windows host. When i got to the point to edit the windows.cfg file, I noticed the folder /usr/local/nagios does not exist. Instead, all .cfg files were placed in /etc/nagios3/objects. I made all changes necessary to nagios.cfg and windows.cfg according to (http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html) and also verified everything according to (http://www.thegeekstuff.com/2008/07/how-to-monitor-remote-windows-machine-using-nagios-on-linux). I checked my spelling and syntax numerous times on the config files but i still get this when i try to verify my configuration:

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

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

Reading configuration data...

Error: Template 'windows-server' specified in host definition could not be not found (config file '/etc/nagios3/objects/windows.cfg', starting on line 25)

***> 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.

I have checked over and over again and cannot find any problems. I have uploaded my templates.cfg, windows.cfg and nagios.cfg.
Also curious to know, from the looks of the windows.cfg,  will each host need it's own windows.cfg? Does each host need a static IP? If not, how do add more windows machines to monitor? I dont think i'm understanding how this software works,  cause creating a seperate .cfg file for each host that needs to be monitored seems a little ridiculous.
Thanks for any help.
nagios.txt
templates.txt
windows.txt
0
Comment
Question by:mhdcommunications
  • 3
  • 2
  • 2
7 Comments
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 24087982
the ubuntu quickstart from the nagios website works better since it uses all the standard locations for the nagios install

http://nagios.sourceforge.net/docs/3_0/quickstart-ubuntu.html

since you went a different way i would try using the cfg_dir directive instead and use the cfg_file directive sparingly. below is what i have setup on my nagios. i used the /usr/local/nagios/ as my install, but im sure you can modify to reflect your environment

# OBJECT CONFIGURATION FILE(S)
# These are the object configuration files in which you define hosts,
# host groups, contacts, contact groups, services, etc.
# You can split your object definitions across several config files
# if you wish (as shown below), or keep them all in a single config file.

# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg

# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg

# Definitions for monitoring a Windows machine
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg

# Definitions for monitoring a router/switch
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg

# Definitions for monitoring a network printer
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg


# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:

*****************
This is where is point to all my hosts that are being monitored. since the hosts directory has almost 150 different defenition files its much easier than referencing each host to monitor sperately
******************
cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/serviceext

#cfg_dir=/usr/local/nagios/etc/servers
#cfg_dir=/usr/local/nagios/etc/printers
#cfg_dir=/usr/local/nagios/etc/switches
#cfg_dir=/usr/local/nagios/etc/routers
0
 
LVL 1

Author Comment

by:mhdcommunications
ID: 24088207
The Ubuntu quickstart guide did not work. I spent 3 days using 6.1 desktop and server editions, 7.1 desktop and server editions, and 8.1 desktop and server editions. ALL failed at the same point (make install-webconf *command not found or something of that nature) I tried every variation of the command, and it never worked. Every time i tried, i reloaded the OS from scratch and installed all updates before starting the install of Nagios 3. I finally found the one for 8.1 that used the repositories for the install, and i was up monitoring locally in 3-5 minutes.
I will try the config above and post later. Thanks.

0
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 24088685
the command make install-webconf simply adds a few lines to your apache sever so that the nagios page works correctly. i dont remeber the lines off top, but they can safely be added manually at a later stage
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 1

Author Comment

by:mhdcommunications
ID: 24091173
I have grown extremely frustrated with Nagios. I got past the original error listed, but got a new one - something in regards to a Duplicate host. I remarked ALL config files in the nagios.cfg except a host.cfg that only had one host entered on the entire document, and still got the same erro. I am in the process of starting from scratch. There seems to be something else wrong with my systems as every time i reboot, my NIC changes from a 'Manual' IP to DHCP.
I will be using Ubuntu 8.10 Desktop again and will follow the instructions listed on Nagio's site. Do you suggest any other distro? I would cinsider myself a linux beginner. Although i used Ubuntu for almost 2 years as my only OS, i stopped using it about 2 years ago and have forgotten almost everything, and am teaching myself again. Thanks.
0
 
LVL 18

Accepted Solution

by:
Sanga Collins earned 500 total points
ID: 24091299
using ubuntu 8.10 there is a bug in network manager that prevents you from configuring a static IP from the gui. to get around it i usually configure the static up from the console and remove the network manager completely

apt-get remove network-manager network-manager-gui

as far as the best distro for nagios, i recommend ubuntu because all the third party add-ons have ubuntu documentation readily available. my fav distro is Centos but only becuase of Redhat directory server.

i love nagios and have a pretty complex setup working very well. i dont mind answering any questions you have while trying to get it setup
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 24091410
Wait a minute - are these files which you attached to your post - are your currently used configuration files?
If so - in nagios.cfg (attached as .txt), you should uncomment (by deleting '#' character) line 33 (#cfg_file=/etc/nagios3/objects/templates.cfg).
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 24091440
As for multiple configuration files - you may have just one config file with all your hosts, services, commands, contacs, contact groups, escalations, etc... Having it in separate files is just easier to maintain (especially if you have a lot of hosts/services/etc...).
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question