Re: [Nagios-users] How to surpess notifications if ping fails.
For some reason notifications are not being sent from nagios when i unplug the network cable from one of the hosts being monitored. Nagios recognizes that the hose is down but no notification... [1246567497] HOST ALERT: psefilesrv;DOWN;SOFT;1;(No Information Returned From Host Check) [1246567528] Warning: Host check command '/usr/lib/nagios/plugins/check_ping -H 10.139.68.39 -w 3000.0,80% -c 5000.0,100% -p 5' for host 'psefilesrv' timed out after 30 seconds [1246567528] HOST ALERT: psefilesrv;DOWN;SOFT;2;(No Information Returned From Host Check) [1246567559] Warning: Host check command '/usr/lib/nagios/plugins/check_ping -H 10.139.68.39 -w 3000.0,80% -c 5000.0,100% -p 5' for host 'psefilesrv' timed out after 30 seconds [1246567559] HOST ALERT: psefilesrv;DOWN;HARD;3;(No Information Returned From Host Check) [1246567559] HOST NOTIFICATION: root;psefilesrv;DOWN;host-notify-by-email;(No Information Returned From Host Check) Here is the host config... define host{ host_name psefilesrv alias misc address10.139.68.39 usegeneric-host check_command check_alive notification_optionsd,r max_check_attempts 3 check_interval 1 notification_interval 1 notification_period 24x7 notifications_enabled 1 parentsswitch-office } And the command... define command { command_namecheck_alive command_line/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 } Any thoughts to why this isn't working? Email notifications for other services is working fine. Maybe i need to add check_alive as a service? Thanks, JJ On Wed, Jul 1, 2009 at 3:17 PM, Jeremiah Jester jeremiahjes...@gmail.comwrote: I removed it and notifications are still being sent for all services associated with this host. Thoughts? JJ On Wed, Jul 1, 2009 at 3:15 PM, Jon Angliss j...@netdork.net wrote: Jeremiah Jester wrote: Hmmm, tryied this...but not working. Also, i get an error when i specify 'retry_interval'. maybe n agios3 only? define host{ host_name psedev2 alias dev check_command check-host-alive notification_optionsd,r max_check_attempts 3 check_interval 1 retry_interval 1 address 10.139.10.42 use generic-host parents switch-office } Error log: [1246481763] Error: Invalid host object directive 'retry_interval'. [1246481763] Error: Could not add object property in file '/etc/nagios2/conf.d/generic-host_nagios2.cfg' on line 143. [1246481763] Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=27490) Yep, that'd be a nagios 3 option. I'd not realized (or maybe missed) you were using v2. Just remove that option. -- Jon Angliss j...@netdork.net Thanks, JJ On Tue, Jun 30, 2009 at 9:08 PM, Jon Angliss j...@netdork.net mailto:j...@netdork.net wrote: Jeremiah Jester wrote: Jon, Thanks for the reply. I've been struggling with this for some days. Can you give me an example of what how to define this and in what file? I would appreciate your help. Files don't really matter. Nagios loads them all, and processes. Its up to you how you want to format. Sometimes it's easier to group by type (hosts, services, commands, etc), and others by location (server room, etc). How you format is up to you. If you want, you can even bundle it all in a single file. Lines ending in \ are wrapped and should appear on a single line in your config. define command { command_namecheck-host-alive command_line$USER1$/check_ping -H $HOSTADDRESS$ \ -w 3000.0,80% -c 5000.0,100% \ -p 5 } define command { command_namecheck_http command_line$USER1$/check_http -H $HOSTNAME$ } define host { host_name myhost address 1.1.1.1 check_command check-host-alive notification_optionsd,r check_periodAll max_check_attempts 3 check_interval 1 retry_interval 1 contact_groups mycontacts } define service { host_name myhost check_command check_http {.. other stuff here .. } } This will execute check_http against the myhost. check-host-alive will be executed every 1 minute. If check-host-alive fails 3 times, host is considered down, and alerts for
Re: [Nagios-users] How to surpess notifications if ping fails.
On Jul 2, 2009, at 3:54 PM, Jeremiah Jester wrote: For some reason notifications are not being sent from nagios when i unplug the network cable from one of the hosts being monitored. Nagios recognizes that the hose is down but no notification... [1246567559] HOST NOTIFICATION: root;psefilesrv;DOWN;host-notify-by- email;(No Information Returned From Host Check) Here, nagios is running the 'host-notify-by-email' command for the contact named 'root'. It's trying to send a notification. Does that command_line work as the nagios user from the command line? Do you see any indication of the attempt in your mail server log files on the nagios machine? If it's not obvious what the problem is, please post that command{} definition, the contact{} definition for root and your test from the command line as well as any errors seen. -- 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
Re: [Nagios-users] How to surpess notifications if ping fails.
Hmmm, tryied this...but not working. Also, i get an error when i specify 'retry_interval'. maybe n agios3 only? define host{ host_name psedev2 alias dev check_command check-host-alive notification_optionsd,r max_check_attempts 3 check_interval 1 retry_interval 1 address 10.139.10.42 use generic-host parents switch-office } Error log: [1246481763] Error: Invalid host object directive 'retry_interval'. [1246481763] Error: Could not add object property in file '/etc/nagios2/conf.d/generic-host_nagios2.cfg' on line 143. [1246481763] Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=27490) Thanks, JJ On Tue, Jun 30, 2009 at 9:08 PM, Jon Angliss j...@netdork.net wrote: Jeremiah Jester wrote: Jon, Thanks for the reply. I've been struggling with this for some days. Can you give me an example of what how to define this and in what file? I would appreciate your help. Files don't really matter. Nagios loads them all, and processes. Its up to you how you want to format. Sometimes it's easier to group by type (hosts, services, commands, etc), and others by location (server room, etc). How you format is up to you. If you want, you can even bundle it all in a single file. Lines ending in \ are wrapped and should appear on a single line in your config. define command { command_namecheck-host-alive command_line$USER1$/check_ping -H $HOSTADDRESS$ \ -w 3000.0,80% -c 5000.0,100% \ -p 5 } define command { command_namecheck_http command_line$USER1$/check_http -H $HOSTNAME$ } define host { host_name myhost address 1.1.1.1 check_command check-host-alive notification_optionsd,r check_periodAll max_check_attempts 3 check_interval 1 retry_interval 1 contact_groups mycontacts } define service { host_name myhost check_command check_http {.. other stuff here .. } } This will execute check_http against the myhost. check-host-alive will be executed every 1 minute. If check-host-alive fails 3 times, host is considered down, and alerts for check_http will be suppressed. You should read up on host checks [1], service checks [2], and notifications [3]. Also, I've not seen v3 in the repsository but maybe i need to change my sources? You didn't mention which version of ubuntu you were using, but jaunty has nagios3... http://packages.ubuntu.com/jaunty/nagios3 [1]: http://nagios.sourceforge.net/docs/3_0/hostchecks.html [2]: http://nagios.sourceforge.net/docs/3_0/servicechecks.html [3]: http://nagios.sourceforge.net/docs/3_0/notifications.html -- Jon Angliss j...@netdork.net -- ___ 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] How to surpess notifications if ping fails.
Jeremiah Jester wrote: Hmmm, tryied this...but not working. Also, i get an error when i specify 'retry_interval'. maybe n agios3 only? define host{ host_name psedev2 alias dev check_command check-host-alive notification_optionsd,r max_check_attempts 3 check_interval 1 retry_interval 1 address 10.139.10.42 use generic-host parents switch-office } Error log: [1246481763] Error: Invalid host object directive 'retry_interval'. [1246481763] Error: Could not add object property in file '/etc/nagios2/conf.d/generic-host_nagios2.cfg' on line 143. [1246481763] Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=27490) Yep, that'd be a nagios 3 option. I'd not realized (or maybe missed) you were using v2. Just remove that option. -- Jon Angliss j...@netdork.net Thanks, JJ On Tue, Jun 30, 2009 at 9:08 PM, Jon Angliss j...@netdork.net mailto:j...@netdork.net wrote: Jeremiah Jester wrote: Jon, Thanks for the reply. I've been struggling with this for some days. Can you give me an example of what how to define this and in what file? I would appreciate your help. Files don't really matter. Nagios loads them all, and processes. Its up to you how you want to format. Sometimes it's easier to group by type (hosts, services, commands, etc), and others by location (server room, etc). How you format is up to you. If you want, you can even bundle it all in a single file. Lines ending in \ are wrapped and should appear on a single line in your config. define command { command_namecheck-host-alive command_line$USER1$/check_ping -H $HOSTADDRESS$ \ -w 3000.0,80% -c 5000.0,100% \ -p 5 } define command { command_namecheck_http command_line$USER1$/check_http -H $HOSTNAME$ } define host { host_name myhost address 1.1.1.1 check_command check-host-alive notification_optionsd,r check_periodAll max_check_attempts 3 check_interval 1 retry_interval 1 contact_groups mycontacts } define service { host_name myhost check_command check_http {.. other stuff here .. } } This will execute check_http against the myhost. check-host-alive will be executed every 1 minute. If check-host-alive fails 3 times, host is considered down, and alerts for check_http will be suppressed. You should read up on host checks [1], service checks [2], and notifications [3]. Also, I've not seen v3 in the repsository but maybe i need to change my sources? You didn't mention which version of ubuntu you were using, but jaunty has nagios3... http://packages.ubuntu.com/jaunty/nagios3 [1]: http://nagios.sourceforge.net/docs/3_0/hostchecks.html [2]: http://nagios.sourceforge.net/docs/3_0/servicechecks.html [3]: http://nagios.sourceforge.net/docs/3_0/notifications.html -- Jon Angliss j...@netdork.net mailto:j...@netdork.net -- Jon Angliss j...@netdork.net -- ___ 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] How to surpess notifications if ping fails.
On Mon, 29 Jun 2009 14:57:19 -0700, Jeremiah Jester jeremiahjes...@gmail.com wrote: Hello, I have a working nagios2 installation under Ubuntu. I would like to configure nagios so that when a host cannot be ping'd by nagios all other services related to this server/s are stopped so I don't get a slew of notifications for that host. I'm thinking i want servicedepency directive in my dependecies.cfg file? Does this sound about right? define servicedependency{ hostgroup_name servers service_description ping dependent_hostgroup_nameservers dependent_service_description * execution_failure_criteria w,c notification_failure_criteria w,u,c } Yes, that's one way to do it, though over-complicating it. The other is to actually have ping (usually defined as check-host-alive) as the host check, when the host is unreachable, the notifications for the services will not be sent. Nagios3 would also be a good idea for an upgrade (something I believe ubuntu has as a package already) as the host checks are much better in v3. -- Jonathan Angliss j...@netdork.net -- ___ 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] How to surpess notifications if ping fails.
Jeremiah Jester wrote: Jon, Thanks for the reply. I've been struggling with this for some days. Can you give me an example of what how to define this and in what file? I would appreciate your help. Files don't really matter. Nagios loads them all, and processes. Its up to you how you want to format. Sometimes it's easier to group by type (hosts, services, commands, etc), and others by location (server room, etc). How you format is up to you. If you want, you can even bundle it all in a single file. Lines ending in \ are wrapped and should appear on a single line in your config. define command { command_namecheck-host-alive command_line$USER1$/check_ping -H $HOSTADDRESS$ \ -w 3000.0,80% -c 5000.0,100% \ -p 5 } define command { command_namecheck_http command_line$USER1$/check_http -H $HOSTNAME$ } define host { host_name myhost address 1.1.1.1 check_command check-host-alive notification_optionsd,r check_periodAll max_check_attempts 3 check_interval 1 retry_interval 1 contact_groups mycontacts } define service { host_name myhost check_command check_http {.. other stuff here .. } } This will execute check_http against the myhost. check-host-alive will be executed every 1 minute. If check-host-alive fails 3 times, host is considered down, and alerts for check_http will be suppressed. You should read up on host checks [1], service checks [2], and notifications [3]. Also, I've not seen v3 in the repsository but maybe i need to change my sources? You didn't mention which version of ubuntu you were using, but jaunty has nagios3... http://packages.ubuntu.com/jaunty/nagios3 [1]: http://nagios.sourceforge.net/docs/3_0/hostchecks.html [2]: http://nagios.sourceforge.net/docs/3_0/servicechecks.html [3]: http://nagios.sourceforge.net/docs/3_0/notifications.html -- Jon Angliss j...@netdork.net -- ___ 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] How to surpess notifications if ping fails.
Hello, I have a working nagios2 installation under Ubuntu. I would like to configure nagios so that when a host cannot be ping'd by nagios all other services related to this server/s are stopped so I don't get a slew of notifications for that host. I'm thinking i want servicedepency directive in my dependecies.cfg file? Does this sound about right? define servicedependency{ hostgroup_name servers service_description ping dependent_hostgroup_nameservers dependent_service_description * execution_failure_criteria w,c notification_failure_criteria w,u,c } Thanks, JJ -- ___ 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