Ad Widget

Collapse

httptest.get() does not list all steps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tvtue
    Member
    • Sep 2012
    • 71

    #1

    httptest.get() does not list all steps

    Dear Zabbix API users, I am trying to work with the API and list all httptests together with their steps. I am using the community provided python library from https://github.com/lukecyca/pyzabbix by installing it via the package manaher dnf install python-pyzabbix. The full name/version is python-pyzabbix-0.7.3-8.fc26.noarch.

    The zabbix server is version 3.0.15. Authentication works and I get a list of the httptests with their attributes httptestid, name, applicationid etc. I pretty much used the parameters from the offical documentation of the api. https://www.zabbix.com/documentation...e/httptest/get

    This is my for loop that prints the stuff:

    Code:
    for httptest in zapi.httptest.get({ "selectSteps": "extend", "output": "extend" }):
       pp.pprint(httptest)
       print
    The response in the official documtation contains also the steps with their urls. I have not managed to get them yet. Also tried a ruby gem for doing the same but the result keeps also the same.

    Do you have any pointer for me where I am going wrong?

    Cheers,
    Timo
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Could you post the whole JSON you get back from Zabbix?

    Also, I'm not a Python dev but according to the pyzabbix docs parameters should be passed this way:
    for httptest in zapi.httptest.get(selectSteps="extend", output="extend"):
    Last edited by dimir; 13-04-2018, 15:59.

    Comment

    • tvtue
      Member
      • Sep 2012
      • 71

      #3
      Dear dimir,

      thank you for your reply. Here is my output.

      Code:
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7954',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'11253',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'10',
         u'name': u'Availability TYPO3 Developmentsystem 1 Frontend',
         u'nextcheck': u'0',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7954',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'11253',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'12',
         u'name': u'Availability TYPO3 Developmentsystem 2 Frontend',
         u'nextcheck': u'0',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7954',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'11253',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'14',
         u'name': u'Availability TYPO3 Developmentsystem 3 Frontend',
         u'nextcheck': u'0',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7954',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'11253',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'2',
         u'name': u'Availability TYPO3 Livesystem Frontend',
         u'nextcheck': u'0',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7954',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'11253',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'8',
         u'name': u'Availability TYPO3 Testsystem Frontend',
         u'nextcheck': u'0',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7955',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'10800',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'13',
         u'name': u'Availability TYPO3 Developmentsystem 2 Frontend',
         u'nextcheck': u'1523628796',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'12',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7955',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'10800',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'11',
         u'name': u'Availability TYPO3 Developmentsystem 1 Frontend',
         u'nextcheck': u'1523628796',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'10',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7955',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'10800',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'9',
         u'name': u'Availability TYPO3 Testsystem Frontend',
         u'nextcheck': u'1523628816',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'8',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7955',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'10800',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'15',
         u'name': u'Availability TYPO3 Developmentsystem 3 Frontend',
         u'nextcheck': u'1523628606',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'14',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Googlebot/2.1 (+http://www.google.com/bot.html)',
         u'applicationid': u'7955',
         u'authentication': u'0',
         u'delay': u'300',
         u'headers': u'',
         u'hostid': u'10800',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'3',
         u'name': u'Availability TYPO3 Livesystem Frontend',
         u'nextcheck': u'1523628678',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'2',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      {  u'agent': u'Zabbix',
         u'applicationid': u'12580',
         u'authentication': u'0',
         u'delay': u'180',
         u'headers': u'',
         u'hostid': u'12117',
         u'http_password': u'',
         u'http_proxy': u'',
         u'http_user': u'',
         u'httptestid': u'21',
         u'name': u'bwServices available',
         u'nextcheck': u'1523628582',
         u'retries': u'1',
         u'ssl_cert_file': u'',
         u'ssl_key_file': u'',
         u'ssl_key_password': u'',
         u'status': u'0',
         u'templateid': u'0',
         u'variables': u'',
         u'verify_host': u'0',
         u'verify_peer': u'0'}
      Looking forward to your reply.
      Timo

      Comment

      • tvtue
        Member
        • Sep 2012
        • 71

        #4
        Originally posted by dimir
        Could you post the whole JSON you get back from Zabbix?

        Also, I'm not a Python dev but according to the pyzabbix docs parameters should be passed this way:
        for httptest in zapi.httptest.get(selectSteps="extend", output="extend"):
        This was the right pointer. It is working now with the correct parameter handover specification.

        Thank you very much!

        Cheers
        Timo

        Comment

        Working...