Skip navigation
1 2 Previous Next 28229 Views 25 Replies Latest reply: Jun 7, 2012 3:26 AM by Giovanni Maffia RSS Go to original post
  • Matt Ray Rank: Zen Master 2,484 posts since
    Apr 5, 2008
    Currently Being Moderated
    15. Jan 5, 2009 3:59 PM (in response to jcurry)
    RE: Interested in an "event transform" section?
    If you're logged into the website, there should be an "edit" button near the top. We've had some issues with zwiki recently, if it's not showing it and you're logged in let me know and we'll debug it off-list.

    Thanks,
    Matt Ray
    Zenoss Community Manager
  • artifact Rank: Green Belt 303 posts since
    Mar 11, 2008
    Currently Being Moderated
    16. Jan 5, 2009 4:00 PM (in response to Matt Ray)
    RE: Interested in an "event transform" section?

    "jcurry" wrote:

     

    The wiki page looks useful but a couple of lines of instruction would be helpful on how to add to the page. I can see how to add a comment but not sure how to modify the page to add to the bottom (rather than just a comment)??

    Cheers,
    Jane



    After logging into the wiki, there should be an "edit" link in the upper-left hand corner...
  • jcurry ZenossMaster 1,021 posts since
    Apr 15, 2008
    Currently Being Moderated
    17. Jan 6, 2009 4:09 AM (in response to artifact)
    RE: Interested in an "event transform" section?
    Yup - there is an Edit tab after I log in but it doesn't seem to do anything. There is an "Actions" button with cut, copy, paste, delete, rename and an "Add to folder" tab with lots of actions - all apparently active. The only tab that doesn't seem to be active is "Edit".

    Could someone post a quick "Updating the wiki" item to the wiki!
    Cheers,
    Jane
  • jbaird Rank: Green Belt 166 posts since
    Sep 18, 2007
    Currently Being Moderated
    18. Jan 7, 2009 10:12 AM (in response to jcurry)
    RE: Interested in an "event transform" section?
    Wondering if someone could help me out with a simple transform. I use this transform for my BigIP LTM devices:

    evt.component = "Node: %s:%s" % (evt.bigipNotifyObjNode, evt.bigipNotifyObjPort)


    This adds the IP/Port of the service that is down to the event. I would like to display the hostname (bigipNotifyObjNode contains only the IP address). I tried to modify the transform to:
    
    evt.component = "Node: %s:%s" % (gethostbyaddr(evt.bigipNotifyObjNode), evt.bigipNotifyObjPort)


    It doesn't appear as red text, so it appears to be valid code. But, whenever the event comes in, the "Component" field is empty. Any ideas?

    Thanks!
  • artifact Rank: Green Belt 303 posts since
    Mar 11, 2008
    Currently Being Moderated
    19. Jan 7, 2009 12:53 PM (in response to jbaird)
    RE: Interested in an "event transform" section?
    When I'm troubleshooting transforms, I usually just throw them into a simple script and set things manually and see what happens:

    #!/usr/bin/python
    from socket import *
    
    bigipNotifyObjNode = "74.125.45.100"
    bigipNotifyObjPort = "2"
    component = "Node: %s:%s" % (gethostbyaddr(bigipNotifyObjNode), bigipNotifyObjPort)
    
    print component


    Looks okay... but it seems like a lot of info to me? I would use that info in evt.summary and simply do
    evt.component = evt.bigipNotifyObjPort
    for the component...
  • Matt Ray Rank: Zen Master 2,484 posts since
    Apr 5, 2008
    Currently Being Moderated
    20. Jan 8, 2009 4:38 PM (in response to artifact)
    Interested in an "event transform" section?
    We have this page: http://www.zenoss.com/community/get-involved/how-to-contribute-web-content

    Editing the wiki has been a pain for awhile, we're looking at
    replacing it with something much easier to use soon (and keeping all
    the existing content of course).

    Thanks,
    Matt Ray
    Zenoss Community Manager
    community.zenoss.com
    mray@zenoss.com



    On Jan 6, 2009, at 3:09 AM, jcurry wrote:

     

     

    Yup - there is an Edit tab after I log in but it doesn't seem to do
    anything. There is an "Actions" button with cut, copy, paste,
    delete, rename and an "Add to folder" tab with lots of actions - all
    apparently active. The only tab that doesn't seem to be active is
    "Edit".

    Could someone post a quick "Updating the wiki" item to the wiki!
    Cheers,
    Jane







    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users


    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    21. Jan 9, 2009 8:07 AM (in response to Matt Ray)
    Interested in an "event transform" section?
    What sort of Wiki is it? I've had good luck here with TWiki and it seems
    pretty easy to use and attach pics etc... I don't think Wiki is the
    "problem", but your implementation is different to what I've seen with
    both TWiki and Confulence(sp?).
    --
    James Pulver
    Information Technology Area Supervisor
    LEPP Computer Group
    Cornell University



    Matt Ray wrote, On 1/8/2009 4:38 PM:

     

     

    We have this page: http://www.zenoss.com/community/get-involved/how-to-contribute-web-content

    Editing the wiki has been a pain for awhile, we're looking at
    replacing it with something much easier to use soon (and keeping all
    the existing content of course).

    Thanks,
    Matt Ray
    Zenoss Community Manager
    community.zenoss.com
    mray@zenoss.com



    On Jan 6, 2009, at 3:09 AM, jcurry wrote:

     

     

    Yup - there is an Edit tab after I log in but it doesn't seem to do
    anything. There is an "Actions" button with cut, copy, paste,
    delete, rename and an "Add to folder" tab with lots of actions - all
    apparently active. The only tab that doesn't seem to be active is
    "Edit".

    Could someone post a quick "Updating the wiki" item to the wiki!
    Cheers,
    Jane







    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users


    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users


    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • Matt Ray Rank: Zen Master 2,484 posts since
    Apr 5, 2008
    Currently Being Moderated
    22. Jan 9, 2009 11:08 PM (in response to jmp242)
    RE: Interested in an "event transform" section?
    The wiki is zwiki, but it is not the easiest to use, notifications seem to be broken and there are reports of page edits disappearing. We are investigating a long-term replacement, but any updates made will be moved to whatever we replace it with.

    Thanks,
    Matt
  • tcaiazza Rank: White Belt 90 posts since
    Mar 19, 2009
    Currently Being Moderated
    23. Jun 16, 2009 4:12 PM (in response to Matt Ray)
    RE: Interested in an "event transform" section?
    Since I can't seem to find the wiki page to add these event transforms I've been working on for OSPF traps, I'll just post them here

    The first one is for ospf interface traps
    
    from socket import gethostbyaddr 
    evt.eventKey = evt.device + "ospfIfStateChange"
    
    if evt.ospfIfState == 1:
     ospfIfState = "down"
     evt.severity = 5
    elif evt.ospfIfState == 2:
     ospfIfState = "loopback"
    elif evt.ospfIfState == 3:
     ospfIfState = "waiting"
    elif evt.ospfIfState == 4:
     ospfIfState = "point To Point"
     evt.severity = 0
    elif evt.ospfIfState == 5:
     ospfIfState = "designated Router"
     evt.severity = 0
    elif evt.ospfIfState == 6:
     ospfIfState = "backup Designated Router"
     evt.severity = 0
    elif evt.ospfIfState == 7:
     ospfIfState = "other Designated Router"
     evt.severity = 0
    else:
     ospfIfState = "Unknown"
    
    try:
     intIP = evt.ospfIfIpAddress
     intName = gethostbyaddr(intIP)[0]
    except Exception, ex:
     intName =  evt.ospfIfIpAddress
    
    
    evt.summary = "OSPF interface, " + intName + ", state changed to " + ospfIfState


    And the second is for OSPF state change traps
    
    from socket import gethostbyaddr 
    evt.eventKey = evt.device + "ospfNbrStateChange"
    
    if evt.ospfNbrState == 1:
     ospfState = "Down"
     evt.severity = 5
    elif evt.ospfNbrState == 2:
     ospfState = "Attempt"
    elif evt.ospfNbrState == 3:
     ospfState = "init"
    elif evt.ospfNbrState == 4:
     ospfState = "two way"
    elif evt.ospfNbrState == 5:
     ospfState = "Exchange Start"
    elif evt.ospfNbrState == 6:
     ospfState = "Exchange"
    elif evt.ospfNbrState == 7:
     ospfState = "Loading"
    elif evt.ospfNbrState == 8:
     ospfState = "Full"
     evt.severity = 0
    else:
     ospfState = "Unknown"
    try:
     peerIp = evt.ospfNbrIpAddr
     peerName = gethostbyaddr(peerIp)[0]
    except Exception, ex:
     peerName =  evt.ospfNbrIpAddr
    
    evt.summary = "OSPF State Changed to " + ospfState + " with peer " + peerName
    


    I added in the event key, so the two wouldn't clear each other.
  • kocalin Newbie 1 posts since
    Aug 3, 2011

    Hi, I have problem with this transformation.

    Sartuche24 wrote:

     

    Here's what I have for High Utilization for an Interface. Fixed the transform to print Mbps instead of Kbps.

    # Use in Perf/Interface
    #Transform interface usage into readable format
    import re
    
    fs_id = device.prepId(evt.component)
    for f in device.os.interfaces():
        if f.id != fs_id: continue
    
        # Extract the percent and utilization from the summary
        m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.message)
        if not m: continue
        currentusage = (float(m.group(1))) * 8
        p = (currentusage / f.speed) * 100
        evtKey = evt.eventKey
        
        # Whether Input or Output Traffic
        if evtKey == "ifInOctets_ifInOctets|high utilization":
            evtNewKey = "Input"
        elif evtKey == "ifOutOctets_ifOutOctets|high utilization":
            evtNewKey = "Output"
    
    
        # Check the speed to determine the appropriate conversion
        # Gbps utilization
        if currentusage > 1000000000:
            Usage = currentusage / 1000000000
            evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Gbps) or %3.2f%% is being used." %  (Usage, p)
    
        # Mbps utilization
        elif currentusage > 1000000:
            Usage = currentusage / 1000000
            evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Mbps) or %3.2f%%  is being used." %  (Usage, p)
    
        # Kbps utilization
        elif currentusage > 1000:
            Usage = currentusage / 1000
            evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Kbps) or %3.2f%%  is being used." %  (Usage, p)
    
        # bps  utilization
        elif currentusage < 1000:
            Usage = currentusage
            evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f bps) or %3.2f%%  is being used." %  (Usage, p)
        break


    This transforms the summary from:
    threshold of high utilization exceeded: current value 13763.32
    To This:
    High Input Utilization: Currently (246.84 Kbps) or 192.84% is being used.

     

    After it processed I get error message (under Event Detail):

     

    exceptionNameError: name 'evtNewKey' is not defined
    transform  0 import re 1 2 fs_id = device.prepId(evt.component) 3 for f in device.os.interfaces(): 4    if f.id != fs_id: continue 5 6    # Extract the percent and utilization from the summary 7    m = re.search("threshold of [^:]+: current value (

     

    I copied this transform under Perf/Interface

    I have Zenoss 3.2 on Ubuntu 10.10

     

    Can anyone help? Thanks

  • Giovanni Maffia Newbie 1 posts since
    Jun 7, 2012

    Hy everybody, I'm a new member and I'm a new Zenoss user. In recent days I'm trying to interact with the event trasform but I'm having many problems. The purpose that I have to reach is quite difficult, because I need to send a mail when I get some trap with this features: the second trap should arrive within 5 minutes after the first. I thought to use the event trasform so when I receive a event i check the count and I want check the first time and the last time, If all conditions are true i want customize an event field so i can add a filter for send a email. The first problem I encountered is that the code example that I find in the section "Event Transform & Example" relating the change severity for count >3  don't work for me. I can set the event field only the first time, before the first insert in the DB. When I receive another trap i try to set event field(severity too, as in the example), but without success, the fields value remains unchanged.

    Can anyone help me?

    Thank you in advance,

    regards,

    Giovanni

1 2 Previous Next

More Like This

  • Retrieving data ...