Ad Widget

Collapse

How to use "active" checks in zabbix_get comand?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leoh
    Member
    • Oct 2005
    • 47

    #1

    How to use "active" checks in zabbix_get comand?

    Sory for asking it here but the documentation is still not enought to help me.

    I want to monitor my log file. I know that log[logfile] is already implemented and that it must me an active check.

    I need to send a zabbix_get comand to retrieve log[file] information.

    How to activate the "active" flag in the zabbix_get comand to monitor my log file? Is this "active" flag only available throught web interface?
  • jpdborgna
    Junior Member
    • Jan 2013
    • 2

    #2
    where you able to do it?

    Regards,

    Comment

    • fpaternot
      Member
      Zabbix Certified Specialist
      • Feb 2013
      • 52

      #3
      Me too, for testing purposes..

      Comment

      • simonfredsted
        Junior Member
        • Mar 2016
        • 4

        #4
        Did anyone ever solve this?
        Last edited by simonfredsted; 03-03-2016, 09:49. Reason: spelling error

        Comment

        • simonfredsted
          Junior Member
          • Mar 2016
          • 4

          #5
          For example, when trying to get a log key:

          Code:
          # zabbix_get -s 127.0.0.1 -k 'log["/var/log/nginx/error.log","\[error\]"]'
          ZBX_NOTSUPPORTED: Accessible only as active check.

          Comment

          • Firm
            Senior Member
            • Dec 2009
            • 342

            #6
            Active checks are executed by zabbix_agentd itself.

            Comment

            • simonfredsted
              Junior Member
              • Mar 2016
              • 4

              #7
              Alright.

              When I do this:
              Code:
              zabbix_agentd -t 'log["/var/log/nginx/error.log","\[error\]"]'
              I get this:
              Code:
              log["/var/log/nginx/error.log","\[error\]"]   [m|ZBX_NOTSUPPORTED] [Accessible only as active check.]
              So is that because my agent is not set up properly for active checks?

              Comment

              • Firm
                Senior Member
                • Dec 2009
                • 342

                #8
                Active checks list is downloaded and from server by agent automatically. Running zabbix_agentd -t <key> simulates "Zabbix agent" item behavior not "Zabbix agent (active)".

                Comment

                • simonfredsted
                  Junior Member
                  • Mar 2016
                  • 4

                  #9
                  I guess I've been asking the wrong question

                  How do I test active checks from the command line?

                  Comment

                  • glebs.ivanovskis
                    Senior Member
                    • Jul 2015
                    • 237

                    #10
                    Originally posted by simonfredsted
                    How do I test active checks from the command line?
                    It is not possible with built-in capabilities of Zabbix.

                    If you really need to test active checks without Zabbix server and frontend participation you can start zabbix_agent with ServerActive=... setting and then emulate server somehow using this protocol.

                    Comment

                    Working...