isc-projects / kea-anterius

This is an archive but is no longer maintained and we do NOT recommend you use this in production. There are known security vulnerabilities. This was a Google Summer of Code 2018 project to create a GUI dashboard for Kea. It is publicly available open source, but ISC is *not* supporting it. The original author is unable to provide much support either, so it should be considered experimental.
Mozilla Public License 2.0
65 stars 16 forks source link

Unable to launch the command npm start #27

Open FlochonR opened 5 years ago

FlochonR commented 5 years ago

Hello,

I configure anterius_config.json like this :

{
  "server_addr": "10.72.3.50",
  "server_port": "8000",
  "stat_refresh_interval": "5",
  "admin_user": "test",
  "admin_password": "toto",
  "current_server": "dhcp4",
  "current_host_index": 0,
  "server_host_list": [
    {
      "hostname": "Local Machine",
      "svr_addr": "10.72.3.50",
      "svr_port": "8082"
    }
  ],
  "leases_file": "/usr/local/var/kea/kea-leases4.csv",
  "log_file": "/usr/local/var/log/kea-dhcp4.log",
  "config_file": "/usr/local/etc/kea/kea-dhcp4.conf",
  "shared_network_critical_threshold": "95",
  "shared_network_warning_threshold": "0",
  "leases_per_minute_threshold": "50",
  "email_alert_to": "",
  "sms_alert_to": "",
  "slack_webhook_url": "",
  "slack_alert_channel": ""
}

When I launch "npm start", I get this:

> kea-anterius@0.0.0 start /var/tmp/kea-anterius
> node ./bin/www

Anterius Server> Bootup complete
Anterius Server> OUI Database Loaded
[WS] STATUS: Socket clients (0)

I don't understand what is the error or the mistake. What's it wrong in my conf ?

Thank you in advance

TaggerTie commented 5 years ago

It seems that there are no "control-sockets" defined in the config files:

for example: i've put the following lines in the kea-ctrl-agent.conf and kea-dhcp4.conf

"control-sockets": {
  "dhcp4": {
    "socket-type": "unix",
    "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
   }
} 
FlochonR commented 5 years ago

Yes I have control-sockets in my 2 files

{prefix}/etc/kea/kea-ctrl-agent.conf:

{
    "Control-agent": {
        "http-host": "10.72.3.50",
        "http-port": 8080,

        "control-sockets": {
            "dhcp4": {
                "socket-type": "unix",
                "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
            }
        },
        "hooks-libraries": [        ]
    },...
}

{prefix}/sbin/kea-dhcp4.conf:

{
  "Control-agent": {
    "control-sockets": {
      "dhcp4": {
        "socket-name": "/tmp/kea-dhcp4-ctrl.sock",
        "socket-type": "unix"
      }
    },
    "hooks-libraries": [ ],
    "http-host": "10.72.3.50",
    "http-port": 8000
  }
}

{prefix}/etc/kea/kea-dhcp4.conf:

{
    "Dhcp4": {
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
        },...
}

I declare control-socket everywhere and I have always the same issue When I enter the command netstat -an, I have well the line with the socket:

unix  2      [ ACC ]     STREAM     LISTENING     489680   /tmp/kea-dhcp4-ctrl.sock
Anthrino commented 5 years ago

Hi @FlochonR, There seems to be no issue with your npm command execution, the output you posted is log printed by Anterius. Please open your browser and navigate to localhost:3000 (default address for nodejs apps defined in bin/www) to open Anterius dashboard. Thanks for raising this concern, Anterius is still in experimental release with plenty of bugs, do report back in case of any other issues.