This tip has been adapted from Wouter ‘netdata’ D’Haeseleer’s post on Zenoss-Users.
Download this file and put it in $ZENHOME/bin
tracepath.py
or if your Zenoss server has direct access to the internet you could do this:
wget tracepath.py -O $ZENHOME/bin/tracepath.py
or
curl -O tracepath.py -o $ZENHOME/bin/tracepath.py
Set the permissions:
chmod +x tracepath.py
You can now run it against any device you want to see if Zenoss is able to build layer 3 dependencies for.
tracepath.py swiss11
Getting path from zenoss0101 to swiss11...
zenoss -> VGB-DC01-SW01 -> VG_Turnhout -> pbru223.controlnet.equant.net -> pkt47.controlnet.equant.net -> CHEL-ZO01-SW01 -> swiss11
This reveals the path from the Zenoss server to the device passed in.
When Zenoss is unable to trace the path it will throw an error:
tracepath.py pkt1401
Getting path from zenoss0101 to pkt1401...
Traceback (most recent call last):
File "/opt/zenoss/bin/tracepath.py", line 30, in ?
path = source.os.traceRoute(destination, [])
File "/opt/zenoss/Products/ZenModel/OperatingSystem.py", line 121, in traceRoute
return nextdev.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/Device.py", line 507, in traceRoute
return self.os.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/OperatingSystem.py", line 121, in traceRoute
return nextdev.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/Device.py", line 507, in traceRoute
return self.os.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/OperatingSystem.py", line 121, in traceRoute
return nextdev.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/Device.py", line 507, in traceRoute
return self.os.traceRoute(target, ippath)
File "/opt/zenoss/Products/ZenModel/OperatingSystem.py", line 122, in traceRoute
raise TraceRouteGap("unable to trace to %s, gap at %s" % (target.id,
Products.ZenModel.Exceptions.TraceRouteGap: unable to trace to pkt1401, gap at pbr213.controlnet.equant.net
Zenoss throws an error that there is a gap at pbr213.controlnet.equant.net. This means the Zenoss server is unable to see the routes that will lead to pkt1401.
When you use this script without a correct device it will lead to this:
tracepath.py foobar
Getting path from zenoss0101 to foobar...
Invalid destination.
This is very cool, keep pointing out little things like this