Socket
Socket
Sign inDemoInstall

@daemonitor/client

Package Overview
Dependencies
355
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @daemonitor/client

This is the client for Daemonitor. It can be used to monitor your devices and send events to the Daemonitor server.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Daemonitor Client

This is the client for Daemonitor. It can be used to monitor your devices and send events to the Daemonitor server.

Run with PM2:

Clone the repository and install dependencies:

git clone https://github.com/daemonitor/client.git
cd client 
pnpm install

Setup your client.config.json and .env files:

cp client.config.json.example client.config.json
cp .env.example .env

Start the client with PM2:

pm2 start npm --name daemonitor-client -- run start

Install as a service using systemd

Note: you will not be able to use the PM2 monitoring plugin if you install as a service.

Setup your configuration file at /etc/daemonitor/client.config.json

sudo cp client.config.json.example /etc/daemonitor/client.config.json
sudo cp .env.example /etc/daemonitor/.env

Install the package globally:

sudo npm install -g @daemonitor/client

You should now be able to run the client from the command line:

daemonitor-client

Install the service:

sudo cp daemonitor-client.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable daemonitor-client
sudo systemctl start daemonitor-client

Configuration

The client can be configured using the client.config.json file. The following options are available:

OptionDescriptionOptions
connectorsAn array of connectors to load.["rest-api", "console"]
pluginsAn array of plugins to load.["os", "pm2", "ewelink", "web"]
[plugin alias]An object of options for the plugin.See plugin documentation.

Plugins

OS

The OS plugin provides information about the operating system.

PM2

The PM2 plugin provides information about PM2 processes.

OptionDescriptionDefault
processesAn array of process names to monitor.[]

Web

The Web plugin provides information about web services.

OptionDescriptionDefault
endpointsAn array of endpoints to monitor.[]

Endpoints can be configured with the following options:

OptionDescriptionDefault
nameThe name of the endpoint.
urlThe URL of the endpoint.
methodThe HTTP method to use.GET
headersAn object of headers to send.{}
bodyThe body to send.
intervalThe interval to poll the endpoint.60000
timeoutThe timeout for the request.5000
expectedStringsAn array of strings that should be present in the response.[]
expectedStatusCodeThe expected status code.200
unexpectedStringsAn array of strings that should not be present in the response.[]
unexpectedStatusCodeThe unexpected status code.200
expectedResponseTimeThe expected response time.1000
unexpectedResponseTimeThe unexpected response time.1000
expectedResponseSizeThe expected response size.0
unexpectedResponseSizeThe unexpected response size.0

The EWeLink plugin provides information about EWeLink devices.

OptionDescriptionDefault
emailEWeLink email address.
passwordEWeLink password.
regionEWeLink region.us
devicesAn array of device IDs to monitor.[]

Connectors

Console

The Console connector logs events to the console.

OptionDescriptionDefault
levelThe minimum log level to log.info

REST API

The REST API connector sends events to a REST API.

OptionDescriptionDefault
urlThe URL of the REST API.
tokenThe token to use for authentication.
levelThe minimum log level to log.info
intervalThe interval to send events.10000
timeoutThe timeout for the request.5000
maxRetriesThe maximum number of retries.3
retryDelayThe delay between retries.1000
retryBackoffThe backoff factor for retries.2
retryJitterThe jitter factor for retries.0

FAQs

Last updated on 30 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc