Two (Relatively Easy) Config Issues


#1

I have installed Nagios 2.9 on SUSE. Now, when I run nagios -v /etc/nagios/nagios.cfg I get a few errors. I’ll try to make this as clear as possible for ya’s!

1)
The first issue is with services.cfg.

Error: Service check command 'check_ntp' specified in service 'NTP' for host 'testserver' not defined anywhere!
There are many of these services errors for all different hosts. How do I define this correctly?
Here is a blurb of services.cfg:

[code]# Service definition
define service{
use generic-service ; Name of service template to use

host_name				testserver
service_description		NTP
is_volatile			0
check_period			24x7
max_check_attempts		3
normal_check_interval		5
retry_check_interval		1
contact_groups			chlinux-admins
notification_interval		120
notification_period		24x7
notification_options		c,r
check_command			check_ntp
}[/code] 

2)
The second issue is with the default host groups. Here is an excerpt.

And here is the blurb from hostgroups.cfg:

[code]# ‘as-400’ host group definition
define hostgroup{
hostgroup_name as-400
alias AS 400

contact_groups as400-admins

members		www,notes
    }[/code]  

Any help is ALWAYS appreciated. Thanks! Also, keep in mind I’m using 1.3 configs and need to mold them to work with 2.9. It looks like these two issues are standing in my way.


#2

You have to define the command in order for nagios to know what it is suppose to do. Look at the following website to get a good idea of how to define the different command in nagios:

[http://www.totkat.org/pages/nconf_commands.shtml](hyperlink url)

Try something like this for your command definition:

define command{ command_name check_ntp command_line $USER1$/check_ntp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ }
and then put in for the check_command under your service definition:

The value 80 stands for the warning value, and the 140 for the critical thresh hold. You can adjust this at your personal Preference. Give it a shot and see what nagios says about it.Somebody please correct me if I had that wrong.

Look at the following link for info about defining a contact group:

[http://nagios.sourceforge.net/docs/2_0/xodtemplate.html](hyperlink url)


#3

[Edit: Yeah, what he said. ^^^]

Hi

  1. You need to ensure that you have a defined command for check_ntp (and indeed all your commands) somewhere (perhaps in command.cfg?) - it will probably look something like:
define command{
        command_name    check_ntp
        command_line    $USER1$/check_ntp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ ...etc
        }
  1. As for your host “www” that has no default contact group defined, check the host definition for that server and see if you are either missing
        contact_groups          <groupname> 

or maybe you should’ve (and haven’t) assigned a generic-host (or similar) template that already has your default contact group in it i.e.

        use                     generic-host

Or you could of course take the hash off the front of your “as400-admins” contact group you’ve defined in the host-group definition, so it’ll use that.

HTH

/S


#4

Thanks so much, guys! Now I just have to figure out why the pages are saying, “Access Forbidden!” within the Nagios web interface and I’ll really be cooking with gas.

It took awhile to respond since I had so many hosts to update. Thanks again, guys.

Any input on the Access Forbidden pages? I’m thinking permissions. I’m going to go back and check the docs.


#5

I had to modify that Apache config splice to work with Suse but it works good, now.

BTW - I have a Dell rackmount with a Pentium D @ 3.0Ghz, 2GB/Ram and two gig nics. After running “top” I see the load average is 0.00-0.02! This is on a box running OpenSUSE 10.3 x64 on 7200rpm drives, running Apache, MySQL, and some other misc services in the background. Oh, and runlevel 3 of course.

Awesome!