Redundant Monitoring notifications not enabling

Martinez, Eduardo [BSD] - ADM emartine at bsd.uchicago.edu
Thu Jul 16 21:51:27 CEST 2009


I found out what my issue was. I had a colleague double check my work, I
needed a second set of eyes. Apparently, executing the
handle-master-proc-event manually with the appropriate syntax for
executing the "enable_notifications" script displayed an error. I added
a double ;; after the "WARNING)" as shown below.... After adding this it
worked. Maybe this should be updated in the main documentation? 


Service Event Handler (handle-master-proc-event):

#!/bin/sh

# Only take action on hard service states...
case "$2" in
HARD)
	case "$1" in
	CRITICAL)
		# The master Nagios process is not running!
		# We should now become the master host and
		# take over the responsibility of monitoring
		# the network, so enable notifications...
	
/usr/local/nagios/libexec/eventhandlers/enable_notifications
		;;
	WARNING)
	      ;;
	UNKNOWN)
		# The master Nagios process may or may not
		# be running.. We won't do anything here, but
		# to be on the safe side you may decide you 
		# want the slave host to become the master in
		# these situations...
		;;
	OK)
		# The master Nagios process running again!
		# We should go back to being the slave host, 
		# so disable notifications...
	
/usr/local/nagios/libexec/eventhandlers/disable_notifications
		;;
	esac
	;;
esac
exit 0


-Eduardo




-----Original Message-----
From: nagios-users-request at lists.sourceforge.net
[mailto:nagios-users-request at lists.sourceforge.net] 
Sent: Thursday, July 16, 2009 7:22 AM
To: nagios-users at lists.sourceforge.net
Subject: Nagios-users Digest, Vol 38, Issue 27

Send Nagios-users mailing list submissions to
	nagios-users at lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/nagios-users
or, via email, send a message with subject or body 'help' to
	nagios-users-request at lists.sourceforge.net

You can reach the person managing the list at
	nagios-users-owner at lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nagios-users digest..."


Today's Topics:

   1. Re: Dynamically generated service checks (Marc Powell)
   2. Re: Dynamically generated service checks (Max)
   3. nagios log file date format (shadih rahman)
   4. Re: Dynamically generated service checks (David Rosenstrauch)
   5. Re: Dynamically generated service checks (Mark Gius)
   6. Re: Dynamically generated service checks (Max)
   7. Re: nagios host limits (Conor Shovlin)
   8. Re: nagios log file date format (Chris Waters)
   9. Redundant Monitoring notifications not enabling
      (Martinez, Eduardo [BSD] - ADM)
  10. Re: nagios log file date format (Marc Powell)
  11. Re: Dynamically generated service checks (Marc Powell)
  12. Re: nagios host limits (Marc Powell)
  13. strange results from v2.11 vs. 3.0.6 for check_snmp (Natalie Aloi)
  14. Re: strange results from v2.11 vs. 3.0.6 for	check_snmp
      (Marc Powell)
  15. Re: Dynamically generated service checks (Kevin Keane)
  16. Testing Apache - mysql connectivity using php (Swati Tiwari)
  17. Re: Testing Apache - mysql connectivity using php (Jon Angliss)
  18. Re: nagios host limits (Conor Shovlin)


----------------------------------------------------------------------

Message: 1
Date: Wed, 15 Jul 2009 10:47:11 -0500
From: Marc Powell <marc at ena.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <ACA65480-934C-4B93-9B10-FA71D0A150C5 at ena.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Jul 15, 2009, at 10:19 AM, David Rosenstrauch wrote:

> Matthew Jurgens wrote:

> 2) If I understand correctly, Nagios loads its config files at startup
> time and does not re-read them after that.  So if I'm regenerating a
> config file, then that means I'd need to restart the Nagios service
> afterwards, which is a bit of an onerous imposition.

Using the init script, restart stops and starts the daemon, reload  
sends a HUP signal to the running process to tell it to re-read it's  
config files. The init script verifies config before doing either. You  
could manually HUP the running process if you're sure the config files  
are syntactically correct.

>  And although
> again, I could in theory do this in a cron job, I'm not sure I'm
> comfortable with that.  There's the potential for the Nagios service  
> to
> not start up again successfully, and I don't like taking the risk that
> this dynamic update procedure could potentially bring down the entire
> Nagios system.

I've been doing this exact thing (nagios reload) hourly for several  
years quite successfully. If you wanted to be paranoid about it, you  
could script a run of '/path/to/nagios -v /path/to/nagios.cfg' and  
only reload if that exits 0 else send yourself an e-mail with the bad  
output.

--
Marc



------------------------------

Message: 2
Date: Wed, 15 Jul 2009 12:02:41 -0400
From: Max <perldork at webwizarddesign.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: David Rosenstrauch <darose at darose.net>
Cc: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID:
	<f7aebadd0907150902r4556209dw5585a4ead235b3b9 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Jul 15, 2009 at 11:19 AM, David Rosenstrauch<darose at darose.net>
wrote:
> 2) If I understand correctly, Nagios loads its config files at startup
> time and does not re-read them after that. ?So if I'm regenerating a
> config file, then that means I'd need to restart the Nagios service
> afterwards, which is a bit of an onerous imposition. ?And although
> again, I could in theory do this in a cron job, I'm not sure I'm
> comfortable with that.

As long as you are not using ePN, you can just send a HUP signal to
the parent Nagios process; this will cause it to re-read the
configuration file(s) from disk.

> There's the potential for the Nagios service to
> not start up again successfully, and I don't like taking the risk that
> this dynamic update procedure could potentially bring down the entire
> Nagios system.

We let our users make changes via SVN using a branch per project, tag
their code, then we merge their sub-trees into our master configs, tag
our configs, and push them out to our production system; we have a
test instance that  validates the configs with checkconfig before we
push to production.  would be easy enough to have your automated push
out do something similar and send Nagios a trap or an NSCA passive
service to alert you to a bad config and not push to production

Because we do a lot of trending, we restart Nagios every night to
minimize scheduling skew; 20 minutes or so before the auto-restart a
cron job runs that does a checkconfig on the Nagios configuration ..
if the checkconfig fails, it touches a flag file .. the restart script
will then look for this flag and not restart if the flag file is
present.

In other words, there are many programmatic ways to ensure that a bad
restart does not happen, all are pretty straight-forward :).

- Max



------------------------------

Message: 3
Date: Wed, 15 Jul 2009 12:10:29 -0400
From: shadih rahman <shadhin71 at gmail.com>
Subject: [Nagios-users] nagios log file date format
To: nagios-users at lists.sourceforge.net
Message-ID:
	<6db4a4200907150910r1b79360dw37ea533fa3d82d1a at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Is there any way to change nagios log file date format to human readable
format.  I did not see any option in nagios.cfg file.  Please advise on
this.  Thanks

-- 
Cordially,
Shadhin Rahman
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 4
Date: Wed, 15 Jul 2009 12:13:04 -0400
From: David Rosenstrauch <darose at darose.net>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <4A5E0010.4080304 at darose.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Marc Powell wrote:
> On Jul 15, 2009, at 10:19 AM, David Rosenstrauch wrote:
> 
>> Matthew Jurgens wrote:
> 
>> 2) If I understand correctly, Nagios loads its config files at
startup
>> time and does not re-read them after that.  So if I'm regenerating a
>> config file, then that means I'd need to restart the Nagios service
>> afterwards, which is a bit of an onerous imposition.
> 
> Using the init script, restart stops and starts the daemon, reload  
> sends a HUP signal to the running process to tell it to re-read it's  
> config files. The init script verifies config before doing either. You

> could manually HUP the running process if you're sure the config files

> are syntactically correct.
> 
>>  And although
>> again, I could in theory do this in a cron job, I'm not sure I'm
>> comfortable with that.  There's the potential for the Nagios service

>> to
>> not start up again successfully, and I don't like taking the risk
that
>> this dynamic update procedure could potentially bring down the entire
>> Nagios system.
> 
> I've been doing this exact thing (nagios reload) hourly for several  
> years quite successfully. If you wanted to be paranoid about it, you  
> could script a run of '/path/to/nagios -v /path/to/nagios.cfg' and  
> only reload if that exits 0 else send yourself an e-mail with the bad

> output.
> 
> --
> Marc

Thanks much for these pointers (and the quick response).  Didn't know 
about the SIGHUP thing.

Well, it's good to know that this is a viable option.  Still, re-writing

a config file seems a bit of a kludgey way to handle this.

I'm mulling over another idea, which I'm calling a "rotating" service 
check (for lack of a better word).  Basic idea is:  I set up one single 
service (rather than a service for each tag/file), and each time the 
service runs it automatically "rotates" to check the next tag/file.  If 
the check fails, then it stops rotating and continues checking that 
tag/file until the problem gets fixed.

Still working out the details, though, and not sure if this is a viable 
solution for us or not.  On the one hand, assuming we run the check 
every 5 minutes, then the service check would rotate through and thereby

check all of the tags within some reasonable period of time.  On the 
other hand, if it hits a tag that fails the check, we'd only get an 
alert on that particular tag and wouldn't know if other tags were 
failing the check too.


IMO, the ideal solution here would be if I could just submit passive 
check results for services that aren't explicitly configured in Nagios. 
  But alas, that's not allowed and it fails with messages like "Warning:

  Passive check result was received for service 'foo' on host 
'mysql-dev', but the service could not be found!"


I'll have to mull this over some more ...

Thanks,




------------------------------

Message: 5
Date: Wed, 15 Jul 2009 09:17:04 -0700
From: Mark Gius <mgius at createspace.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: Max <perldork at webwizarddesign.com>
Cc: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <4A5E0100.8060709 at createspace.com>
Content-Type: text/plain; charset="iso-8859-1"

Max wrote:
>
> As long as you are not using ePN, you can just send a HUP signal to
> the parent Nagios process; this will cause it to re-read the
> configuration file(s) from disk.
>
>
> - Max
>   

Slight OT, but why can't you do this with ePN?

-Gius
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 6
Date: Wed, 15 Jul 2009 12:31:34 -0400
From: Max <perldork at webwizarddesign.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: Mark Gius <mgius at createspace.com>
Cc: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID:
	<f7aebadd0907150931q2ce5eb0i83e5df96b02c74fa at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Jul 15, 2009 at 12:17 PM, Mark Gius<mgius at createspace.com>
wrote:
> Max wrote:
>
> As long as you are not using ePN, you can just send a HUP signal to
> the parent Nagios process; this will cause it to re-read the
> configuration file(s) from disk.
>
>
> - Max
>
>
> Slight OT, but why can't you do this with ePN?

Actually, you can, but you will leak a LOT of memory if it works and
it also has a good chance of causing Nagios to crash (I have seen both
situations in the past).



------------------------------

Message: 7
Date: Wed, 15 Jul 2009 17:40:06 +0100
From: Conor Shovlin <conor.shovlin at itforce.ie>
Subject: Re: [Nagios-users] nagios host limits
To: 'Marc Powell' <marc at ena.com>, Nagios Users Mail-list
	<nagios-users at lists.sourceforge.net>
Message-ID:
	
<3BD5EFC3B7FE2D4F937EB0AD711828B603DAABCB27 at ITFVEX1.itforce.local>
Content-Type: text/plain; charset="us-ascii"

Hi Marc,



Here is the config we are adding. These lines cause a perfectly working
config (see before) to causing errors(see after).



define host{

        use                     windows-server  ; Inherit default values
from a template

        host_name               DCFP01        ; The name we're giving to
this host

        alias                   DCFP01        ; A longer name associated
with the host

        address                 172.x.x.x    ; IP address of the host

        hostgroups              Dxxx

        parents                 Axxx

        notification_interval   0

        notification_options    d

        }





As you can see there it is a simple host that we are adding but it
starts throwing errors. As soon as we remove the host all errors clear
and we have no issue. If I remove another host it works.







BEFORE

[root at mon01 objects]# /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...



Running pre-flight check on configuration data...



Checking services...

        Checked 1337 services.

Checking hosts...

        Checked 226 hosts.

Checking host groups...

        Checked 31 host groups.

Checking service groups...

        Checked 2 service groups.

Checking contacts...

        Checked 6 contacts.

Checking contact groups...

        Checked 1 contact groups.

Checking service escalations...

        Checked 0 service escalations.

Checking service dependencies...

        Checked 0 service dependencies.

Checking host escalations...

        Checked 0 host escalations.

Checking host dependencies...

        Checked 0 host dependencies.

Checking commands...

        Checked 60 commands.

Checking time periods...

        Checked 5 time periods.

Checking for circular paths between hosts...

Checking for circular host and service dependencies...

Checking global event handlers...

Checking obsessive compulsive processor commands...

Checking misc settings...



Total Warnings: 0

Total Errors:   0



Things look okay - No serious problems were detected during the
pre-flight check

[root at mon01 objects]#





AFTER

[root at mon01 objects]# /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: Template 'linux-server' specified in host definition could not be
not found (config file '/usr/local/nagios/etc/objects/txxxxhosts.cfg',
starting on line 78)



***> 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 at mon01 objects]#



Regards,

Conor







-----Original Message-----
From: Marc Powell [mailto:marc at ena.com]
Sent: 15 July 2009 16:04
To: Nagios Users Mail-list
Subject: Re: [Nagios-users] nagios host limits





On Jul 15, 2009, at 9:36 AM, Conor Shovlin wrote:



> Hi,

>

> We have an installation of Nagios with 226 hosts. If we try and add

> another host then we are unable restart Nagios service and we get a

> CONFIG error

>

> Does anyone know if there any limitations on Nagios with this?



No. Several of us are monitoring (10's of) thousands of hosts and

services. You certainly have a real configuration error. If you need

help, post the error and corresponding host and service definitions

and anything else that might seem relevant based on the error.



--

Marc





------------------------------------------------------------------------
------

Enter the BlackBerry Developer Challenge

This is your chance to win up to $100,000 in prizes! For a limited time,

vendors submitting new applications to BlackBerry App World(TM) will
have

the opportunity to enter the BlackBerry Developer Challenge. See full
prize

details at: http://p.sf.net/sfu/Challenge

_______________________________________________

Nagios-users mailing list

Nagios-users at 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

________________________________

Any views given in this message are the sender's own, and do not
represent the views of IT Force except where the sender specifically
states them to be the views of IT Force. This e-mail should only be read
by those persons to whom it is addressed. Accordingly, we disclaim all
responsibility and accept no liability (including in negligence) for the
consequences of any person other than the intended recipients acting, or
refraining from acting, on such information. If you have received this
e-mail in error, please accept our apologies and we simply request that
you delete this document. If you have received Spam that you believe has
originated in some way from IT Force, please send a complaint including
the unsolicited email, to info at itforce.ie. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail is strictly prohibited. IT Force Limited is
registered in Ireland No. 310902. Registered office, Molyneux House,
Bride Street, Dublin 8.

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 8
Date: Wed, 15 Jul 2009 09:23:48 -0700
From: "Chris Waters" <CWaters at jeld-wen.com>
Subject: Re: [Nagios-users] nagios log file date format
To: "shadih rahman" <shadhin71 at gmail.com>,
	<nagios-users at lists.sourceforge.net>
Message-ID:
	
<30D62F21FD4BE1448C156D2A3E300397064E12F3 at jwmail01.domain.jw.local>
Content-Type: text/plain;	charset="us-ascii"

You could do something like this:

Replace the paths to reflect your environment.
 
tail -f /usr/local/nagios/var/nagios.log | perl -pe
's/(\d+)/localtime($1)/e'
    or
grep 'something important to look for'
somelogfilewithepochtimestamps.log | perl -pe 's/(\d+)/localtime($1)/e'
    or
perl -pe 's/(\d+)/localtime($1)/e'  somelogfilewithepochtimestamps.log
 

Chris Waters 

________________________________

From: shadih rahman [mailto:shadhin71 at gmail.com] 
Sent: Wednesday, July 15, 2009 9:10 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] nagios log file date format


Is there any way to change nagios log file date format to human readable
format.  I did not see any option in nagios.cfg file.  Please advise on
this.  Thanks

-- 
Cordially,
Shadhin Rahman




------------------------------

Message: 9
Date: Wed, 15 Jul 2009 11:59:48 -0500
From: "Martinez, Eduardo [BSD] - ADM" <emartine at bsd.uchicago.edu>
Subject: [Nagios-users] Redundant Monitoring notifications not
	enabling
To: <nagios-users at lists.sourceforge.net>
Message-ID:
	
<A02F8D81577ACA49B1472EE2DA1F81B6EA983E at ADM-EXCHVS01.bsdad.uchicago.edu>
	
Content-Type: text/plain; charset="us-ascii"

 

I have a setup where the Master and Slave servers follow the redundancy
scenario 1 of this document:

 

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

 

Both Servers are running Nagios 3.0.6

The one issue I am running into is that when the Nagios service on the
master host goes down, the slave host does not enable its notifications.

I looked at the paths in each script to ensure it was pointing to the
correct location. (commands.cfg, handle-master-proc-event,
enable_notifications, and disable_notifications) They all look ok.  As a
test I stopped the Nagios service on the master host and looked at the
logs on the slave. I receive the following from the slave host log file

 

 

[1247675796] SERVICE ALERT:
masterhost;check_nagios;CRITICAL;SOFT;1;NAGIOS CRITICAL: Cannot open
status log for reading!

[1247675796] SERVICE EVENT HANDLER:
masterhost;check_nagios;(null);(null);(null);master-process-event

[1247675856] SERVICE ALERT:
masterhost;check_nagios;CRITICAL;SOFT;2;NAGIOS CRITICAL: Cannot open
status log for reading!

[1247675856] SERVICE EVENT HANDLER:
masterhost;check_nagios;(null);(null);(null);master-process-event

[1247675916] SERVICE ALERT:
masterhost;check_nagios;CRITICAL;SOFT;3;NAGIOS CRITICAL: Cannot open
status log for reading!

[1247675916] SERVICE EVENT HANDLER:
masterhost;check_nagios;(null);(null);(null);master-process-event

[1247675976] SERVICE ALERT:
masterhost;check_nagios;CRITICAL;SOFT;4;NAGIOS CRITICAL: Cannot open
status log for reading!

[1247675976] SERVICE EVENT HANDLER:
masterhost;check_nagios;(null);(null);(null);master-process-event

[1247676036] SERVICE ALERT:
masterhost;check_nagios;CRITICAL;HARD;5;NAGIOS CRITICAL: Cannot open
status log for reading!

[1247676036] SERVICE EVENT HANDLER:
masterhost;check_nagios;(null);(null);(null);master-process-event

 

But notifications aren't enabled even after it hits hard.  If I run the
enable_notification and disable_notifications scripts manually they
work. I'm trying to figure out where in the chain is wrong.

 

Anyone have any ideas as to what might be the problem? I'm so very close
to getting this setup.

 

 

-Eduardo

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 10
Date: Wed, 15 Jul 2009 12:34:58 -0500
From: Marc Powell <marc at ena.com>
Subject: Re: [Nagios-users] nagios log file date format
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <2A34C996-4D7C-4902-9755-A91BF19432AD at ena.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Jul 15, 2009, at 11:10 AM, shadih rahman wrote:

> Is there any way to change nagios log file date format to human  
> readable format.  I did not see any option in nagios.cfg file.   
> Please advise on this.  Thanks

http://support.nagios.com/knowledge-base/index.php?option=com_content&vi
ew=article&id=52&catid=35&faq_id=70

--
Marc




------------------------------

Message: 11
Date: Wed, 15 Jul 2009 12:40:50 -0500
From: Marc Powell <marc at ena.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <4DE68D32-E505-4814-AFE8-2BB48062AB85 at ena.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Jul 15, 2009, at 11:13 AM, David Rosenstrauch wrote:

> IMO, the ideal solution here would be if I could just submit passive
> check results for services that aren't explicitly configured in  
> Nagios.
>  But alas, that's not allowed and it fails with messages like  
> "Warning:
>  Passive check result was received for service 'foo' on host
> 'mysql-dev', but the service could not be found!"

That's correct but this would be a lot like submitting SNMP traps to  
nagios. You might glance over that documentation to get ideas. You  
could create a generic service, set it as passive and volatile and  
then just start submitting passive results to it with descriptive/ 
useful output. Each non-ok result would generate an alert so you  
wouldn't miss anything but if you don't build in some protections, you  
could repeat notify about the same problem.

--
Marc




------------------------------

Message: 12
Date: Wed, 15 Jul 2009 12:49:30 -0500
From: Marc Powell <marc at ena.com>
Subject: Re: [Nagios-users] nagios host limits
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <C0FD51FE-5BE9-4F20-B96A-01DAA7AD66BB at ena.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Jul 15, 2009, at 11:40 AM, Conor Shovlin wrote:

> Hi Marc,
>
> Here is the config we are adding. These lines cause a perfectly  
> working config (see before) to causing errors(see after).
>
> define host{
>         use                     windows-server  ; Inherit default  
> values from a template
>         host_name               DCFP01        ; The name we're  
> giving to this host
>         alias                   DCFP01        ; A longer name  
> associated with the host
>         address                 172.x.x.x    ; IP address of the host
>         hostgroups              Dxxx
>         parents                 Axxx
>         notification_interval   0
>         notification_options    d
>         }
>
>
> As you can see there it is a simple host that we are adding but it  
> starts throwing errors. As soon as we remove the host all errors  
> clear and we have no issue. If I remove another host it works

>
> Error: Template 'linux-server' specified in host definition could  
> not be not found (config file '/usr/local/nagios/etc/objects/ 
> txxxxhosts.cfg', starting on line 78)

Definitely strange. This is complaining about a completely different  
and unrelated thing. Does the template 'linux-server' exist ('name  
linux-server')? Is it in the same file as the host definition you are  
trying to add?
	- If so, are you accidentally breaking that definition, removing
the  
final } perhaps or something like that?
	- If not, is the file it is in specified as a cfg_file in
nagios.cfg  
or in a cfg_dir? If cfg_file, what is the load order (not sure it  
matters though but might be interesting).
		- Does it help you move it to the top of the load order?

--
Marc




------------------------------

Message: 13
Date: Wed, 15 Jul 2009 19:22:58 +0000
From: "Natalie Aloi" <naloi at experisdatacenters.com>
Subject: [Nagios-users] strange results from v2.11 vs. 3.0.6 for
	check_snmp
To: "Nagios Users Mail-list" <nagios-users at lists.sourceforge.net>
Message-ID: <W8507118038231591247685778 at webmail22>
Content-Type: text/plain; charset="utf-8"


Hello, I have two versions of nagios running v 2.11 on server nagios and
3.0.6 on dns
when I execute the commands manually from the servers this is my output
can anyone help me understand why when I run the identical commands on
v2.11 I get output from both switches but when I run it on the dns
server only one host responds?

ver 3.0.6 host output below:
[root at dns libexec]# ./check_snmp -C public -H 10.1.100.2 -o
ifOperStatus.1 -r 1 -m RFC1213-MIB
SNMP OK - up(1) |
[root at dns libexec]# ./check_snmp -C public -H 10.1.100.3 -o
ifOperStatus.1 -r 1 -m RFC1213-MIB
SNMP problem - No data received from host
CMD: /usr/bin/snmpget -t 1 -r 5 -m RFC1213-MIB -v 1 [authpriv]
10.1.100.3:161 ifOperStatus.1
[root at dns libexec]#


ver 2.11 output below:
[root at nagios plugins]# ./check_snmp -C public -H 10.1.100.3 -o
ifOperStatus.1 -r 1 -m RFC1213-MIB
SNMP OK - up(1) |
[root at nagios plugins]# ./check_snmp -C public -H 10.1.100.2 -o
ifOperStatus.1 -r 1 -m RFC1213-MIB
SNMP OK - up(1) |
[root at nagios plugins]#



Network Operations Center Manager 
Experis Data Center LLC 
8209 Valley Pike 
PO Box 535 
Middletown,VA 22645 
phone:540-869-8702 
cell:240-988-3267 
fax:540-869-8710 
e-mail:naloi at experisdatacenters.com
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 14
Date: Wed, 15 Jul 2009 15:37:45 -0500
From: Marc Powell <marc at ena.com>
Subject: Re: [Nagios-users] strange results from v2.11 vs. 3.0.6 for
	check_snmp
To: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <317F46EC-EB66-4BD3-B0A7-6C07563F42B6 at ena.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Jul 15, 2009, at 2:22 PM, Natalie Aloi wrote:

> Hello, I have two versions of nagios running v 2.11 on server nagios  
> and 3.0.6 on dns
> when I execute the commands manually from the servers this is my  
> output can anyone help me understand why when I run the identical  
> commands on v2.11 I get output from both switches but when I run it  
> on the dns server only one host responds?
>
> ver 3.0.6 host output below:
> [root at dns libexec]# ./check_snmp -C public -H 10.1.100.2 -o  
> ifOperStatus.1 -r 1 -m RFC1213-MIB
> SNMP OK - up(1) |
> [root at dns libexec]# ./check_snmp -C public -H 10.1.100.3 -o  
> ifOperStatus.1 -r 1 -m RFC1213-MIB
> SNMP problem - No data received from host
> CMD: /usr/bin/snmpget -t 1 -r 5 -m RFC1213-MIB -v 1 [authpriv]  
> 10.1.100.3:161  ifOperStatus.1
> [root at dns libexec]#
>
>
> ver 2.11 output below:
> [root at nagios plugins]# ./check_snmp -C public -H 10.1.100.3 -o  
> ifOperStatus.1 -r 1 -m RFC1213-MIB
> SNMP OK - up(1) |
> [root at nagios plugins]# ./check_snmp -C public -H 10.1.100.2 -o  
> ifOperStatus.1 -r 1 -m RFC1213-MIB
> SNMP OK - up(1) |
> [root at nagios plugins]#
>

I presume that you are testing from two different boxes. As you can  
see from the error output, check_snmp is just a wrapper to /usr/bin/ 
snmpget, which cannot talk to the host 10.1.100.3.  This puts the  
problem outside of nagios and the plugins. Do you have access  
restrictions on the 10.1.110.3 machine blocking the connection from  
the 'dns' host (or somewhere between them)?

--
Marc




------------------------------

Message: 15
Date: Wed, 15 Jul 2009 14:14:58 -0700
From: Kevin Keane <subscription at kkeane.com>
Subject: Re: [Nagios-users] Dynamically generated service checks
Cc: Nagios Users Mail-list <nagios-users at lists.sourceforge.net>
Message-ID: <4A5E46D2.2050003 at kkeane.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Marc Powell wrote:
> On Jul 15, 2009, at 11:13 AM, David Rosenstrauch wrote:
>
>   
>> IMO, the ideal solution here would be if I could just submit passive
>> check results for services that aren't explicitly configured in  
>> Nagios.
>>  But alas, that's not allowed and it fails with messages like  
>> "Warning:
>>  Passive check result was received for service 'foo' on host
>> 'mysql-dev', but the service could not be found!"
>>     
>
> That's correct but this would be a lot like submitting SNMP traps to  
> nagios. You might glance over that documentation to get ideas. You  
> could create a generic service, set it as passive and volatile and  
> then just start submitting passive results to it with descriptive/ 
> useful output. Each non-ok result would generate an alert so you  
> wouldn't miss anything but if you don't build in some protections, you

> could repeat notify about the same problem.
>   
I am using a script to look for these error messages. In my situation, 
the list of services changes only rarely, so all this script does is 
submit another check result to Nagios to alert me that I need to 
manually add a service. You could also use such a script to 
automatically add any new services, and then restart Nagios.

-- 
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to
Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or
proprietary information. Please be advised that the unauthorized use or
disclosure of the information is strictly prohibited. The information
herein is intended only for use by the intended recipient(s) named
above. If you have received this transmission in error, please notify
the sender immediately and permanently delete the e-mail and any copies,
printouts or attachments thereof.




------------------------------

Message: 16
Date: Wed, 15 Jul 2009 15:00:59 -0700
From: Swati Tiwari <its.svati at gmail.com>
Subject: [Nagios-users] Testing Apache - mysql connectivity using php
To: nagios-users at lists.sourceforge.net
Message-ID:
	<5275363e0907151500w64aede84wb412144b300116c0 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello Friends,

I am trying to write a plugin for testing the apache-mysql connectivity
using php. Has anyone done this so far and has any ideas as to how to go
about it. Any ideas would be appreciated. Thank you very much!

-- 
Regards,
Swati
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 17
Date: Thu, 16 Jul 2009 00:21:07 -0500
From: Jon Angliss <jon at netdork.net>
Subject: Re: [Nagios-users] Testing Apache - mysql connectivity using
	php
To: nagios-users at lists.sourceforge.net
Message-ID: <20et55tg9nhvcg50ululm8maoc55p9t2ce at 4ax.com>
Content-Type: text/plain; charset=us-ascii

On Wed, 15 Jul 2009 15:00:59 -0700, Swati Tiwari <its.svati at gmail.com>
wrote:

>Hello Friends,
>
>I am trying to write a plugin for testing the apache-mysql connectivity
>using php. Has anyone done this so far and has any ideas as to how to
go
>about it. Any ideas would be appreciated. Thank you very much!

A simple php script would work, and the check_http with string
matching.

<?php

$conn = @mysql_connect($server,$user,$pass);

if (!$conn) {
	echo 'ERROR';
} else {
	echo 'SUCCESS';
	@mysql_close($conn);
}

?>


Then nagios would execute this...

./check_http -H hostname -u /testdb.php -s SUCCESS

-- 
Jonathan Angliss
<jon at netdork.net>




------------------------------

Message: 18
Date: Thu, 16 Jul 2009 13:21:39 +0100
From: Conor Shovlin <conor.shovlin at itforce.ie>
Subject: Re: [Nagios-users] nagios host limits
To: 'Marc Powell' <marc at ena.com>, Nagios Users Mail-list
	<nagios-users at lists.sourceforge.net>
Message-ID:
	
<3BD5EFC3B7FE2D4F937EB0AD711828B603DAABCB3E at ITFVEX1.itforce.local>
Content-Type: text/plain; charset="us-ascii"

Hi Marc,

The template file doesn't even get changed while we are updating.

I am going to test moving cfg files around this afternoon

Will update once I have done this

Regards,
Conor

-----Original Message-----
From: Marc Powell [mailto:marc at ena.com]
Sent: 15 July 2009 18:50
To: Nagios Users Mail-list
Subject: Re: [Nagios-users] nagios host limits


On Jul 15, 2009, at 11:40 AM, Conor Shovlin wrote:

> Hi Marc,
>
> Here is the config we are adding. These lines cause a perfectly
> working config (see before) to causing errors(see after).
>
> define host{
>         use                     windows-server  ; Inherit default
> values from a template
>         host_name               DCFP01        ; The name we're
> giving to this host
>         alias                   DCFP01        ; A longer name
> associated with the host
>         address                 172.x.x.x    ; IP address of the host
>         hostgroups              Dxxx
>         parents                 Axxx
>         notification_interval   0
>         notification_options    d
>         }
>
>
> As you can see there it is a simple host that we are adding but it
> starts throwing errors. As soon as we remove the host all errors
> clear and we have no issue. If I remove another host it works

>
> Error: Template 'linux-server' specified in host definition could
> not be not found (config file '/usr/local/nagios/etc/objects/
> txxxxhosts.cfg', starting on line 78)

Definitely strange. This is complaining about a completely different
and unrelated thing. Does the template 'linux-server' exist ('name
linux-server')? Is it in the same file as the host definition you are
trying to add?
        - If so, are you accidentally breaking that definition, removing
the
final } perhaps or something like that?
        - If not, is the file it is in specified as a cfg_file in
nagios.cfg
or in a cfg_dir? If cfg_file, what is the load order (not sure it
matters though but might be interesting).
                - Does it help you move it to the top of the load order?

--
Marc


------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will
have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Nagios-users mailing list
Nagios-users at 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


Any views given in this message are the sender's own, and do not
represent the views of IT Force except where the sender specifically
states them to be the views of IT Force. This e-mail should only be read
by those persons to whom it is addressed. Accordingly, we disclaim all
responsibility and accept no liability (including in negligence) for the
consequences of any person other than the intended recipients acting, or
refraining from acting, on such information. If you have received this
e-mail in error, please accept our apologies and we simply request that
you delete this document. If you have received Spam that you believe has
originated in some way from IT Force, please send a complaint including
the unsolicited email, to info at itforce.ie. Any form of reproduction,
dissemination, copying, disclosure, modification, distribution and/or
publication of this e-mail is strictly prohibited. IT Force Limited is
registered in Ireland No. 310902.  Registered office, Molyneux House,
Bride Street, Dublin 8.




------------------------------

------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,

vendors submitting new applications to BlackBerry App World(TM) will
have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize  
details at: http://p.sf.net/sfu/Challenge

------------------------------

_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users


End of Nagios-users Digest, Vol 38, Issue 27
********************************************


This email is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged and confidential. If the reader of this email message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is prohibited. If you have received this email in error, please notify the sender and destroy/delete all copies of the transmittal. Thank you.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Nagios-users mailing list
Nagios-users at 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





More information about the Users mailing list