Ad Widget

Collapse

Zabbix Topology Mapper - Entry Point

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TiggyWiggler
    Junior Member
    • Feb 2021
    • 16

    #1

    Zabbix Topology Mapper - Entry Point

    Hello Zabbix fans. I am looking to create a network topolgy mapper. I have a general approach concept where I will have variables that define the scope of items to be mapped and the layout style, I will read out the items that match these parameters, create the map in memory, then write it back out as a map object with elements and links. Finally this code will run periodically to check for changes and I can update the map and raise messages about the change as required. I am currently trying to work out the best way to interface with Zabbix from the code. I can either create a Loadable Module and work with the data set, but I cannot find any documentation on this and I am not sure if this is the best approach, or I can use the API and talk to the server that way. Given that I will write this in C, although the API feels like the most natural way I am not sure that creating a HTTP socket is the most effecient way. I am not sure that directly connecting to the database and working that way is correct as Zabbix can work with multiple DBs and already has the internal connectors for all of that.

    How would you read and write a topology map with Zabbix? Is the API the best method if the code you write is in C and is on the same machine as the server itself?
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    In general, prefer the API over direct database access. It's the "official" way to expose access to internals, and provides an appropriate level of abstraction. If you go directly against the database, you're potentially impacted by schema/DDL changes as the product is updated and new functionality is added.

    You certainly have your work cut out for you using C for this. I hope you have a good JSON library that you really like.

    If you get this working, I hope you'll share news about it on these forums. I could see a tool like this being really useful to a lot of people.

    Comment

    • TiggyWiggler
      Junior Member
      • Feb 2021
      • 16

      #3
      Thank you for this. I feel that the API is more attractive as the documentation for it is so strong. I have started by writing an ASP.Net application that connects to the API PHP site as I am more familier with that environment, so I can work to get the functionality working in there, giving me an environment that I can test the C code against. This way as I work in C (which I am less familier with) I can compare to what I have done in ASP.Net (i.e. if it works in the ASP.Net application then it is not the API that is wrong, it is my code). Of course I will share if this becomes anything that works well for the benefit of the community. FOSS relies on it

      Thank you for your comment, your direction gives me confidence that I am working towards the correct solution.

      Comment

      • TiggyWiggler
        Junior Member
        • Feb 2021
        • 16

        #4
        I have written an application that reads the hosts from Zabbix, computes the relationships between the nodes and then generates a map from that data and the result of that work is below. It is my intention to write this in C but it is currently in VB.Net as it is easier for me to write pseudo code in that language.

        My question is: would anyone be interested in having the VB.Net source (which of course has to be run in Windows)? If not, I will wait until I have rewritten this in C before I share it.

        Automatically Generated Map

        Comment

        Working...