Ad Widget

Collapse

Site needs HTTP authentication. Error: <urlopen error timed out>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dennisho
    Junior Member
    • Oct 2014
    • 1

    #1

    Site needs HTTP authentication. Error: <urlopen error timed out>

    When run below python api script, a error "Site needs HTTP authentication. Error: <urlopen error timed out>" prompted. Anyone know the root cause? Thank you.


    .
    .
    .
    server="http://127.0.0.1/zabbix"
    username="admin"
    password="xxxxxxxx"

    zapi = ZabbixAPI(server=server, path="", log_level=0)
    zapi.login(username, password)
    .
    .
    .
    .
    trigger_expression1 = "{"+ZEN_HOST + ":" + ZEN_KEY + ".regexp(\[S1\])}>0 & {"+ZEN_HOST + ":" + ZEN_KEY + ".regexp(\[CLEARED\])}=0"

    try:
    create_trigger1 = zapi.trigger.create(
    {
    "description": "{ITEM.VALUE}",
    "type": 1,
    "value_flags": 1,
    "priority": 5,
    "flags" : 0,
    "expression": (trigger_expression1),
    "url" : "tr_comments.php?triggerid={TRIGGER.ID}"
    }
    )
    except Exception as e:
    print e
Working...