Subject: problems with the depends: directive

From: "Chris Stith" <[email-masked]>
Date: Mon, 29 Mar 2004 10:34:06 -0600

I'm running v3.2.1 and am having no joy with the depends:
directive.

I've read befor eon the list archive (thanks Josef) that
the directive must be the first thing in a group and that
in version 3.2.1 something cannot depend on a service.

I have groups, hosts, and services set up to depend on
other things. Some are set up to depend on particular
server45s, switches, or routers, and some are set up to
depend on services. None of them seem to work.

I do have nested groups, n case that makes a difference.

Here's an abbreviated snippet of the config which shows
what I mean (with names and addresses changed to protect
the innocent, and other interfaces which only differ by
name and OID removed):

Group "Townname" {
        depends: Top:Monitortown:mainrouter
        Host "1town2610" {
                hostname: 10.0.0.3
                Service Ping
                Group "Serv" {
                        depends: Top:Townname:1town2610:Ping_10.0.0.3
                        Service TCP/Telnet
                        Service UDP/SNMP {
                                label: Ethernet0/0 (int 1)
                                messagedn: %O Ethernet0/0 (int 1) is
DOWN
                                messageup: %O Ethernet0/0 (int 1) is UP
                                oid: .1.3.6.1.2.1.2.2.1.8.1
                                expect: 1
                        }

                }
        }
        Host "1towndialup" {
                depends: Top:Townname:1town2610
                hostname: 10.0.0.10
                Service Ping
                Group "Serv" {
                        depends: Top:Townname:1towndialup:Ping_10.0.0.10
                        Service TCP/Telnet
                        Service UDP/SNMP {
                                label: FastEthernet0 (int 2)
                                messagedn: %O FastEthernet0 (int 2) is
DOWN
                                messageup: %O FastEthernet0 (int 2) is
UP
                                oid: .1.3.6.1.2.1.2.2.1.8.2
                                expect: 1
                        }

                }
        }
        Host "5towndialup" {
                depends: Top:Townname:1town2610
                hostname: 10.0.0.206
                Service Ping
                Group "Serv" {
                        depends:
Top:Townname:5towndialup:Ping_10.0.0.206
                        Service TCP/Telnet
                        Service UDP/SNMP {
                                label: Ethernet0 (int 1)
                                messagedn: %O Ethernet0 (int 1) is DOWN
                                messageup: %O Ethernet0 (int 1) is UP
                                oid: .1.3.6.1.2.1.2.2.1.8.1
                                expect: 1
                        }
                }
        }
}

If memory serves, the "Top:Townname:1towndialup:Ping" version didn't
work either, and the logs actually said it couldn't be resolved that
way or something. (Not that my memory is necessarily serving me well
today.)

I would at least, from the descriptions I've read, expect the
"depends: Top:Townname:1town2610" part to work. It doesn't. I've been
wondering if that has to do with the groups being nested.

--
Chris S.
[email-masked]
Family Online, 888-332-6843

---

From: Jeff Weisberg <[email-masked]>
Date: Mon, 29 Mar 2004 13:02:37 -0500 (EST)

| I'm running v3.2.1 and am having no joy with the depends:
| directive.
| 
| I've read befor eon the list archive (thanks Josef) that
| the directive must be the first thing in a group and that
| in version 3.2.1 something cannot depend on a service.

huh?
no. and no.
cargo cult configuration?

| I have groups, hosts, and services set up to depend on
| other things. Some are set up to depend on particular
| server45s, switches, or routers, and some are set up to
| depend on services. None of them seem to work.

"None of them seem to work" is rather vague.

I'm inclined to believe that it is "working" but since
your config just isn't what you want.

| Group "Townname" {
| 	  depends: Top:Monitortown:mainrouter

this puts a depends on the 'Townname' group. nothing else.
it will have no effect on anything inside the group.

it isn't clear to me how that could be interesting here,
perhaps you wanted to place the depends on a Service.

| 	  Host "1towndialup" {
| 		  depends: Top:Townname:1town2610
| 		  hostname: 10.0.0.10
| 		  Service Ping
| 		  Group "Serv" {
| 			  depends: Top:Townname:1towndialup:Ping_10.0.0.10
| 			  Service TCP/Telnet
| 			  Service UDP/SNMP {
| 				  label: FastEthernet0 (int 2)
| 				  messagedn: %O FastEthernet0 (int 2) is DOWN
| 				  messageup: %O FastEthernet0 (int 2) is UP
| 				  oid: .1.3.6.1.2.1.2.2.1.8.2
| 				  expect: 1
| 			  }
| 
| 		  }
| 	  }

I'm not sure what you are trying to do, or what you are expecting
to happen, but my best guess as to what you are trying to do, are
you looking perhaps to just move the 'sendnotify'?

	Host "1towndialup" {
		sendnotify:	yes

		Service Ping {
			sendnotify:	no
		}

		# ...
	}

	--jeff

---

From: "Jeremy Kister" <[email-masked]>
Date: Mon, 29 Mar 2004 16:20:21 -0500

> in version 3.2.1 something cannot depend on a service.

As jeff writes in his next message, both of these statements are wrong.

>                                label: FastEthernet0 (int 2)

I beleive you are making an assumtion that depends is an inherited key -- it
is not.

Instead of putting depends under your Group object, put it in the Service
object.
Host "1towndialup" {
  hostname: 10.0.0.10
  Service Ping {
    depends: Top:Townname:1town2610
    Group "Serv" {
      Service TCP/Telnet {
        depends: Top:Townname:1towndialup:Ping_10.0.0.10
      }
      Service UDP/SNMP {
        depends: Top:Townname:1towndialup:Ping_10.0.0.10
        label: FastEthernet0 (int 2)

Jeremy Kister
www.jeremykister.com/jeremy/