akpw / mktxp

Prometheus Exporter for Mikrotik RouterOS devices
Other
520 stars 101 forks source link

'bytes' object has no attribute 'encode' #202

Open EasyLOB opened 17 hours ago

EasyLOB commented 17 hours ago

Hi, I configured MKTXP with Docker and the parameters below. I have access to MIKROTIK API using ssh and API is enabled. But I get the error below. What is wrong? Thanks

Connecting to router mikrotik-white@192.168.167.12
2024-11-21 23:37:59 Connection to router mikrotik-white@192.168.167.12 has failed: 'bytes' object has no attribute 'encode'
Failed attemp to establish network connection to router: mikrotik-white@192.168.167.12
2024-11-21 23:37:59 Running HTTP metrics server on: 0.0.0.0:49090
sudo docker run --name xmktxp \
  -v "/var/devops/mktxp:/home/mktxp/mktxp/" \
  -p 49090:49090 \
  -it \
  --rm ghcr.io/akpw/mktxp:latest
[mikrotik-white]
    hostname = 192.168.167.12
    username = admin
    password = PASSWORD

[default]
    user = True
    routing_stats = False
    ssl_certificate_verify = False
    switch_port = False
    lte = False
    no_ssl_certificate = False
    check_for_updates = False
    wireless_clients = True
    ipv6_firewall = False
    plaintext_login = True
    queue = True
    firewall = True
    pool = True
    ipv6_neighbor = False
    capsman_clients = True
    interface = True
    connection_stats = False
    poe = True
    installed_packages = True
    netwatch = True
    use_ssl = False
    neighbor = True
    enabled = True
    ipv6_pool = False
    use_comments_over_names = True
    route = True
    wireless = True
    monitor = True
    kid_control_assigned = False
    certificate = False
    capsman = True
    dhcp = True
    bgp = False
    kid_control_dynamic = False
    ipv6_route = False
    ipsec = False
    connections = True
    dhcp_lease = True
    public_ip = True
    hostname = localhost
    username = user
    password = password
    remote_dhcp_entry = None
    remote_capsman_entry = None
    port = 8728
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 526.0
python_gc_objects_collected_total{generation="1"} 0.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 22.0
python_gc_collections_total{generation="1"} 1.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="13",patchlevel="0",version="3.13.0"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 4.2643456e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 3.0101504e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.73223195899e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.5800000000000001
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 21.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
Brandonza commented 9 hours ago

Which version of RouerOS are you using?

EasyLOB commented 6 hours ago

MikroTik RouterOS 6.42.11 (c) 1999-2018