Archived community.zenoss.org | full text search
Skip navigation
1 2 3 ... 8 Previous Next 449971 Views 107 Replies Latest reply: Oct 23, 2012 10:56 PM by Gowrish SS RSS
rians Rank: White Belt 52 posts since
Jun 23, 2009
Currently Being Moderated

Nov 16, 2009 1:23 PM

Help with Custom Map Zenpack

I have been working on a zenpack that will allow a user to create arbitrary custom maps somewhat in the style of zabbix. Some of the features I have been aiming for:
  • Maps can have arbitrary images as backgrounds.
  • Maps can contain devices or submaps
  • ZenPack contains drag and drop editor
  • Nodes images can be set to user icons, and their labels can be positioned on any side of the icon, or ommitted entirely
  • Portlet allows you to navigate through the maps, and updates itself
  • A map's status is dependant on the status of any nodes or submaps on it.
  • Edges can be plain lines, or arrows showing the amount of bandwidth on the interface they represent

 

The actual implementation of the portlet and the map editor is fairly solid right now. We are currently monitoring about 1800 devices, most of which have placed into these hand-drawn maps. The individual maps load very quickly, and the portlet updates the map image seamlessly every 30 seconds.

 

I am not very familiar with zope, and the more I try to learn, the less it makes sense to me. There are a number of issues I am trying to solve that I would love some help with:

  • The map editor is implemented as a tab in the Locations section. Each Location has a custom_map property that contains all the information needed to draw a map. I seem unable to make the tab show up consistently though. When I set a recursive function to add it to all the Location objects, it works on some and not the others.
  • I would like to find a way to make the tab show up for new Locations as well. I have tried monkey patching the base Location as well as the class it derives from, but neither seems to work.
  • The map drawing code relies on PIL. There is a namespace conflict between one of the PIL modules (ImageFile) and zenoss. I had to modify PIL slightly to avoid the conflict. Is there some way I can include this with the zenpack? Or is there some other api I should be using to draw the images.
  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    1. Nov 16, 2009 3:38 PM (in response to rians)
    Re: Help with Custom Map Zenpack

    rians:

     

    The work sounds interesting. Is it possible for you to post the source?

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    3. Nov 23, 2009 3:04 PM (in response to rians)
    Re: Help with Custom Map Zenpack

    Rians:

     

    I'm making progrress, but would it be possible to post the source of .CustomMap.py.swo? There is some static pathing fopr /usr/local/zenoss... that will break the pack.

     

    Thanks!

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    4. Nov 23, 2009 3:09 PM (in response to Shane Scott)
    Re: Help with Custom Map Zenpack

    Rians:

     

    Acctually, what is the file?

  • Matt Ray Rank: Zen Master 2,484 posts since
    Apr 5, 2008
    Currently Being Moderated
    6. Dec 4, 2009 3:29 PM (in response to rians)
    Re: Help with Custom Map Zenpack

    Feel free to email me when you're getting closer to having a ZenPack ready to post, or if you need some assistance.  I may be able to help you if you run into any blockers.

     

    Thanks,

    Matt Ray

    Zenoss Community Manager

  • mf2ng Newbie 4 posts since
    Oct 22, 2009
    Currently Being Moderated
    7. Dec 9, 2009 3:31 AM (in response to rians)
    Re: Help with Custom Map Zenpack

    Hi,

     

    I would be interested to help as an tester if You like.

  • mf2ng Newbie 4 posts since
    Oct 22, 2009
    Currently Being Moderated
    9. Dec 10, 2009 3:37 AM (in response to rians)
    Re: Help with Custom Map Zenpack

    Hi Rians and thanks for reply,

     

    I managed to install your code attached to thread yesterday after minor annoyances, but that _registerCustomMapTab() -function truly gave (and gives) me some headache

    On the whole code seems to work, but still I would like to ask some features and clarifications:

     

    - I was not able to figure any other way inserting an background image than creating/uploading an image (for example an floorplan) type of object directly to ZODB via Zope manage. Is there any better way to do this?

     

    - Would it be possible that custom maps could (optionally?) be seen as portlet at the locations status tab?

     

    - Automatically scaling background image (which is linked to full size map-page or submap) wouldn't hurt in that statuspage portlet.

     

    - Should "add link" button do something else than lightly change the backgroundcolor of the browser?

     

    - Adding objects confuses me, I have built my location hierarchy by the scheme "Locations/City/Factory/Server or network rack" and when I added Factory A floorplan map to level "Factory" I thought that it would be possible to add the server rooms / network racks as an sublocations/submaps, but it seems that it is not working that way because I can't see any other available nodes than "factory" level?

     

    - Could the previous problem be caused by error below what I get when I try to run dmd.Locations.custom_map = CustomMap.CustomMapObject(dmd.Locations.City.Factory.network.rack) at zendmd:

     

         >>> dmd.Locations.custom_map = CustomMap.CustomMapObject(dmd.Locations.City.Factory.81.6)
      File "<console>", line 1
        dmd.Locations.custom_map = CustomMap.CustomMapObject(dmd.Locations.City.Factory.81.6)

     

    (the name of the "outer" location is "81.6")

     

    - And referring to previous, is your code able to handle the location names that have an dot? I have lots of those because of networking racks and it seems that it's causing problems, which you probably noticed all ready... Just noticed this and dunno yet that if some escape char or equivalent input do the trick.

     

    Sorry my stupid questions, but my knowledge in www and python is marginal at most, but hey... Most of the other users are as stupid as I

  • mf2ng Newbie 4 posts since
    Oct 22, 2009
    Currently Being Moderated
    10. Dec 10, 2009 3:58 AM (in response to rians)
    Re: Help with Custom Map Zenpack

    Next thing that I noticed was that when I add map image to level /Locations/City1/FactoryA and then /Locations/City1/FactoryB, both of the factories shows same image, FactoryB.

     

    Any Idea why? Is this intented functionality?

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    13. Dec 10, 2009 2:45 PM (in response to mf2ng)
    Re: Help with Custom Map Zenpack

    mf2ng:

     

    Examples:

     

    For /Locations:

     

    from ZenPacks.USU.Map import CustomMap
    dmd.Locations.custom_map = CustomMap.CustomMapObject(dmd.Locations)
    dmd.Locations.custom_map._registerCustomMapTab()
    commit()

     

    For /Locations/SA40:

     

    from ZenPacks.USU.Map import CustomMap
    dmd.Locations.SA40.custom_map = CustomMap.CustomMapObject(dmd.Locations.SA40)
    dmd.Locations.SA40.custom_map._registerCustomMapTab()
    commit()

     

    For /Locations/SA40/Floor6:

     

    from ZenPacks.USU.Map import CustomMap
    dmd.Locations.SA40.Floor6.custom_map = CustomMap.CustomMapObject(dmd.Locations.SA40.Floor6)
    dmd.Locations.SA40.Floor6.custom_map._registerCustomMapTab()
    commit()

     

    Also, I have a working installable Egg if anyone wants it. I'm making some updates to the engine, IE doesnt like it at all. Wonderful in FF.

1 2 3 ... 8 Previous Next

More Like This

  • Retrieving data ...

Legend

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