Перейти к содержанию

11.event

Install event service

  1. Install the dependencies: shell cd /opt/rbt/server/services/event && \ npm install
  2. Create and edit config file.

    • copy default config: shell cp ./config.sample.json ./config.json
    • set rbt internal api endpoint
    • set clickhouse http interface
  3. Make sure the "syslog_servers" section of the server configuration contains the external IP addresses of your syslog servers: shell jq '.syslog_servers' /opt/rbt/server/config/config.json These IP addresses will be used by the devices and must be accessible from the device network.

  4. Add user for run "Event" service: shell groupadd rbt && \ useradd -g rbt -s /bin/true -d /dev/null rbt
  5. Config logrotate. Optional for local log storage: shell ln -sf /opt/rbt/install/logrotate/event /etc/logrotate.d/event Create directory for logs files: shell mkdir -p /var/log/event_service/

  6. Add systemd services by used intercom model: ###### Beward shell ln -sf /opt/rbt/install/systemd/event/event_beward.service \ /etc/systemd/system/event_beward.service

###### Beward, only model DS shell ln -sf /opt/rbt/install/systemd/event/event_beward_ds.service \ /etc/systemd/system/event_beward_ds.service

###### Qtech shell ln -sf /opt/rbt/install/systemd/event/event_qtech.service \ /etc/systemd/system/event_qtech.service

###### Intersvyaz (Sokol) shell ln -sf /opt/rbt/install/systemd/event/event_is.service \ /etc/systemd/system/event_is.service

###### Akuvox shell ln -sf /opt/rbt/install/systemd/event/event_akuvox.service \ /etc/systemd/system/event_akuvox.service

⚠️

Since the Akuvox S532 does not support configuring the syslog port and always sends logs to the default port 514, you need to set up a redirection of logs from port 514 to the port that the event service process is listening on (45455 by default).

You must configure the firewall used on your server. Example for iptables to illustrate the process:

iptables -t nat -A PREROUTING -p udp --dport 514 -j REDIRECT --to-ports 45455

###### Sputnik Cloud shell ln -sf /opt/rbt/install/systemd/event/event_sputnik_cloud.service \ /etc/systemd/system/event_sputnik_cloud.service

###### Rubetek shell ln -sf /opt/rbt/install/systemd/event/event_rubetek.service \ /etc/systemd/system/event_rubetek.service

###### Ufanet shell ln -sf /opt/rbt/install/systemd/event/event_ufanet.service \ /etc/systemd/system/event_ufanet.service

###### BasIP shell ln -sf /opt/rbt/install/systemd/event/event_basip.service \ /etc/systemd/system/event_basip.service

###### Brovotech shell ln -sf /opt/rbt/install/systemd/event/event_brovotech.service \ /etc/systemd/system/event_brovotech.service

###### iFLOW shell ln -sf /opt/rbt/install/systemd/event/event_iflow.service \ /etc/systemd/system/event_iflow.service

  1. Run created systemd services:

    • reload systemctl daemon: shell systemctl daemon-reload

    • enable all new event services: shell cd /etc/systemd/system && systemctl enable event_* --now

    • or start per service: ```shell systemctl enable event_beward.service --now

systemctl enable event_beward_ds.service --now

systemctl enable event_qtech.service --now

systemctl enable event_is.service --now

systemctl enable event_akuvox.service --now

systemctl enable event_sputnik_cloud.service --now

systemctl enable event_rubetek.service --now

systemctl enable event_ufanet.service --now

systemctl enable event_basip.service --now

systemctl enable event_brovotech.service --now ```

Next