Skip navigation
1 2 Previous Next 7663 Views 15 Replies Latest reply: Jul 6, 2012 5:04 PM by Shane Scott RSS
dionizio Rank: White Belt 19 posts since
Apr 11, 2011
Currently Being Moderated

Jan 27, 2012 2:35 PM

Monitoring Links over internet

Hello,

 

In my company we monitor 50 links over the internet, some of then use dynamic IP Address, so its changes from time to time.

I use dydns for have url to ping, but zenoss after you create the object, it always pings the IP Address not the URL.

 

Every time Zenoss alerts the link is down, we have to access Zenoss -> Access the Device and click in Reset/Change Ip Address.

 

Someone know a way that zenoss execute this option before saying the link is down? or execute the option every time he Pings?

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    1. Jan 31, 2012 4:20 PM (in response to dionizio)
    Re: Monitoring Links over internet

    dionizio:

     

    A good solution for this is the following:

     

    Add all of the devices with this problem to a group called Dynamics

     

    In the /Status/Ping event class, create and event transform which acts on devices in the group Dynamics. This transform should take the manageIp and do a lookup. If the value doesn't match, the transform can then set the event to state 2, suppressed, and create a new event in /Change/Set as severity info.

     

    The event should have an identifiable name and message.

     

    Finally in the alerting rules create an event command. It's essentially an alerting rule that runs a command. Setup the rule to act on events in /Change/Set, whose parent device is in the group Dynamics and whose message 'contains' part of a qualifying message (e.g. 'dynamic ip changed'). The command for the event is run as the user zenoss and can use a combination of dmd and tales expressions to set the new ip pulled from the event.

     

    Essentially this does 4 things:

    1) supresses down events that are due to a lookup differnce

    2) It organizes and ensures the actions don't occur on non qualifying devices accidently

    3) makes an easy to follow history of ip changes

    4) updates the ip

     

    Best,

    --Shane (Hackman238)

  • ralmeida Newbie 3 posts since
    Jul 20, 2011
    Currently Being Moderated
    3. Jun 8, 2012 3:30 PM (in response to dionizio)
    Re: Monitoring Links over internet

    I'm also with the same difficulty.

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    4. Jun 8, 2012 10:42 PM (in response to ralmeida)
    Re: Monitoring Links over internet

    dionizio:

     

    Please post the transform you tried and I'll tweak it for you.

     

    Best,

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    6. Jun 11, 2012 10:44 AM (in response to dionizio)
    Re: Monitoring Links over internet

    dionizio:

     

    You're going to want to create a transform on the event class /Status/Ping which checks if the device is int he group 'Dynamic'. If it is in Dynamic, then import dmd.

     

    code Import dmd and other commonly needed parts {

    import Globals

    from Products.ZenUtils.ZenScriptBase import ZenScriptBase

    from transaction import commit

     

    dmd = ZenScriptBase(connect=True).dmd

    }

     

    Finally you can set d = dmd.Devices.findDevice(device.id) and d.setManageIp(yourIp)

     

    Good luck!

     

    Best,

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    9. Jun 11, 2012 2:07 PM (in response to dionizio)
    Re: Monitoring Links over internet

    dionizio:

     

    No I woudln't edit the zenping daemon. Use a transform on /Status/Ping. In a case where the ip changes on a dynamic device the transform will need to qualify if the device is in the Dynamic group. If it is, resolve the new ip address then set the new manage IP and drop the down event.

     

    --Shane

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    11. Jun 13, 2012 1:45 PM (in response to dionizio)
    Re: Monitoring Links over internet

    dionizio:

     

    Instead of an eventCommand I would use a trasform. On the Events page click Event Classes. Navigate to /Status/Ping and then click the lower left gear icon -> transform.

     

    transform code {

    if device:

        import Globals

        from Products.ZenUtils.ZenScriptBase import ZenScriptBase

        from transaction import commit

        dmd = ZenScriptBase(connect=True).dmd

        d = dmd.Devices.findDevice(str(device.id))

        newIp = socket.gethostbyname(device.id)

        if newIp != d.manageIp and evt.severity == 5:

            evt._action = 'drop'

            d.setManageIp(str(newIp))

            commit()

     

    }

     

    What the code does is act on all Ping down events. It gets d as the device object then looks up the devices current hostname via dns. If the lookup doesnt match the d.manageIp it changes the Ip and drops the down event.

     

    Best,

    --Shane (Hackman238)

  • ralmeida Newbie 3 posts since
    Jul 20, 2011
    Currently Being Moderated
    14. Jul 2, 2012 9:22 AM (in response to dionizio)
    Re: Monitoring Links over internet

    Shane Scott, good morning!


    Can you help us? I'm also with the same difficulty. I tried many commands but any works automatic.

    The comands works when i create a event manually.

1 2 Previous Next

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points