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] Notification on OK-state

2009-02-13 Thread sri . lumpa
On Feb 12, 2009, at 20:26, Israel Brewster isr...@frontierflying.com wrote:

 Well, since you are writing the OCSP command script, you should be  
 able to have the script itself Filter for hosts you want, i.e if  
 $HOSTNAME$=hostA or hostB, etc then run script, otherwise, do nothing.  

Yes, I was thinking about something like that... A conf file with the name of 
the different services and hosts we want to be notified. I'm working on it ;)

--
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] Notification on OK-state

2009-02-13 Thread sri . lumpa

On Feb 12, 2009, at 20:37, Max perld...@webwizarddesign.com wrote :

 How about setting the notification command in the service to a null
 command of some sort and using a service escalation with the
 escalation states critical, warning, and ok all set and a
 first_notification value of 1 so that you constantly get the
 notification regardess of state?

Hum, I'm not sure of that (but I may have not understood the documentation 
about service escalation correctly). I'll try to use it and I'll tell you about 
the result.

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


[Nagios-users] Notification on OK-state

2009-02-12 Thread sri . lumpa
Hi,

Sorry if that question had already been answered but I couldn't find any answer 
by searching on the web and on the Nagios-User mailing list.

I would like to create a service which will notify me after each check, even if 
it is an OK-state and if the state hadn't changed.

I've tried by setting the service's initial state to critical and defining the 
service as volatile but that doesn't work (it's probably because I didn't 
understand well the role of the initial_state directive...).

Is Nagios-3.0.6 capable to do that and how can I make it work ?

Thanks for the answer.

Marc-André

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
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] Notification on OK-state

2009-02-12 Thread sri . lumpa
Thank you very much for the lead. It helped me a lot and.

I followed your advice and I used the ocsp_command directive from the 
nagios.cfg with a script printing into the file nagios.cmd the external command 
SEND_CUSTOM_SVC_NOTIFICATION and it works fine now.

Thanks for the lead.

- Mail Original -
De: Marc Powell m...@ena.com
À: nagios-users@lists.sourceforge.net
Envoyé: Jeudi 12 Février 2009 14:00:20 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: Re: [Nagios-users] Notification on OK-state


On Feb 12, 2009, at 3:11 AM, sri.lu...@free.fr wrote:

 I would like to create a service which will notify me after each  
 check, even if it is an OK-state and if the state hadn't changed.

 I've tried by setting the service's initial state to critical and  
 defining the service as volatile but that doesn't work (it's  
 probably because I didn't understand well the role of the  
 initial_state directive...).

is_volatile will only send notifications for OK states if it's a  
recovery.

 Is Nagios-3.0.6 capable to do that and how can I make it work ?

Nagios isn't capable of sending OK alerts every time using the normal  
notification logic. It seems to me that the OSCP functionality fits  
your goal the best. OCSP can be used to send a notification or do  
whatever you want, after every check. It's most often used for  
Distributed Monitoring but can really be used for anything.

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

--
Marc






--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
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

--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
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] Notification on OK-state

2009-02-12 Thread sri . lumpa
There is still a small  problem though... With that method, every service with 
obsess_over_service enabled will execute the command, and every command defined 
as ocsp_command in nagios.cfg will be executed by services enabling 
obsess_over_service :s.

Well... don't know if ther is a better way and it works so I keep it for now...

- Mail Original -
De: Marc Powell m...@ena.com
À: Nagios Users nagios-users@lists.sourceforge.net
Envoyé: Jeudi 12 Février 2009 16:51:14 GMT +01:00 Amsterdam / Berlin / Berne / 
Rome / Stockholm / Vienne
Objet: Re: [Nagios-users] Notification on OK-state


On Feb 12, 2009, at 8:45 AM, sri.lu...@free.fr wrote:

 Thank you very much for the lead. It helped me a lot and.

 I followed your advice and I used the ocsp_command directive from  
 the nagios.cfg with a script printing into the file nagios.cmd the  
 external command SEND_CUSTOM_SVC_NOTIFICATION and it works fine now.

... and that is an interesting trick as well ;) I wouldn't have  
thought to send the notification that way.

--
Marc


--
___
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

--
___
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