Git Product home page Git Product logo

Comments (13)

samosvat avatar samosvat commented on August 26, 2024

You need to specify in ztc.conf username and password of the user with "Zabbix Super Admin" user type.
What credentials do you have specified in ztc.conf now?

image

from zabbix-threat-control.

bettafishopb avatar bettafishopb commented on August 26, 2024

Hi
currently, in the ztc.conf, i've specified the "ZabbixApiUser = Admin", which is the Zabbix Super Admin by default.

As for the other credentials, "ZabbixFrontUrl", "ZabbixServerFQDN" and "ZabbixServerPort", i did not specify any since they are optional.

image

Thanks!

from zabbix-threat-control.

samosvat avatar samosvat commented on August 26, 2024

If you do not specify a ZabbixFrontUrl - ztc uses fallback URL: http://localhost/zabbix.
Try specifying the URL.

from zabbix-threat-control.

bettafishopb avatar bettafishopb commented on August 26, 2024

Hi
I specified the ZabbixFrontUrl but I'm still getting the same error.

from zabbix-threat-control.

samosvat avatar samosvat commented on August 26, 2024

here is the code where the problem occurs

try:
    zapi = ZabbixAPI(zbx_url, timeout=5)
    zapi.session.verify = zbx_verify_ssl
    zapi.login(zbx_user, zbx_pass)
    zapi_ver = zapi.api_version()
    print('Connected to Zabbix API v.{}\n'.format(zapi.api_version()))
    zapi_ver_float = float(zapi_ver.split('.')[0] + '.' + zapi_ver.split('.')[1])
    if zapi_ver_float < required_zapi_ver:
        print('Required Zabbix version {} or higher\nExit.'.format(required_zapi_ver))
        exit(0)
except Exception as e:
    print('Error: Can\'t connect to Zabbix API. Exception: {}'.format(e))
    exit(1)

it doesn't occur to me that there might be a problem.
Can I see the whole ztc.conf ?

from zabbix-threat-control.

bettafishopb avatar bettafishopb commented on August 26, 2024

sorry for the late reply. Was end of week.
This is the ztc.conf currently in the system.
I've masked out the IP in the ZabbixFrontURL. If you need that too, let me know.

Thanks!

ztc.conf.txt

from zabbix-threat-control.

samosvat avatar samosvat commented on August 26, 2024

check the connection type: http/https
index.php - need to remove

As an example:
my prod env: ZabbixFrontUrl = https://zabbix.qiwi.com
my dev env: ZabbixFrontUrl = http://127.0.0.1/zabbix

from zabbix-threat-control.

bettafishopb avatar bettafishopb commented on August 26, 2024

Hello,
My connection type is http. I removed the index.php and the 'can't connect to api' error is solved.
Subsequently there was another error related to "zabbix_get" not able to run remote commands which i managed to fix.
However, i get another "zabbix_sender" error below which i can't resolve. Does it matter if my zabbix agents are running in active mode (active agents)?

Connected to Zabbix API v.4.0.5

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...
Error: Can't send data with zabbix-sender:
Command: zabbix_sender -z my.companydomain.com

ZabbixServerPort = 10051 -p 10051 -s zabbix_sender_ztc_test -k zabbix_sender_ztc_test -o 1 -vv
zabbix_sender [8778]: too few or mutually exclusive options used
usage:
.......
/bin/sh: line 3: ZabbixServerPort: command not found

Please fix this for continue!

Thank you.

from zabbix-threat-control.

samosvat avatar samosvat commented on August 26, 2024

uncomment
# ZabbixServerPort = 10051

from zabbix-threat-control.

bettafishopb avatar bettafishopb commented on August 26, 2024

yes, i've uncommented it.

image

from zabbix-threat-control.

yorchaac avatar yorchaac commented on August 26, 2024

Hello I tried to integrate vulners with zabbix last version but I have the next issue when I execute "python3.6 /opt/monitoring/zabbix-threat-control/prepare.py -uvtda" I got:

Checking the connection to the zabbix-agent...
Error: Can't execute remote command on zabbix-agent:
Command: zabbix_get -s localhost -k system.run["echo CheckRemoteCommand"]
zabbix_get [3767]: Check access restrictions in Zabbix agent configuration

If I execute the same command with other item all seems works fine
zabbix_get -s 127.0.0.1 -k agent.hostname I got : Zabbix server

from zabbix-threat-control.

samosvat avatar samosvat commented on August 26, 2024

Differences:
zabbix_get -s localhost -k system.run["echo CheckRemoteCommand"]
zabbix_get -s 127.0.0.1 -k agent.hostname

To enable this functionality (system.run), agent configuration file must contain EnableRemoteCommands=1 option.

from zabbix-threat-control.

yorchaac avatar yorchaac commented on August 26, 2024

from zabbix-threat-control.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.