Ad Widget

Collapse

Benefits of using active checks vs passive?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #1

    Benefits of using active checks vs passive?

    I have seen numerous mentions of using Zabbix agent (active) checks instead of passive checks. I have searched the forums but have not seen what the benefits of this are.

    As of now, all of my hosts are using passive checks. Can someone explain the benefits (and any drawbacks) of using active checks?

    Thanks.

    Jeff
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    Active checks will reduce the load on your Zabbix server, here's how.

    Passive check
    1) Query items table for items which are due to be checked (MySQL query)
    2) Connect with agent associated with item and retrieve data
    3) Repeat 2 until list empty
    4) Repeat 1 after a delay if needed

    Active Check

    1) Agent starts on host and queries server for items to be checked
    2) Check list for items due to be sent to server. (List is in memory)
    3) Repeat 2 until all items due to be sent have been sent to server
    4) Query server after a timeout to see if there have been any changes to list of items
    5) Repeat items 2-4 until termination

    Ok so that's the basics, passive is heavily server based, active is heavily host based. Let's look a little closer. The item numbers relate to the steps above.

    Passive
    1) Query items table in SQL database for list of items to be queried (
    2a) Connect to Agent
    2b) Send item key
    2c) Insert item into history table
    2d) Update field in items table to show when the item was and should be checked next
    3) repeat 2 until list is empty
    4) repeat 2-3 (I believe there is a wait determined by the length of time until the next check, but I'm not sure)

    Active
    1) Agent starts
    1a) Agent connects to server and requests items list
    1b) Server queries database and returns list with item check frequency
    2) Query list of items in memory to determine if any items need to be sent to server
    2a) Connect to server and sent key and value
    2b) Server inserts value into history table
    2c) Server updates last check field in items table (Not sure about next check field however)
    3) Repeat 2 until all items checked
    4) After a timeout period (defined in zabbix_agentd.conf) Query server for list of items
    4a) Agent connects to server and request list
    4b) Server returns list of active items and check frequency
    5) repeat 2-4 until termination

    As you can see active checks are slightly more complex in their design. Active checks overall reduce the load on the server by distributing the effort to check items to the hosts. I need to dive a little deeper into the code sometime to answer some of my own questions from the above, but hopefully you get an overall idea of what's going on.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • tchjts1
      Senior Member
      • May 2008
      • 1605

      #3
      Thank you very much, Mr. Nelson. Excellent sequence.

      Comment

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

        #4
        Use of active checks is strongly recommended for monitoring of large environments! This improves performance and also makes ZABBIX server immune to any sorts of network problems.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • w00tburger
          Junior Member
          • Mar 2018
          • 21

          #5
          Better description in my post below.
          Last edited by w00tburger; 04-04-2018, 04:56.

          Comment

          • w00tburger
            Junior Member
            • Mar 2018
            • 21

            #6
            I noticed while utilizing active checks that the overall metrics were not accurate. The performance graph below is when I was running a heavy install on the system. I noticed that just before the Zabbix agent checked in, the CPU usage would drop to roughly nothing, and then immediately spike back up to ~80 percent or so. During this timeframe, the agent had sent back that it was hardly under any load.

            I activated passive checking, and you can immediately see the graph grow reflecting its true results. Re-niceing and prioritizing the zabbix agent on my linux system (while running active mode) had no affect on obtaining accurate results. Below I have labeled when I was running active vs running passive below. Has anyone had any similar experiences to this?

            Zabbix agent marked topped system priority
            Click image for larger version  Name:	Screen Shot 2018-04-03 at 10.42.02 PM.png Views:	1 Size:	126.9 KB ID:	356448

            Overall results:
            Click image for larger version  Name:	Screen Shot 2018-04-03 at 10.50.30 PM.png Views:	1 Size:	125.8 KB ID:	356449
            Last edited by w00tburger; 04-04-2018, 04:56.

            Comment

            Working...