Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
pm2-telegram
Advanced tools
Telegram notifications for PM2 process manager
/test Hello bot!
(use any command-like message started by slash)https://api.telegram.org/bot<BOT_TOKEN>/getUpdates
{
"ok": true,
"result": [{
"update_id": 123456789,
"message": {
"message_id": 1,
"from": {
"id": 223322223322,
"is_bot": false,
"first_name": "Hildur",
"last_name": "Bock",
"username": "fröken_bock"
},
"chat": {
"id": -76543210, // <- this is chat_id!
"title": "Buns_Eaters",
"type": "group",
"all_members_are_administrators": false
},
"date": 1649627436,
"text": "/test Hello bot!",
"entities": [{
"offset": 0,
"length": 5,
"type": "bot_command"
}
]
}
}]
}
CHAT_ID is on result.message.chat.id
property.
If you in the first created a group with only you and a bot, but later you'll add a second real user
chat.id
could be changed by Telegram. Checkchat.id
after add the second real user!
pm2 install pm2-telegram
pm2 set pm2-telegram:bot_token <BOT_TOKEN>
pm2 set pm2-telegram:chat_id <CHAT_ID>
For a group's chat id prepend it by
g-
to isolate minus sign, eg:
group chat CHAT_ID =-76543210
->g-76543210
personal chat CHAT_ID =123456789
->123456789
pm2 set pm2-telegram:<OPTION_NAME> <OPTION_VALUE>
option name | default | description |
---|---|---|
error | true | console.error() and console.warn() |
log | false | console.log() |
kill | true | kill PM2 process |
exception | true | exception in PM2 process |
option name | default | description |
---|---|---|
collate | true | combine short messages to one Telegram message |
option name | default | description |
---|---|---|
title | server host name | messages title (could be used for set server name) |
text_format | undefined | 'Markdown' to format messages (be careful if your messages could have Markdown format characters - there'll lost them) |
pm2 set pm2-telegram:title OnTheRoof
pm2 set pm2-telegram:bot_token 223322223322:ABCDefghIJKLmnop12345rStUvWxYz67890
pm2 set pm2-telegram:chat_id g-76543210
pm2 set pm2-telegram:error true
pm2 set pm2-telegram:text_format Markdown
pm2 install pm2-telegram
Use set
operator without a value to reset option.
For example to clear text_format
option value use: pm2 set pm2-telegram:text_format
pm2 install pm2-telegram@latest
Welcome to GitHub Issues!
version | changes |
---|---|
0.2.4 | • fix: remove extra debug message |
0.2.3 | • docs: remove documentation images from project |
0.2.2 | • docs: documentation corrections |
0.2.1 | • docs: minimize example's image files size |
0.2.0 | • feature: add option text_format to format notification messages• fix: mistaken truncate messages on & character |
0.1.12 | • docs: documentation update |
0.1.11 | • feature: set default title as local server hostname (on upgrade don't forget to call pm2 set pm2-telegram:title with empty value to reset value stored in PM2 'title' variable) |
0.1.10 | • docs: documentation update |
0.1.9 | • fix: message type missed in notification title ('error', 'exception' etc.) and in messages delimiters (new lines) |
0.1.8 | • fix: error on send exception message (message is 'undefined') |
FAQs
Telegram notifications for PM2 process manager
The npm package pm2-telegram receives a total of 34 weekly downloads. As such, pm2-telegram popularity was classified as not popular.
We found that pm2-telegram demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.