- The script will create a
client
with the Prometheus using the data and script from theconfig.js
andindex.js
. - Then it will take
input.json
as--input
, parse its data, and use query from it. - The resultant will be fed to Prometheus using the
Prometheus API
. - The API will result out some json.
- The json will be parsed and the required parameters will be picked out of it.
- Then we will do some formatting of the output.
- And then will use the script to feed the formatted result to the discord.
To run the repo you need to
url - discord bot webhook inside the index.js
username - name of the channel inside the index.js
PrometheusAPI inside the config.js
SlackToken inside the config.js
SlackChannelID inside the config.js
Add host information inside the input.json
NOTE:
For sending the report to the slack you need to uncomment the code in the _index.js_
file from line 47 - 51.
Also, to run the repo you need to configure the settings in config.js file for folowing variables:
SlackToken
SlackChannelID
node index.js --input input-new.json --days 1