Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-19 Thread Chris Beattie
Allan Clark wrote:
 Aren't those two files the first duplicates?
 
 Remove all *~ files -- I assume your editor created these.  Try again after:

I use gedit to edit my Nagios configuration files, and it's set to make 
backups whose filenames end with a tilde by default.  Nagios ignores 
them since it's looking only for *.cfg, but they do visually pollute the 
directory listing and I tell rsync to exclude them when I copy the 
config files from dev to production.


-- 
Chris Beattie

Nothing in this message is intended to make or accept and offer or to form a 
contract, except that an attachment that is an image of a contract bearing the 
signature of an officer of our company may be or become a contract. This 
message (including any attachments) is intended only for the use of the 
individual or entity to whom it is addressed. It may contain information that 
is non-public, proprietary, privileged, confidential, and exempt from 
disclosure under applicable law or may constitute as attorney work product. If 
you are not the intended recipient, we hereby notify you that any use, 
dissemination, distribution, or copying of this message is strictly prohibited. 
If you have received this message in error, please notify us immediately by 
telephone and delete this message immediately.

Thank you.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-19 Thread Allan Clark
On Thu, Feb 19, 2009 at 13:09, Chris Beattie cbeat...@geninfo.com wrote:

 Allan Clark wrote:

 Aren't those two files the first duplicates?

 Remove all *~ files -- I assume your editor created these.  Try again
 after:


 I use gedit to edit my Nagios configuration files, and it's set to make
 backups whose filenames end with a tilde by default.  Nagios ignores them
 since it's looking only for *.cfg, but they do visually pollute the
 directory listing and I tell rsync to exclude them when I copy the config
 files from dev to production.


Indeed, I see it above in the same file (xdata/xodtemplat...@978):

case S_IFREG:
x=strlen(dirfile-d_name);
if(x=4 || strcmp(dirfile-d_name+(x-4),.cfg))
break;

Thanks.

In this case, there was a cfg_file and cfg_dir values causing the same file
to be parsed twice, but O.P. is checking another failure now.

Allan
-- 
all...@chickenandporn.com  金鱼 http://linkedin.com/in/goldfish
please, no proprietary attachments (http://tinyurl.com/cbgq)
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-18 Thread Eric Chatham
Thank you.  Next time you're in the area...

I still can't find the problem.  I can't find the duplicate command. :/

Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Marc Powell [mailto:m...@ena.com]
Sent: Tuesday, February 17, 2009 17:04
To: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


On Feb 17, 2009, at 3:44 PM, Eric Chatham wrote:

 Is the cfg_dir location recursive?


Ok, I'll look that up for you. You owe me a local beer though.

http://nagios.sourceforge.net/docs/3_0/configmain.html

Object Configuration Directory

Format: cfg_dir=directory_name
Example:cfg_dir=/usr/local/nagios/etc/commands
cfg_dir=/usr/local/nagios/etc/services
cfg_dir=/usr/local/nagios/etc/hosts

This directive is used to specify a directory which contains object
configuration files that Nagios should use for monitoring. All files
in the directory with a .cfg extension are processed as object config
files. Additionally, Nagios will recursively process all config files
in subdirectories of the directory you specify here. You can seperate
your configuration files into different directories and specify
multiple cfg_dir= statements to have all config files in each
directory processed.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

CONFIDENTIAL.  This e-mail and any attached files are confidential and should 
be destroyed and/or returned if you are not the intended and proper recipient.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-18 Thread Eric Chatham
What files should I have under main/ and what files should be in the directory 
behind it?  Here is a tree example:

[root@ ~ etc]# tree /opt/nagios/etc/
/opt/nagios/etc/
|-- cgi.cfg
|-- cgi.cfg~
|-- htpasswd.users
|-- main
|   |-- commands.cfg
|   |-- contacts.cfg
|   |-- hostgroups.cfg
|   |-- hosts.cfg
|   |-- services.cfg
|   |-- templates.cfg
|   `-- timeperiods.cfg
|-- nagios.cfg
|-- nagios.cfg~
|-- nagios.tar.gz
|-- resource.cfg
`-- resource.cfg~

1 directory, 15 files
[root@ ~ etc]#

Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Eric Chatham [mailto:echat...@broadvox.net]
Sent: Wednesday, February 18, 2009 14:37
To: Marc Powell; Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

Thank you.  Next time you're in the area...

I still can't find the problem.  I can't find the duplicate command. :/

Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Marc Powell [mailto:m...@ena.com]
Sent: Tuesday, February 17, 2009 17:04
To: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


On Feb 17, 2009, at 3:44 PM, Eric Chatham wrote:

 Is the cfg_dir location recursive?


Ok, I'll look that up for you. You owe me a local beer though.

http://nagios.sourceforge.net/docs/3_0/configmain.html

Object Configuration Directory

Format: cfg_dir=directory_name
Example:cfg_dir=/usr/local/nagios/etc/commands
cfg_dir=/usr/local/nagios/etc/services
cfg_dir=/usr/local/nagios/etc/hosts

This directive is used to specify a directory which contains object
configuration files that Nagios should use for monitoring. All files
in the directory with a .cfg extension are processed as object config
files. Additionally, Nagios will recursively process all config files
in subdirectories of the directory you specify here. You can seperate
your configuration files into different directories and specify
multiple cfg_dir= statements to have all config files in each
directory processed.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

CONFIDENTIAL.  This e-mail and any attached files are confidential and should 
be destroyed and/or returned if you are not the intended and proper recipient.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

CONFIDENTIAL.  This e-mail and any attached files are confidential and should 
be destroyed and/or returned if you are not the intended and proper recipient.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-18 Thread Allan Clark
On Wed, Feb 18, 2009 at 15:07, Eric Chatham echat...@broadvox.net wrote:

 What files should I have under main/ and what files should be in the
 directory behind it?  Here is a tree example:

 [root@ ~ etc]# tree /opt/nagios/etc/
 /opt/nagios/etc/
 |-- cgi.cfg
 |-- cgi.cfg~


Aren't those two files the first duplicates?

Remove all *~ files -- I assume your editor created these.  Try again after:
# rm -i $(find /opt/nagios/etc -type f -name \*~ -print)  nagios -v
/opt/nagios/etc/nagios.cfg

Allan
http://community.nagios.org/wiki/index.php/LDAP-Configured_Nagios
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-18 Thread Robert Wamala

Pleasee can u help me to get it right,
how can I configure curl to give an automatic 
login to the urls 
will be glade.

rgds,
Robert



On Wed, 2009-02-18 at 15:18 -0500, Allan Clark wrote:
 On Wed, Feb 18, 2009 at 15:07, Eric Chatham echat...@broadvox.net
 wrote:
 What files should I have under main/ and what files should be
 in the directory behind it?  Here is a tree example:
 
 [root@ ~ etc]# tree /opt/nagios/etc/
 /opt/nagios/etc/
 |-- cgi.cfg
 |-- cgi.cfg~
 
 
 Aren't those two files the first duplicates?
 
 
 Remove all *~ files -- I assume your editor created these.  Try again
 after:
 # rm -i $(find /opt/nagios/etc -type f -name \*~ -print)  nagios
 -v /opt/nagios/etc/nagios.cfg
 
 
 Allan
 http://community.nagios.org/wiki/index.php/LDAP-Configured_Nagios
 
 
 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
 -Strategies to boost innovation and cut costs with open source participation
 -Receive a $600 discount off the registration fee with the source code: SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___ Nagios-users mailing list 
 Nagios-users@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include 
 Nagios version, plugin version (-v) and OS when reporting any issue. ::: 
 Messages without supporting info will risk being sent to /dev/null
-- 
Robert Wamala rob...@rcs-communication.com


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-17 Thread Eric Chatham
Ok, that was weird, when I looked, it was all scrambled.  So, I recopied the 
commands.cfg file from the original location.  Now, when I run it, I get this:

[root@ ~ main]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Warning: Duplicate definition found for command 'notify-host-by-email' (config 
file '/opt/nagios/etc/main/commands.cfg', starting on line 28)
Error: Could not add object property in file 
'/opt/nagios/etc/main/commands.cfg' on line 29.

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

[root@ ~ main]#

When I look at line 28, 29, here is what it is.

26
27  # 'notify-host-by-email' command definition
28  define command{
29  command_namenotify-host-by-email
30  command_line/usr/bin/printf %b * Nagios 
*\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: 
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: 
$LONGDATETIME$\n | /bin/mail -s ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ 
is $HOSTSTATE$ ** $CONTACTEMAIL$


Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Hau Phan [mailto:h...@udeviant.com]
Sent: Monday, February 16, 2009 18:37
Cc: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

What's the first line in your commands.cfg?

Eric Chatham wrote:
 [root@ ~ bin]# /usr/local/nagios/bin/nagios -v 
 /usr/local/nagios/etc/nagios.cfg

 Nagios 3.0.6
 Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
 Last Modified: 12-01-2008
 License: GPL

 Reading configuration data...

 Error: Unexpected token or statement in file 
 '/opt/nagios/etc/main/commands.cfg' on line 1.

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

 Eric Chatham


 -Original Message-
 From: Marc Powell [mailto:m...@ena.com]
 Sent: Monday, February 16, 2009 16:38
 To: Nagios Users
 Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


 On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:


 Hello,

 I'm very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS
 RHEL 5.1. I used the FC6 instructions for my installation.  I've
 successfully installed the program per the Quick-start guide
 provided on the Website.  We presently have another server with an
 older version of Nagios installed.  It's using cfg_dir=/opt/nagios/
 etc as its location for all *.cfg giles.

 Here's a problem: When I try to create an alternate directory
 (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR
 when I try to restart the service. I would like to use cfg_dir=/opt/
 nagios/etc/main to hold all the config files. Here is a list of
 that directory right now:

 [root@ ~ main]# ls -l
 total 68
 -rwxrwxr-x 1 nagios nagios  7714 Feb 13 16:55 commands.cfg
 -rwxrwxr-x 1 nagios nagios  2166 Feb 13 16:52 contacts.cfg
 -rwxrwxr-x 1 nagios nagios   240 Feb 13 14:28 hostgroups.cfg
 -rwxrwxr-x 1 nagios nagios   163 Feb 13 16:51 hosts.cfg
 -rwxrwxr-x 1 nagios nagios  2414 Feb 13 16:39 services.cfg
 -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg
 -rwxrwxr-x 1 nagios nagios  3209 Feb 13 16:55 timeperiods.cfg
 [root@ ~ main]# service nagios restart
 Running configuration check... CONFIG ERROR!  Restart aborted.
 Check your Nagios configuration.


 Seems like one of the config files probably has an error in it. Run '/
 path/to/nagios -v /path/to/nagios.cfg'.

 --
 Marc


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
 -Strategies to boost innovation and cut costs with open source participation
 -Receive a $600 discount off the registration fee with the source code: SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Nagios-users mailing list
 Nagios-users

Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-17 Thread sri . lumpa
That means you have an other file in which the command notify-host-by-email 
is also defined. grep the command's name to find where. You will probably have 
the same problem for the notify-service-by-email.

I had the same problem when I installed NagiosQL and I solved it by setting 
Nagios to use only the commands defined by NagiosQL.

Marc-André

- Mail Original -
De: Eric Chatham echat...@broadvox.net
À: Hau Phan h...@udeviant.com
Cc: Nagios Users nagios-users@lists.sourceforge.net
Envoyé: Mardi 17 Février 2009 15:16:10 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

Ok, that was weird, when I looked, it was all scrambled.  So, I recopied the 
commands.cfg file from the original location.  Now, when I run it, I get this:

[root@ ~ main]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Warning: Duplicate definition found for command 'notify-host-by-email' (config 
file '/opt/nagios/etc/main/commands.cfg', starting on line 28)
Error: Could not add object property in file 
'/opt/nagios/etc/main/commands.cfg' on line 29.

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

[root@ ~ main]#

When I look at line 28, 29, here is what it is.

26
27  # 'notify-host-by-email' command definition
28  define command{
29  command_namenotify-host-by-email
30  command_line/usr/bin/printf %b * Nagios 
*\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: 
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: 
$LONGDATETIME$\n | /bin/mail -s ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ 
is $HOSTSTATE$ ** $CONTACTEMAIL$


Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Hau Phan [mailto:h...@udeviant.com]
Sent: Monday, February 16, 2009 18:37
Cc: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

What's the first line in your commands.cfg?

Eric Chatham wrote:
 [root@ ~ bin]# /usr/local/nagios/bin/nagios -v 
 /usr/local/nagios/etc/nagios.cfg

 Nagios 3.0.6
 Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
 Last Modified: 12-01-2008
 License: GPL

 Reading configuration data...

 Error: Unexpected token or statement in file 
 '/opt/nagios/etc/main/commands.cfg' on line 1.

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

 Eric Chatham


 -Original Message-
 From: Marc Powell [mailto:m...@ena.com]
 Sent: Monday, February 16, 2009 16:38
 To: Nagios Users
 Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


 On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:


 Hello,

 I'm very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS
 RHEL 5.1. I used the FC6 instructions for my installation.  I've
 successfully installed the program per the Quick-start guide
 provided on the Website.  We presently have another server with an
 older version of Nagios installed.  It's using cfg_dir=/opt/nagios/
 etc as its location for all *.cfg giles.

 Here's a problem: When I try to create an alternate directory
 (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR
 when I try to restart the service. I would like to use cfg_dir=/opt/
 nagios/etc/main to hold all the config files. Here is a list of
 that directory right now:

 [root@ ~ main]# ls -l
 total 68
 -rwxrwxr-x 1 nagios nagios  7714 Feb 13 16:55 commands.cfg
 -rwxrwxr-x 1 nagios nagios  2166 Feb 13 16:52 contacts.cfg
 -rwxrwxr-x 1 nagios nagios   240 Feb 13 14:28 hostgroups.cfg
 -rwxrwxr-x 1 nagios nagios   163 Feb 13 16:51 hosts.cfg
 -rwxrwxr-x 1 nagios nagios  2414 Feb 13 16:39 services.cfg
 -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg
 -rwxrwxr-x 1 nagios nagios  3209 Feb 13 16:55 timeperiods.cfg
 [root@ ~ main]# service nagios restart
 Running configuration check... CONFIG ERROR!  Restart aborted.
 Check

Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-17 Thread Eric Chatham
[root@ ~ main]# grep notify-host-by-email *
commands.cfg:# 'notify-host-by-email' command definition
commands.cfg:   command_namenotify-host-by-email
templates.cfg:host_notification_commands  notify-host-by-email  
; send host notifications via email

[root@ ~ main]# grep notify-service-by-email *
commands.cfg:# 'notify-service-by-email' command definition
commands.cfg:   command_namenotify-service-by-email
templates.cfg:service_notification_commands   notify-service-by-email   
; send service notifications via email

What exactly do I need to do now?  What is NagiosQL?

Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: sri.lu...@free.fr [mailto:sri.lu...@free.fr]
Sent: Tuesday, February 17, 2009 09:35
To: Eric Chatham
Cc: Nagios Users; Hau Phan
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

That means you have an other file in which the command notify-host-by-email 
is also defined. grep the command's name to find where. You will probably have 
the same problem for the notify-service-by-email.

I had the same problem when I installed NagiosQL and I solved it by setting 
Nagios to use only the commands defined by NagiosQL.

Marc-André

- Mail Original -
De: Eric Chatham echat...@broadvox.net
À: Hau Phan h...@udeviant.com
Cc: Nagios Users nagios-users@lists.sourceforge.net
Envoyé: Mardi 17 Février 2009 15:16:10 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

Ok, that was weird, when I looked, it was all scrambled.  So, I recopied the 
commands.cfg file from the original location.  Now, when I run it, I get this:

[root@ ~ main]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Warning: Duplicate definition found for command 'notify-host-by-email' (config 
file '/opt/nagios/etc/main/commands.cfg', starting on line 28)
Error: Could not add object property in file 
'/opt/nagios/etc/main/commands.cfg' on line 29.

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

[root@ ~ main]#

When I look at line 28, 29, here is what it is.

26
27  # 'notify-host-by-email' command definition
28  define command{
29  command_namenotify-host-by-email
30  command_line/usr/bin/printf %b * Nagios 
*\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: 
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: 
$LONGDATETIME$\n | /bin/mail -s ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ 
is $HOSTSTATE$ ** $CONTACTEMAIL$


Eric Chatham
Broadvox MIS Department
(216) 373-4683
echat...@broadvox.net


-Original Message-
From: Hau Phan [mailto:h...@udeviant.com]
Sent: Monday, February 16, 2009 18:37
Cc: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

What's the first line in your commands.cfg?

Eric Chatham wrote:
 [root@ ~ bin]# /usr/local/nagios/bin/nagios -v 
 /usr/local/nagios/etc/nagios.cfg

 Nagios 3.0.6
 Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
 Last Modified: 12-01-2008
 License: GPL

 Reading configuration data...

 Error: Unexpected token or statement in file 
 '/opt/nagios/etc/main/commands.cfg' on line 1.

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

 Eric Chatham


 -Original Message-
 From: Marc Powell [mailto:m...@ena.com]
 Sent: Monday, February 16, 2009 16:38
 To: Nagios Users
 Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


 On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:


 Hello,

 I'm very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS
 RHEL 5.1. I used the FC6 instructions for my installation.  I've
 successfully installed the program per the Quick-start guide
 provided on the Website.  We presently have another server with an
 older version of Nagios installed.  It's using cfg_dir

Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-17 Thread Marc Powell

On Feb 17, 2009, at 2:06 PM, Eric Chatham wrote:

 [root@ ~ main]# grep notify-host-by-email *
 commands.cfg:# 'notify-host-by-email' command definition
 commands.cfg:   command_namenotify-host-by-email
 templates.cfg:host_notification_commands  notify-host-by- 
 email  ; send host notifications via email

 [root@ ~ main]# grep notify-service-by-email *
 commands.cfg:# 'notify-service-by-email' command definition
 commands.cfg:   command_namenotify-service-by-email
 templates.cfg:service_notification_commands   notify-service- 
 by-email   ; send service notifications via email

Look in nagios.cfg for cfg_dir and cfg_file directives. These files in  
main/ apparently do not represent all the config files you've told  
nagios to use. You do have the command defined twice somewhere.


 Warning: Duplicate definition found for command 'notify-host-by- 
 email' (config file '/opt/nagios/etc/main/commands.cfg', starting on  
 line 28)
 Error: Could not add object property in file '/opt/nagios/etc/main/ 
 commands.cfg' on line 29.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-17 Thread Marc Powell

On Feb 17, 2009, at 3:44 PM, Eric Chatham wrote:

 Is the cfg_dir location recursive?


Ok, I'll look that up for you. You owe me a local beer though.

http://nagios.sourceforge.net/docs/3_0/configmain.html

Object Configuration Directory

Format: cfg_dir=directory_name
Example:cfg_dir=/usr/local/nagios/etc/commands
cfg_dir=/usr/local/nagios/etc/services
cfg_dir=/usr/local/nagios/etc/hosts

This directive is used to specify a directory which contains object  
configuration files that Nagios should use for monitoring. All files  
in the directory with a .cfg extension are processed as object config  
files. Additionally, Nagios will recursively process all config files  
in subdirectories of the directory you specify here. You can seperate  
your configuration files into different directories and specify  
multiple cfg_dir= statements to have all config files in each  
directory processed.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-16 Thread Marc Powell

On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:

 Hello,

 I’m very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS  
 RHEL 5.1. I used the FC6 instructions for my installation.  I’ve  
 successfully installed the program per the Quick-start guide  
 provided on the Website.  We presently have another server with an  
 older version of Nagios installed.  It’s using “cfg_dir=/opt/nagios/ 
 etc” as its location for all *.cfg giles.

 Here's a problem: When I try to create an alternate directory  
 (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR  
 when I try to restart the service. I would like to use “cfg_dir=/opt/ 
 nagios/etc/main” to hold all the config files. Here is a list of  
 that directory right now:

 [root@ ~ main]# ls -l
 total 68
 -rwxrwxr-x 1 nagios nagios  7714 Feb 13 16:55 commands.cfg
 -rwxrwxr-x 1 nagios nagios  2166 Feb 13 16:52 contacts.cfg
 -rwxrwxr-x 1 nagios nagios   240 Feb 13 14:28 hostgroups.cfg
 -rwxrwxr-x 1 nagios nagios   163 Feb 13 16:51 hosts.cfg
 -rwxrwxr-x 1 nagios nagios  2414 Feb 13 16:39 services.cfg
 -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg
 -rwxrwxr-x 1 nagios nagios  3209 Feb 13 16:55 timeperiods.cfg
 [root@ ~ main]# service nagios restart
 Running configuration check... CONFIG ERROR!  Restart aborted.   
 Check your Nagios configuration.

Seems like one of the config files probably has an error in it. Run '/ 
path/to/nagios -v /path/to/nagios.cfg'.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-16 Thread Eric Chatham
[root@ ~ bin]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Error: Unexpected token or statement in file 
'/opt/nagios/etc/main/commands.cfg' on line 1.

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

Eric Chatham


-Original Message-
From: Marc Powell [mailto:m...@ena.com]
Sent: Monday, February 16, 2009 16:38
To: Nagios Users
Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:

 Hello,

 I'm very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS
 RHEL 5.1. I used the FC6 instructions for my installation.  I've
 successfully installed the program per the Quick-start guide
 provided on the Website.  We presently have another server with an
 older version of Nagios installed.  It's using cfg_dir=/opt/nagios/
 etc as its location for all *.cfg giles.

 Here's a problem: When I try to create an alternate directory
 (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR
 when I try to restart the service. I would like to use cfg_dir=/opt/
 nagios/etc/main to hold all the config files. Here is a list of
 that directory right now:

 [root@ ~ main]# ls -l
 total 68
 -rwxrwxr-x 1 nagios nagios  7714 Feb 13 16:55 commands.cfg
 -rwxrwxr-x 1 nagios nagios  2166 Feb 13 16:52 contacts.cfg
 -rwxrwxr-x 1 nagios nagios   240 Feb 13 14:28 hostgroups.cfg
 -rwxrwxr-x 1 nagios nagios   163 Feb 13 16:51 hosts.cfg
 -rwxrwxr-x 1 nagios nagios  2414 Feb 13 16:39 services.cfg
 -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg
 -rwxrwxr-x 1 nagios nagios  3209 Feb 13 16:55 timeperiods.cfg
 [root@ ~ main]# service nagios restart
 Running configuration check... CONFIG ERROR!  Restart aborted.
 Check your Nagios configuration.

Seems like one of the config files probably has an error in it. Run '/
path/to/nagios -v /path/to/nagios.cfg'.

--
Marc


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

CONFIDENTIAL.  This e-mail and any attached files are confidential and should 
be destroyed and/or returned if you are not the intended and proper recipient.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] New to Nagios - Need help with nagios.cfg

2009-02-16 Thread Hau Phan
What's the first line in your commands.cfg?

Eric Chatham wrote:
 [root@ ~ bin]# /usr/local/nagios/bin/nagios -v 
 /usr/local/nagios/etc/nagios.cfg

 Nagios 3.0.6
 Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
 Last Modified: 12-01-2008
 License: GPL

 Reading configuration data...

 Error: Unexpected token or statement in file 
 '/opt/nagios/etc/main/commands.cfg' on line 1.

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

 Eric Chatham


 -Original Message-
 From: Marc Powell [mailto:m...@ena.com]
 Sent: Monday, February 16, 2009 16:38
 To: Nagios Users
 Subject: Re: [Nagios-users] New to Nagios - Need help with nagios.cfg


 On Feb 16, 2009, at 2:58 PM, Eric Chatham wrote:

   
 Hello,

 I'm very new to Nagios.  I'm running version Nagios 3.0.6 on CentOS
 RHEL 5.1. I used the FC6 instructions for my installation.  I've
 successfully installed the program per the Quick-start guide
 provided on the Website.  We presently have another server with an
 older version of Nagios installed.  It's using cfg_dir=/opt/nagios/
 etc as its location for all *.cfg giles.

 Here's a problem: When I try to create an alternate directory
 (cfg_dir) in the nagios config file, I keep getting a CONFIG ERROR
 when I try to restart the service. I would like to use cfg_dir=/opt/
 nagios/etc/main to hold all the config files. Here is a list of
 that directory right now:

 [root@ ~ main]# ls -l
 total 68
 -rwxrwxr-x 1 nagios nagios  7714 Feb 13 16:55 commands.cfg
 -rwxrwxr-x 1 nagios nagios  2166 Feb 13 16:52 contacts.cfg
 -rwxrwxr-x 1 nagios nagios   240 Feb 13 14:28 hostgroups.cfg
 -rwxrwxr-x 1 nagios nagios   163 Feb 13 16:51 hosts.cfg
 -rwxrwxr-x 1 nagios nagios  2414 Feb 13 16:39 services.cfg
 -rwxrwxr-x 1 nagios nagios 10812 Feb 13 16:41 templates.cfg
 -rwxrwxr-x 1 nagios nagios  3209 Feb 13 16:55 timeperiods.cfg
 [root@ ~ main]# service nagios restart
 Running configuration check... CONFIG ERROR!  Restart aborted.
 Check your Nagios configuration.
 

 Seems like one of the config files probably has an error in it. Run '/
 path/to/nagios -v /path/to/nagios.cfg'.

 --
 Marc


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
 -Strategies to boost innovation and cut costs with open source participation
 -Receive a $600 discount off the registration fee with the source code: SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nagios-users
 ::: Please include Nagios version, plugin version (-v) and OS when reporting 
 any issue.
 ::: Messages without supporting info will risk being sent to /dev/null

 CONFIDENTIAL.  This e-mail and any attached files are confidential and should 
 be destroyed and/or returned if you are not the intended and proper recipient.

 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
 -Strategies to boost innovation and cut costs with open source participation
 -Receive a $600 discount off the registration fee with the source code: SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/nagios-users
 ::: Please include Nagios version, plugin version (-v) and OS when reporting 
 any issue. 
 ::: Messages without supporting info will risk being sent to /dev/null

   

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent