zabbix-threat-control icon indicating copy to clipboard operation
zabbix-threat-control copied to clipboard

problem with prepare.py

Open avasdre opened this issue 3 years ago • 6 comments

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

avasdre avatar Apr 13 '21 16:04 avasdre

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

JD-ISWT avatar Apr 27 '21 08:04 JD-ISWT

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)

ghost avatar Jul 26 '21 07:07 ghost

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)

takenp avatar Jul 29 '21 09:07 takenp

nope, always the same, i've try with the patch https://github.com/vulnersCom/zabbix-threat-control/pull/48/commits/6ff832af887b6022effea32b8bdca709c7d02e6f 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
```
`

ghost avatar Jul 30 '21 07:07 ghost

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)

markd-bit avatar Dec 19 '21 23:12 markd-bit

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)

jtoninger avatar Jan 12 '22 20:01 jtoninger