directives question

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Tue May 13 18:46:30 CEST 2003


Timothy Moore wrote:
> O...K...A...Y  I'll play along......Where do I insert the 
> custom directive in the services.cfg?
> I have created a plugin to ping the interfaces. I have 
> created a service to call the plugin. I need to pass multiple 
> addresses to the service to the plugin. Using arguments with 
> the check_command directive within services.cfg requires a 
> definition for every host, and then I'm maintaining host 
> addresses in two configuration files.

I'm not sure where you get "need to pass multiple addresses to the service to the plugin" from.  Sure, if you want to write a custom plugin, then by all means, do so.  But you're making unnecessary work, judging from what you've mentioned in this e-mail.

> Yes, I have thought out my design. I want to "service alert" 
> if *any* interface is down (including the primary IP), but 
> "host alert" if a specific IP is down. Ex: page the backup 
> admin if that interface is down, page All if host is down.

Since a service for a given IP is implicitly dependent on the host check for that IP, then if your host check is based on check_ping, once that check fails, you won't be receiving any notifications for the service check.

Having said that, it should be simple enough to do what you want:

- define a host check on the primary IP
- define separate service checks using check_ping for each of the other IPs
- associate the appropriate contact group for each of the check_ping service checks,
  e.g., contact_group backup-admins for the check_ping on the backup interface

In case you don't already have it, add this to checkcommands.cfg:

# 'check_ping' command definition
define command{
        command_name    check_ping
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
        }

> Let me rephrase my question. Q: Can you create custom 
> directives within a definition?

Not to my knowledge.  The superb docco (to borrow from Mr. Hopcroft :) will tell you which directives are mandatory and which ones are optional.

> Nota bene: (Before you reply, stop and give this some 
> thought, as you might actually figure out the desired design, 
> thus saving you a few e-mails. ;-)

I should have originally phrased it, "thus saving *me* a few e-mails".

I'm certain you have enough info to work with now.  No doubt you can create beautiful definitions in your services.cfg file to satisfy your requirements without further input from me.

jc


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
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