mattpker / pm2-slack Goto Github PK
View Code? Open in Web Editor NEWA PM2 module to emit events to Slack
License: MIT License
A PM2 module to emit events to Slack
License: MIT License
I have a node application for downloading some files daily in that application it shows the progress in the command but i want only specific log messages to be notified when the specified regex is matched to the log name or description. Also i want to notify only for specific app process because pm2 can be processed for many apps
Hello
first, thank you for your wonderful work!
I got this error on my gliderlabs/alpine:3.3 image
log:
$ pm2 install pm2-slack
[PM2][Module] Installing module pm2-slack
[PM2][Module] Module already installed. Updating.
[PM2][Module] Processing...
............/root/.pm2
`-- [email protected]
[PM2][Module][ERROR] Unknown module
Currently you are using os.hostname()
as username
for slack messages.
As we don't want to make it public, could you add an option to override it?
We have also tried setting a default on the Slack webhook but that gets ignored.
Thanks
I have used it to monitor my apps. But the thing is that it is not properly emitting the events. Restarting an app doesn't emit restart event , instead, it emits two exit events. Anybody got an idea why it might be happening?
My settings:
slack_url: https://hooks.slack.com/services/[redacted]/[redacted]/[redacted]
buffer_seconds: 20
log: true
I tried stopping and starting pm2 but nothing...
If I do pm2 log
I can see my log files updating, but nothing gets to my slack channel. I have no idea how to debug this...
Is there a reason why the maximum buffer second limit is only 5 seconds? I have a usecase that I need it to send only every 10/30 seconds.
Refusing to download the git repo
{"protocol":"http:","hostname":"ikt.pm2.io","repository":"http://ikt.pm2.io/ikt.git"} over HTTP without a commit hash
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Environment:
DigitalOcean, Alpine Linux (inside the docker container)
Is there a reason this package uses version 0.15.10 of pm2? It is at 2.7.2 now.
The reason I ask is since the old version has a ikt: 'git+http://ikt.pm2.io/ikt.git#master'
dependency which is messing with our builds and is gone in the newer version
Thanks for great project! I have following feature request:
I want to add <!channel>
to messages, so all members in our Slack channel get notification.
Preferably as option, so we can ping only specific user per process.
Hi, is there a way to configure 2 or more slack webhook urls? I have two channels and I need to set two webhooks or at least set different channels from PM2 module.
Maybe it's done but i didn't find it.
Thanks in advance.
Would it be possible to add the id of the process to the message title?
If you have 4 processes with the same name this helps to see where an event happened.
Config not included slack channel name. Can you include it to config?
`/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:130
return typeof obj == 'object' && obj.width != undefined
^
TypeError: Cannot read property 'width' of null
at get_width (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:130:41)
at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:125:68
at Array.forEach (native)
at extractColumnWidths (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:124:9)
at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:98:11
at Array.forEach (native)
at Table.toString (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:95:16)
at /usr/lib/node_modules/pm2/lib/API/CliUx.js:329:29
at Array.forEach (native)
at Object.UX.dispKeys (/usr/lib/node_modules/pm2/lib/API/CliUx.js:310:19)`
I am not familiar with PM2 plugin architecture, but is it possible to somehow enable this plugin only for a particular process? On our server there are some processed which are not production related so we don't care about those much.
Hello.
My application is outputting logs using winston with colorize option set to true. This allows me to see logs that is colorized based on the log type (error shows up in red, etc..)
Now, since pm2-slack sends logs to slack without stripping the terminal color code, I am seeing something like following in the slack channel.
my.host.com BOT [3:44 AM]
sca-wf-task - error
----------------
"Thu Oct 06 2016 07:44:01 GMT+0000 (UTC) - \u001b[31merror\u001b[39m: can't clean taskdir on resource_id:575ef81e9b8f34d642b15106 because resource status is not ok\n"
Is there anyway to strip those terminal color codes like.. \u001b[31m
?
Hi Matt,
Since the latest install, we get this strange warning and error.
We are using Yarn to install all our packages.
But it seems to be related to something in the pm2-slack
module.
StdOut:
[PM2][Module] Installing module pm2-slack
[PM2][Module] Module already installed. Updating.
[PM2] Applying action deleteProcessId on app [0](ids: 0)
[PM2] [pm2-slack](0) ✓
In memory process deleted
[PM2][Module] Calling [YARN] to install pm2-slack ...
yarn add v0.24.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 1 new dependency.
└─ [email protected]
Done in 1.02s.
[PM2][Module] Module downloaded
[PM2][WARN] Applications index not running, starting...
[PM2] App [pm2-slack] launched (1 instances)
== pm2-slack ==
StdErr:
warning No license field
warning [email protected]: The platform "linux" is incompatible with this module.
warning No license field
/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:130
return typeof obj == 'object' && obj.width != undefined
^
TypeError: Cannot read property 'width' of null
at get_width (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:130:41)
at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:125:68
at Array.forEach (native)
at extractColumnWidths (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:124:9)
at /usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:98:11
at Array.forEach (native)
at Table.toString (/usr/lib/node_modules/pm2/node_modules/cli-table/lib/index.js:95:16)
at /usr/lib/node_modules/pm2/lib/API/CliUx.js:329:29
at Array.forEach (native)
at Object.UX.dispKeys (/usr/lib/node_modules/pm2/lib/API/CliUx.js:310:19)
hello. i'm using pm2-slack module.
slack message not formal.
ex.
"2017-02-16T10:00:00.729Z - \u001b[31merror\u001b[39m: [ auth/email-already-in-use ] The email address is already in use by another account. \n{ email: \u001b[32m'[email protected]'\u001b[39m,\n password: \u001b[32m'barogo1004!'\u001b[39m,\n phone: \u001b[32m'0111111242'\u001b[39m }\n"
why print this message?
this module verfy useful to me..
thank you!
Hi, is there a way to ignore one of all the pm2 running processes?
Thanks
Is there a way to notify on a reload? Either from pm2 reload
or due to the --max-memory-restart
flag?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.