Ad Widget

Collapse

Send active JSON request using zabcon

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mlange
    Member
    • Sep 2008
    • 78

    #1

    Send active JSON request using zabcon

    Is it possible to send such a JSON request with zabcon:

    {
    "request":"active checks",
    "host":"host",
    "ip":"127.0.0.1",
    "port":10000
    }

    Can the "raw json {" call be used for that?

    The log output of the agent looks like this:

    1212:20101124:094421.254 Sending [{
    "request":"active checks",
    "host":"xyz"}]

    Thanks!
    Last edited by mlange; 24-11-2010, 10:46.
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    hmm. you mean requesting active checks from the server ?
    i don't think that would work with zabcon, but i would expect telnet or nc to work, tohugh
    Zabbix 3.0 Network Monitoring book

    Comment

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

      #3
      It's possible but you will need to look at things a little differently. An active check is a type of item so you will need to check items, so perhaps...

      get item show=all filter=[type=<active_type_num>]

      if that does not work:

      raw api item.get output=extend filter=[type=<active_type_num>]

      I don't remember what the number is for active. I had a comment in the API docs which deleniated what number was what, but it looks like it's been wiped out. :-(
      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

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        i think it depends on what was the goal - to get list of active items on a host over the api, or query zabbix server as the active agent does that. not sure which exactly was it
        Zabbix 3.0 Network Monitoring book

        Comment

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

          #5
          True, though he did just ask for how to get a list of active items... ;-)
          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

          • steev
            Member
            • Aug 2010
            • 38

            #6
            your example doesn't seem to work

            this should work, right?

            root@mcp zabcon-0.0.370 ./zabcon.rb
            x86_64-linux
            Attempting to load previous session key from ~/zabcon.session
            http://msputil.c42/zabbix/ connected
            API Version: 1.3
            Welcome to Zabcon. Build Number: 370
            Use the command 'help' to get help on commands
            +> raw api item.get output=extend filter=[type=0]
            Unexpected parameter "="
            +> raw api item.get output=extend filter={type=0}
            Unexpected parameter "="
            +> raw api item.get output=extend filter={[type=0]}
            Unexpected parameter "="
            +>

            Comment

            • richlv
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Oct 2005
              • 3112

              #7
              doesn't seem to work for me either. probably worth creating a new issue in the zabcon trac instance
              Zabbix 3.0 Network Monitoring book

              Comment

              Working...