Discussion:
using NextHop value for default gateway dependency.
John DiSpirito
2012-04-13 16:55:51 UTC
Permalink
John DiSpirito [http://community.zenoss.org/people/jdispirito] created the discussion

"using NextHop value for default gateway dependency."

To view the discussion, visit: http://community.zenoss.org/message/65888#65888

--------------------------------------------------------------
Hello all,

I'm still green when it comes to Zenoss, but I've been doing Linux SA work and shell scripting/programming for years.
I'm hoping some of the seasoned folks here will be able to assist me with my quandry.

I know that zenoss is supposed to know what routers are in front of a device, and if the router goes down, it's not support to alert us about those devices behind the router.

I setup a test VLAN, and put 2 servers, running linux and windows.  Both use SNMP, the windows server uses SNMP+WMI. The gateway is being monitored via ping. 
When I kill the VLAN on my router, it reports all three devices (router, Linux, and Windows) servers are down.

I've done some searching for device dependencies, and I see people are hacking together solutions to work for their exact setup/issue.
I've looked at http://community.zenoss.org/thread/8783?start=15&tstart=0 http://community.zenoss.org/thread/8783?start=15&tstart=0  which has some good ideas, I also saw the KB doc on device dependencies as well, but neither seemed to do what I would like.

Here's what I would like to do in pseudocode via transform (Events/Event Classes/transform)

get the nexthop value for current device
ping/traceroute/etc nexthop value
  if  down, dont send an alert about this device
   else send alert

I thought that I could do something like router=device.getNextHopIp()
but I don't think this is possible.

Any help anyone can provide would be greatly appreciated!
Thanks
John.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65888#65888]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-04-13 18:17:14 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: using NextHop value for default gateway dependency."

To view the discussion, visit: http://community.zenoss.org/message/65890#65890

--------------------------------------------------------------
I have not tried the next hop use case specifically, but I think you should be able to combine that with this info http://community.zenoss.org/blogs/zenossblog/2009/05/28/tip-of-the-month-event-suppression http://community.zenoss.org/blogs/zenossblog/2009/05/28/tip-of-the-month-event-suppression and get what you are looking for?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65890#65890]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
John DiSpirito
2012-04-16 13:24:40 UTC
Permalink
John DiSpirito [http://community.zenoss.org/people/jdispirito] created the discussion

"Re: using NextHop value for default gateway dependency."

To view the discussion, visit: http://community.zenoss.org/message/65909#65909

--------------------------------------------------------------
I've been doing a little experimenting and here's what I've got so far, but it doesn't work correctly:

gateway = device.os.routes._getOb("0.0.0.0_0").getNextHopIp()
gatewaydev = device.findDevice(gateway)
foo = gatewaydev.getPingStatus()
if device.comments != "":
evt.message = evt.message + ('\n Addtional Information:\n') + str(device.comments) + ("\n GW = ") + gateway + (" Status=") + foo

It's still a work in progress, and it's built upon a previous transform to insert comments into the event message.  I'm just adding to the event message to make sure I'm retrieving all the information correctly.  The first line gets the correct gateway IP.   What I want to do next is get the ping status of the gateway  IP.   (I've added it with it's IP address as its name in /Network/Routers/Cisco/)    But the second and third lines don't seem to be working. 

Is there some other way to ping the device?  I wanted to do it programatically, but if I can execute a ping command that would probably work too.

Also, would anyone be able to point me to documentation for device functions? (s.a. device.getPingStatus)
I couldn't seem to find this info in the admin or developer guides
thanks!
John.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65909#65909]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
nilie
2012-04-16 18:56:36 UTC
Permalink
nilie [http://community.zenoss.org/people/nilie] created the discussion

"Re: using NextHop value for default gateway dependency."

To view the discussion, visit: http://community.zenoss.org/message/65912#65912

--------------------------------------------------------------
How do you plan to deal with the scenario where some router along the path to your device is down ? You will not be able to obtain the device gateway, obviously because gateway = device.os.routes._getOb("0.0.0.0_0").getNextHopIp() will fail, so Zenoss will not know what to ping next.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65912#65912]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
John DiSpirito
2012-04-16 19:42:02 UTC
Permalink
John DiSpirito [http://community.zenoss.org/people/jdispirito] created the discussion

"Re: using NextHop value for default gateway dependency."

To view the discussion, visit: http://community.zenoss.org/message/65914#65914

--------------------------------------------------------------
That's a good point Nilie,

My goal here is twofold:

1) prevent an alert for every device sitting behind a potentially downed router/firewall.
2) avoid manually entering this information for every datacenter,location or type of device.

If a router along the way goes down, Zenoss still wouldn't be able to get to the devices GW router, and therefore shouldn't report on it.   If we're monitoring the downed router, we should still be alerted to it's outage though.

I thought this would be the best solution, but I'm open to any suggestions as long as the two points above can be met. 

I've read documentation that says that Zenoss is smart enough to tell if a router goes down, but in all of my testing, it doesn't seem like this is the case, especially if it detects that the server is down before it detects the downed router.

This is the latest version of what I have:

gateway = device.os.routes._getOb("0.0.0.0_0").getNextHopIp()
gwdev=device.findDevice(gateway)
if  gwdev.getPingStatus() > 0:
    evt._action = 'drop'
elif device.comments != "":
evt.message = evt.message + ('\n Addtional Information:\n') + str(device.comments) + "Ping Status= " + str(gwdev.getPingStatus()) + "\nGateway=" + gateway

However, not matter what I do, the getPingStatus of the gwdev is always 0.  I've even added known dead IP addresses as routers, and substituted that as gwdev=device.findDevice('deadip') but it still returns zero.
Odd right?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/65914#65914]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...