Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with prepare.py #50

Open
avasdre opened this issue Apr 13, 2021 · 6 comments
Open

problem with prepare.py #50

avasdre opened this issue Apr 13, 2021 · 6 comments

Comments

@avasdre
Copy link

avasdre commented Apr 13, 2021

Hello, please help
I have tried on zabbix 5.2 and on zabbix 4.0.
when i do /opt/monitoring/zabbix-threat-control/prepare.py -uvtda i always have the same mistake

Can't create host vulners.hosts. Exception: ('Error -32602: Invalid params., Invalid parameter "/1": unexpected parameter "hostid".', -32602)

Thanks

@JD-ISWT
Copy link

JD-ISWT commented Apr 27, 2021

Have a look on #48 , works well with this patch

@ghost
Copy link

ghost commented Jul 26, 2021

similar problem with zabbix 5.4:

Checking the connection to the zabbix-server via zabbix_sender...
Сompleted successfully. For connecting with zabbix-server used address "localhost"

Host group "Vulners" already exists (id: 20). Use this group.
Can't create host vulners.hosts. Exception: ('Error -32601: Method not found., Incorrect API "application".', -32601)

@takenp
Copy link

takenp commented Jul 29, 2021

If I go further giving the optional keys separately I get another issues:

Connected to Zabbix API v.5.4.0

Traceback (most recent call last):
  File "/opt/monitoring/zabbix-threat-control/prepare.py", line 387, in <module>
    {'type': '3', 'name': 'hostids', 'value': bulls_id}]},
NameError: name 'bulls_id' is not defined

BTW: if you run prepare.py with separate key (- v, -t, -d) It creates vhosts group, host, and even template but breaks on creating the Dashboard and then on creating an action. (-a)

@ghost
Copy link

ghost commented Jul 30, 2021

nope, always the same, i've try with the patch 6ff832a
but don't resolve the problem

**root@server**~# /opt/monitoring/zabbix-threat-control/prepare.py -uvtda
Connected to Zabbix API v.5.4.3

Checking the connection to the zabbix-agent...
Сompleted successfully. For connecting with zabbix-agent used address "127.0.0.1"

Checking the connection to the zabbix-server via zabbix_sender...
Сompleted successfully. For connecting with zabbix-server used address "localhost"

Host group "Vulners" already exists (id: 20). Use this group.

Host "Vulners - Hosts" (id: 10365) was renamed to "Vulners - Hosts.bkp-2021-07-30_09-21-50" and deactivated.
Can't create host vulners.hosts. Exception: ('Error -32601: Method not found., Incorrect API "application".', -32601)

**root@server**:~# /opt/monitoring/zabbix-threat-control/prepare.py -u
Connected to Zabbix API v.5.4.3

Checking the connection to the zabbix-agent...
Сompleted successfully. For connecting with zabbix-agent used address "127.0.0.1"

Checking the connection to the zabbix-server via zabbix_sender...
Сompleted successfully. For connecting with zabbix-server used address "localhost"

**root@server~**# /opt/monitoring/zabbix-threat-control/prepare.py -v
Connected to Zabbix API v.5.4.3

Host group "Vulners" already exists (id: 20). Use this group.

Host "Vulners - Hosts" (id: 10366) was renamed to "Vulners - Hosts.bkp-2021-07-30_09-22-04" and deactivated.
Can't create host vulners.hosts. Exception: ('Error -32601: Method not found., Incorrect API "application".', -32601)

root@server:~# /opt/monitoring/zabbix-threat-control/prepare.py -t
Connected to Zabbix API v.5.4.3

Can't create template "Template Vulners OS-Report". Exception: ('Error -32601: Method not found., Incorrect API "application".', -32601)
root@Mr-Wolf:~# /opt/monitoring/zabbix-threat-control/prepare.py -a
Connected to Zabbix API v.5.4.3

Traceback (most recent call last):
  File "/opt/monitoring/zabbix-threat-control/prepare.py", line 365, in <module>
    {'conditiontype': 1, 'operator': 0, 'value': pkgs_id, 'value2': '',
NameError: name 'pkgs_id' is not defined

**root@server**:~# /opt/monitoring/zabbix-threat-control/prepare.py -d
Connected to Zabbix API v.5.4.3

Traceback (most recent call last):
  File "/opt/monitoring/zabbix-threat-control/prepare.py", line 387, in <module>
    {'type': '3', 'name': 'hostids', 'value': bulls_id}]},
NameError: name 'bulls_id' is not defined
```
`

@markd-bit
Copy link

I too have this same issue, running zabbix 5.4.8

[azureadmin@localhost ~]$ sudo /opt/monitoring/zabbix-threat-control/prepare.py -uvtda
Connected to Zabbix API v.5.4.8

Checking the connection to the zabbix-agent...
?ompleted successfully. For connecting with zabbix-agent used address "127.0.0.1"

Checking the connection to the zabbix-server via zabbix_sender...
?ompleted successfully. For connecting with zabbix-server used address "localhost"

Host group "Vulners" already exists (id: 46). Use this group.

Can't create host vulners.hosts. Exception: ('Error -32602: Invalid params., Invalid parameter "/1/macros/1/value": a character string is expected.', -32602)

@jtoninger
Copy link

I'm having this same issue.

Can't create host vulners.hosts. Exception: ('Error -32602: Invalid params., Invalid parameter "/1/macros/1/value": a character string is expected.', -32602)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants