Ad Widget

Collapse

Zabbix Agent "simulator"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gryphius
    Member
    • Aug 2007
    • 30

    #1

    Zabbix Agent "simulator"

    I had this idea of writing a zabbix agent simulator I could use to test our triggers / alerting. Basically the agent would forward all requests to a real zabbix agent except the test subject which could be configured to return any series of values to simulate a crash/peak/whatever. Does something like that already exist?
    I could hack together a small script tailored to my needs, but I was wondering if others are interested, so maybe it would be worth the effort to make this thing even somewhat configurable and userfriendly .

    Anyway, here is my brainstorm so far , I'd appreciate some comments on the idea.

    Code:
    - General Features:
    * Interactive Mode (over telnet? or just local command line) -> we don't want to write a config file for every new test
    * Act as zabbix agent "proxy" (forward requests to a real agent except the testsubject) -> events look like as if they came from the real host
    
    - Per key config:
    * return ZBX_NOTSUPPORTED
    * forward to real agent
    * use a "ValueEngine" (a something that chooses a value range based upon configuration)
    
    - ValueEngines
    * permanent (fixed valuerange)
    * timed peak (fixed value range, choose another valuerange after x seconds/requests/at specified time), then go back
    
    - Valueranges
    * fixed value (text, int, float)
    * random value between x and y (int, float)
    * random value of array [...] (text, int, float)
    * iterate over array [...] ) (text,int, float)
  • Gerco
    Junior Member
    • Nov 2006
    • 22

    #2
    I would be interested in this, since I am frequently asked to demo Zabbix in combination with our product. Currently, I just use the product and run tests and simulations on it prior to the demo to provide some history (looks impressive when displaying graphs).

    Be sure to check out http://www.zabbix.com/wiki/doku.php?id=zabbixprotocol if you need information on the protocol and add to it if I got something wrong or incomplete.

    Comment

    • Markus
      Member
      • Jan 2006
      • 39

      #3
      The description of the 1.4 passive checks is correct. I have already implemented this in Python. I intend to extend this into a full Zabbix proxy. This proxy would be able to either relay requests to real Zabbix agents ('proxy mode') or reply to requests directly (this could be used as some kind of 'simulator mode' if one can manually set values it is returning).

      In fact a basic working model has been sitting on my computer for more than a week but with a full-time job, full-time baby daughter and full-time wife ;-) there is not much time left to work on this. Maybe this weekend...

      Markus

      PS: The info about the Zabbix protocol was excellent help and the brainstorming in the first post gave me lots of ideas. Thanks a lot guys. I keep you updated.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        The simulator seems to be an excellent idea which would help very much in automated and performance testing, demo systems. Stateless functions, like random values, fixed values, and similar ones can be implemented easily:

        test.random[min,max<,type>]:

        test.random[1,10000] - random integer (default)
        test.random[1,10000,"float"] - random float

        More complex functions would require additional logic on agent side as result in most cases depends on a previous calculated value.

        These functions along with a pre-defined host template for testing would be very useful indeed.

        I would love to see this implemented. Added to ZABBIX wishlist!
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • martin.marcher
          Junior Member
          • Nov 2007
          • 22

          #5
          For a quickshot I think that a zabbix_inject would be nice that would just inject value whenever the server the next time asks for it

          Code:
          zabbix_inject [from_host] <item> <value>
          Code:
          # injects for the host that it's being run on
          # (taken from /etc/zabbix/zabbix_agentd.conf) or
          # any host if run on the zabbix server directly
          zabbix_inject system.swap.size[,pfree] 83.24 
          zabbix_inject important.server system.uptime 45654345
          I think that would also provide a nice tool to convert from other monitoring services

          Comment

          • vulogov
            Junior Member
            Zabbix Certified Specialist
            • Mar 2010
            • 14

            #6
            It is done.

            Here is the slides



            Here is the source

            Zabbix Agent Simulator. Contribute to vulogov/zas_agent development by creating an account on GitHub.

            Comment

            Working...