<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.24.5">
</HEAD>
<BODY>
<FONT COLOR="#0000ff">In /usr/local/nagios/etc/objects I have created a new asterisk.cfg :</FONT><BR>
<BR>
<FONT SIZE="2">[root@nagios objects]# ls -al</FONT><BR>
<FONT SIZE="2"><B>-rw-r--r-- 1 nagios nagios  1483 Oct 31 12:03 asterisk.cfg</B></FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  7714 Oct 30 19:30 commands.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  2166 Oct 30 19:30 contacts.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  5403 Oct 30 19:30 localhost.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  3124 Oct 30 19:30 printer.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  3293 Oct 30 19:30 switch.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios 10812 Oct 30 19:30 templates.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  3209 Oct 30 19:30 timeperiods.cfg</FONT><BR>
<FONT SIZE="2">-rw-rw-r-- 1 nagios nagios  4019 Oct 30 19:30 windows.cfg</FONT><BR>
<BR>
<FONT COLOR="#0000ff">In /usr/local/nagios/etc/nagios.cfg I have added :</FONT><BR>
<BR>
<FONT SIZE="2"># You can specify individual object config files as shown below:</FONT><BR>
<FONT SIZE="2">cfg_file=/usr/local/nagios/etc/objects/commands.cfg</FONT><BR>
<FONT SIZE="2">cfg_file=/usr/local/nagios/etc/objects/contacts.cfg</FONT><BR>
<FONT SIZE="2">cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg</FONT><BR>
<FONT SIZE="2">cfg_file=/usr/local/nagios/etc/objects/templates.cfg</FONT><BR>
<BR>
<FONT SIZE="2"># Definitions for monitoring the local (Linux) host</FONT><BR>
<FONT SIZE="2">cfg_file=/usr/local/nagios/etc/objects/localhost.cfg</FONT><BR>
<BR>
<FONT SIZE="2"># Definitions for monitoring the Hosted Asterisk server</FONT><BR>
<FONT SIZE="2"><B>cfg_file=/usr/local/nagios/etc/objects/asterisk.cfg</B></FONT><BR>
<BR>
<FONT SIZE="2"># Definitions for monitoring a Windows machine</FONT><BR>
<FONT SIZE="2">#cfg_file=/usr/local/nagios/etc/objects/windows.cfg</FONT><BR>
<BR>
<FONT SIZE="2"># Definitions for monitoring a router/switch</FONT><BR>
<FONT SIZE="2">#cfg_file=/usr/local/nagios/etc/objects/switch.cfg</FONT><BR>
<BR>
<FONT SIZE="2"># Definitions for monitoring a network printer</FONT><BR>
<FONT SIZE="2">#cfg_file=/usr/local/nagios/etc/objects/printer.cfg</FONT><BR>
<BR>
<BR>
<FONT COLOR="#0000ff">The asterisk.cfg contains the following :</FONT><BR>
<BR>
<FONT SIZE="2"># Define a host for Hosted Asterisk</FONT><BR>
<BR>
<FONT SIZE="2">define host{</FONT><BR>
<FONT SIZE="2">        use                     linux-server            ; Name of host template to use</FONT><BR>
<FONT SIZE="2">                                                 ; This host definition will inherit all variables that are defined</FONT><BR>
<FONT SIZE="2">                                                 ; in (or inherited by) the linux-server host template definition.</FONT><BR>
<FONT SIZE="2">        host_name               asterisk</FONT><BR>
<FONT SIZE="2">        alias                   Hosted Asterisk</FONT><BR>
<FONT SIZE="2">        address                 ip_address</FONT><BR>
<FONT SIZE="2"> max_check_attempts      3</FONT><BR>
<FONT SIZE="2"> check_period            24x7</FONT><BR>
<FONT SIZE="2"> contact_groups          admins</FONT><BR>
<FONT SIZE="2"> notification_interval   30</FONT><BR>
<FONT SIZE="2"> notification_period     24x7</FONT><BR>
<FONT SIZE="2">        }</FONT><BR>
<BR>
<FONT SIZE="2">###############################################################################</FONT><BR>
<FONT SIZE="2">###############################################################################</FONT><BR>
<FONT SIZE="2">#</FONT><BR>
<FONT SIZE="2"># SERVICE DEFINITIONS</FONT><BR>
<FONT SIZE="2">#</FONT><BR>
<FONT SIZE="2">###############################################################################</FONT><BR>
<FONT SIZE="2">###############################################################################</FONT><BR>
<BR>
<FONT SIZE="2">define service{</FONT><BR>
<FONT SIZE="2"> host_name               asterisk</FONT><BR>
<FONT SIZE="2"> service_description     Root Partition</FONT><BR>
<FONT SIZE="2"> max_check_attempts      5</FONT><BR>
<FONT SIZE="2"> check_interval          5</FONT><BR>
<FONT SIZE="2"> retry_interval          3</FONT><BR>
<FONT SIZE="2"> check_period            24x7</FONT><BR>
<FONT SIZE="2"> contact_groups          admins</FONT><BR>
<FONT SIZE="2"> check_command           check_nrpe!check_disk</FONT><BR>
<FONT SIZE="2">}</FONT><BR>
<BR>
<FONT COLOR="#0000ff">But I always get the config error :</FONT><BR>
<BR>
<FONT SIZE="2">[root@nagios objects]# service nagios reload</FONT><BR>
<FONT SIZE="2">Running configuration check... CONFIG ERROR!  Reload aborted.  Check your Nagios configuration.</FONT><BR>
<BR>
<FONT COLOR="#0000ff">Could someone tell me why ?!</FONT><BR>
<BR>
<FONT COLOR="#0000ff">According to the Nagios documentation (http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html) I have all the necessary fields filled in.</FONT><BR>
<BR>
<FONT COLOR="#0000ff">Jonas.</FONT>
</BODY>
</HTML>