HostUpCmd is a tool to execute a command on the host up or down is detected.
Clone repository and install dependencies:
$ git clone https://github.com/jstarstech/hostupcmd
$ cd hostupcmd
$ npm install
Copy an example configuration file and edit it for your needs:
$ cp config.json.example config.json
Run application:
$ npm start
Configuration file config.json.
All configuration properties:
Property | Default | Description |
---|---|---|
hosts | [] | Array of Host objects [ required ] |
defaultInterval | 10000 | Default interval between ping probe in milliseconds. [ optional ] |
Host object:
Property | Default | Description |
---|---|---|
host | "" | Domain or ip address of monitored host [ required ] |
cmdUp | "" | A command to execute when host probe detect host is up [ required ] |
cmdDown | "" | A command to execute when host probe detect host is down [ required ] |