0

I'm getting this problem:

pyzabbix.ZabbixAPIException: ('Error -32602: Invalid params., Incorrect arguments passed to function.', -32602)

Here is my code:

add_host = zapi.host.create(
                host = host_sharepoint,
                status = 0,
                interfaces = [{
                    "type": 2,
                    "main": 1,
                    "useip": 1,
                    "ip": str(row["IP"]),
                    "dns": "",
                    "port": "161"
                }],
                groups = [{
                    "groupid": "27"
                }],
                templates = [{
                    "templateid": template_id
                }]
            )

Every variable that I am using is a string. I decided to look up my error and I was thinking that this was what I needed, but apparently I'm still getting erros, just different ones. Maybe It's an interface thing, I'm not sure. Any ideas on how to solve this?

1 Answer 1

1

here is the explanation

here is an example

You need to change the code like this

add_host = zapi.host.create(
            host = host_sharepoint,
            status = 0,
            interfaces = [{
                "type": 2,
                "main": 1,
                "useip": 1,
                "ip": str(row["IP"]),
                "dns": "",
                "port": "161",
                "details": {
                    "version": 2,
                    "community": "public"
                }
            }],
            groups = [{
                "groupid": "27"
            }],
            templates = [{
                "templateid": template_id
            }]
        )
Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.