telert 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {telert-0.2.0/telert.egg-info → telert-0.2.2}/PKG-INFO +119 -27
- {telert-0.2.0 → telert-0.2.2}/README.md +118 -23
- {telert-0.2.0 → telert-0.2.2}/pyproject.toml +2 -6
- {telert-0.2.0 → telert-0.2.2}/telert/__init__.py +1 -1
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/base.py +1 -1
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/cli.py +3 -3
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/cli_logs.py +1 -1
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/network.py +1 -1
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/process.py +103 -62
- {telert-0.2.0 → telert-0.2.2/telert.egg-info}/PKG-INFO +119 -27
- {telert-0.2.0 → telert-0.2.2}/telert.egg-info/SOURCES.txt +2 -4
- {telert-0.2.0 → telert-0.2.2}/telert.egg-info/requires.txt +0 -4
- telert-0.2.0/telert/monitoring/logs.py +0 -267
- {telert-0.2.0 → telert-0.2.2}/LICENSE +0 -0
- {telert-0.2.0 → telert-0.2.2}/MANIFEST.in +0 -0
- {telert-0.2.0 → telert-0.2.2}/setup.cfg +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/api.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/cli.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/data/notification-icon.png +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/data/notification.mp3 +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/messaging.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/__init__.py +0 -0
- /telert-0.2.0/telert/monitoring/fixed_logs.py → /telert-0.2.2/telert/monitoring/activity_logs.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/debug_logs.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert/monitoring/log.py +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert.egg-info/dependency_links.txt +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert.egg-info/entry_points.txt +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert.egg-info/top_level.txt +0 -0
- {telert-0.2.0 → telert-0.2.2}/telert.png +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: telert
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks.
|
|
5
5
|
Author-email: Mihir Khandekar <mihirkhandekar@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,9 +37,6 @@ Provides-Extra: dev
|
|
|
37
37
|
Requires-Dist: build; extra == "dev"
|
|
38
38
|
Requires-Dist: twine; extra == "dev"
|
|
39
39
|
Requires-Dist: pytest; extra == "dev"
|
|
40
|
-
Provides-Extra: monitoring
|
|
41
|
-
Requires-Dist: psutil; extra == "monitoring"
|
|
42
|
-
Requires-Dist: ping3; extra == "monitoring"
|
|
43
40
|
Provides-Extra: audio
|
|
44
41
|
Requires-Dist: playsound; extra == "audio"
|
|
45
42
|
Provides-Extra: desktop
|
|
@@ -57,7 +54,7 @@ Dynamic: license-file
|
|
|
57
54
|
<img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
|
|
58
55
|
</p>
|
|
59
56
|
|
|
60
|
-
**Version 0.2.
|
|
57
|
+
**Version 0.2.2**
|
|
61
58
|
|
|
62
59
|
[](https://github.com/navig-me/telert/stargazers)
|
|
63
60
|
[](https://pypi.org/project/telert/)
|
|
@@ -86,14 +83,14 @@ telert run npm build
|
|
|
86
83
|
# Or pipe any command output for notification
|
|
87
84
|
find . -name "*.log" | telert "Log files found!"
|
|
88
85
|
|
|
89
|
-
# Monitor a log file
|
|
86
|
+
# Monitor a log file and notify on error
|
|
90
87
|
telert monitor log --name "postgres" --file "/var/log/postgresql/postgresql-15-main.log" --pattern "ERROR|FATAL"
|
|
91
88
|
|
|
92
|
-
# Monitor a process memory usage
|
|
93
|
-
telert monitor process --
|
|
89
|
+
# Monitor a process and notify on high memory usage
|
|
90
|
+
telert monitor process --command-pattern "ps aux | grep postgres" --memory-threshold 2G
|
|
94
91
|
|
|
95
|
-
# Monitor a network endpoint
|
|
96
|
-
telert monitor network --name "
|
|
92
|
+
# Monitor a network endpoint and notify on failure
|
|
93
|
+
telert monitor network --name "myapp-health" --host "myapp.com" --port 80 --type http --interval 60 --timeout 5 --expected-status 200 --expected-content "healthy"
|
|
97
94
|
```
|
|
98
95
|
|
|
99
96
|
Perfect for long-running tasks, remote servers, CI pipelines, monitoring critical code, processes, logs, and network services.
|
|
@@ -158,8 +155,9 @@ For more detailed information, please refer to the [docs](https://github.com/nav
|
|
|
158
155
|
|
|
159
156
|
## 🚀 Installation & Quick Start
|
|
160
157
|
|
|
158
|
+
Install and configure in seconds:
|
|
159
|
+
|
|
161
160
|
```bash
|
|
162
|
-
# Install from PyPI (works on any OS with Python 3.8+)
|
|
163
161
|
pip install telert
|
|
164
162
|
|
|
165
163
|
# Interactive setup wizard - easiest way to get started
|
|
@@ -167,22 +165,65 @@ telert init
|
|
|
167
165
|
|
|
168
166
|
# Or configure a notification provider manually
|
|
169
167
|
telert config desktop --app-name "My App" --set-default
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Use in your shell directly or wrap any command:
|
|
170
171
|
|
|
171
|
-
|
|
172
|
+
```bash
|
|
173
|
+
# Pipe command output for notification
|
|
172
174
|
long_running_command | telert "Command finished!"
|
|
173
175
|
|
|
174
|
-
#
|
|
176
|
+
# Wrap a command to capture status and timing
|
|
175
177
|
telert run --label "Database Backup" pg_dump -U postgres mydb > backup.sql
|
|
178
|
+
|
|
179
|
+
# Get notified for any command taking longer than 30 seconds
|
|
180
|
+
eval "$(telert hook -l 30)"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Or use in your Python code:
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from telert import send, telert, notify
|
|
187
|
+
|
|
188
|
+
# Simple notification
|
|
189
|
+
send("Script completed successfully!")
|
|
190
|
+
|
|
191
|
+
# Using the context manager
|
|
192
|
+
def process():
|
|
193
|
+
with telert("Data processing", provider="telegram"):
|
|
194
|
+
# Your long-running code here
|
|
195
|
+
process_large_dataset()
|
|
196
|
+
|
|
197
|
+
# Using the function decorator
|
|
198
|
+
@notify("Database backup", provider="email")
|
|
199
|
+
def backup_database():
|
|
200
|
+
# Backup code here
|
|
201
|
+
return "Backup completed"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Or monitor processes, log files, and network endpoints:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Monitor a process
|
|
208
|
+
telert monitor process --name "postgres" --command "ps aux | grep postgres" --memory-threshold 2G
|
|
209
|
+
|
|
210
|
+
# Monitor a log file
|
|
211
|
+
telert monitor log --file "/var/log/app.log" --pattern "ERROR|CRITICAL" --provider telegram
|
|
212
|
+
|
|
213
|
+
# Monitor a network endpoint
|
|
214
|
+
telert monitor network --host "myapp.com" --port 80 --type http --interval 60 --timeout 5 --expected-status 200 --expected-content "healthy"
|
|
176
215
|
```
|
|
177
216
|
|
|
178
217
|
### Key benefits
|
|
179
218
|
|
|
180
219
|
- 📱 Get notified when commands finish (even when away from your computer)
|
|
220
|
+
- 📊 Monitor processes, log files, and network endpoints
|
|
181
221
|
- ⏱️ See exactly how long commands or code took to run
|
|
182
222
|
- 🚦 Capture success/failure status codes and tracebacks
|
|
183
|
-
- 📃 View command output snippets directly in
|
|
223
|
+
- 📃 View command output snippets directly in notifications
|
|
184
224
|
- 🔄 Works with shell commands, pipelines, and Python code
|
|
185
225
|
|
|
226
|
+
|
|
186
227
|
## 📲 Notification Providers
|
|
187
228
|
|
|
188
229
|
Telert supports multiple notification services. Choose one or more based on your needs:
|
|
@@ -380,7 +421,7 @@ telert monitor process --name "nginx" --notify-on stop,high-cpu --provider slack
|
|
|
380
421
|
telert monitor process --name "postgres" --cpu-threshold 80 --memory-threshold 2G --provider telegram
|
|
381
422
|
|
|
382
423
|
# Monitor with custom action on state change
|
|
383
|
-
telert monitor process --command "python worker.py" --notify-on crash --action "systemctl restart worker"
|
|
424
|
+
telert monitor process --command-pattern "python worker.py" --notify-on crash --action "systemctl restart worker"
|
|
384
425
|
|
|
385
426
|
# List all monitored processes
|
|
386
427
|
telert monitor process --list
|
|
@@ -729,6 +770,21 @@ curl -X POST https://your-deployment-url.example.com/send \
|
|
|
729
770
|
|
|
730
771
|
For more details on deployment options and configuration, see the [telert-notifier repository](https://github.com/navig-me/telert-notifier).
|
|
731
772
|
|
|
773
|
+
---
|
|
774
|
+
## 🌿 Environment Variables
|
|
775
|
+
|
|
776
|
+
Telert can be configured using environment variables, which is especially useful in CI/CD pipelines or containerized environments. Key variables include:
|
|
777
|
+
|
|
778
|
+
- `TELERT_DEFAULT_PROVIDER` - Set default provider(s) to use
|
|
779
|
+
- Provider-specific variables for Telegram, Teams, Slack, Discord, Pushover, etc.
|
|
780
|
+
- Runtime variables like `TELERT_SILENT=1` for output control
|
|
781
|
+
|
|
782
|
+
Environment variables take precedence over the configuration file, making them perfect for temporary overrides.
|
|
783
|
+
|
|
784
|
+
[**See all environment variables**](https://github.com/navig-me/telert/blob/main/docs/ENVIRONMENT_VARIABLES.md)
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
732
788
|
## 🔧 Troubleshooting
|
|
733
789
|
|
|
734
790
|
### Desktop Notifications Issues
|
|
@@ -760,19 +816,55 @@ For more details on deployment options and configuration, see the [telert-notifi
|
|
|
760
816
|
- Install required audio players (macOS: built-in, Linux: mpg123/paplay/aplay, Windows: winsound/playsound)
|
|
761
817
|
- For MP3 support on Windows: `pip install telert[audio]`
|
|
762
818
|
|
|
819
|
+
### Notification Delivery Failures
|
|
820
|
+
- Verify your internet connection
|
|
821
|
+
- Check provider configuration with `telert status`
|
|
822
|
+
- For cloud services, verify API keys and webhook URLs
|
|
823
|
+
- Check rate limits for your notification provider
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
### Monitoring Installation Issues & Commands
|
|
827
|
+
|
|
828
|
+
Telert’s process monitoring depends on the `psutil` library. If you encounter errors related to psutil (such as ImportError, build failures, or missing wheels), follow these platform-specific tips:
|
|
829
|
+
|
|
830
|
+
**Apple Silicon (M1/M2):**
|
|
831
|
+
- Try installing psutil using the native ARM64 architecture:
|
|
832
|
+
```bash
|
|
833
|
+
arch -arm64 pip install --no-cache-dir psutil
|
|
834
|
+
```
|
|
835
|
+
- For Intel compatibility (Rosetta):
|
|
836
|
+
```bash
|
|
837
|
+
arch -x86_64 pip install --no-cache-dir psutil
|
|
838
|
+
```
|
|
839
|
+
- If you see compilation errors, ensure you have Xcode Command Line Tools installed:
|
|
840
|
+
```bash
|
|
841
|
+
xcode-select --install
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
**Linux:**
|
|
845
|
+
- Make sure you have Python development headers and a C compiler installed:
|
|
846
|
+
```bash
|
|
847
|
+
sudo apt-get install python3-dev gcc
|
|
848
|
+
pip install --upgrade --force-reinstall psutil
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
**Windows:**
|
|
852
|
+
- You may need to install Visual C++ Build Tools from:
|
|
853
|
+
https://visualstudio.microsoft.com/visual-cpp-build-tools/
|
|
854
|
+
- Then try:
|
|
855
|
+
```bash
|
|
856
|
+
pip install --upgrade --force-reinstall psutil
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
**General:**
|
|
860
|
+
- If you still have issues, try upgrading pip and setuptools:
|
|
861
|
+
```bash
|
|
862
|
+
pip install --upgrade pip setuptools wheel
|
|
863
|
+
```
|
|
864
|
+
- For more details, see the error message for platform-specific instructions.
|
|
865
|
+
|
|
866
|
+
> **Note:** psutil is required for all process monitoring features in Telert. If import fails, you’ll see a detailed error with platform-specific help.
|
|
763
867
|
|
|
764
|
-
---
|
|
765
|
-
## 🌿 Environment Variables
|
|
766
|
-
|
|
767
|
-
Telert can be configured using environment variables, which is especially useful in CI/CD pipelines or containerized environments. Key variables include:
|
|
768
|
-
|
|
769
|
-
- `TELERT_DEFAULT_PROVIDER` - Set default provider(s) to use
|
|
770
|
-
- Provider-specific variables for Telegram, Teams, Slack, Discord, Pushover, etc.
|
|
771
|
-
- Runtime variables like `TELERT_SILENT=1` for output control
|
|
772
|
-
|
|
773
|
-
Environment variables take precedence over the configuration file, making them perfect for temporary overrides.
|
|
774
|
-
|
|
775
|
-
[**See all environment variables**](https://github.com/navig-me/telert/blob/main/docs/ENVIRONMENT_VARIABLES.md)
|
|
776
868
|
|
|
777
869
|
---
|
|
778
870
|
## 📝 Message Formatting
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
**Version 0.2.
|
|
9
|
+
**Version 0.2.2**
|
|
10
10
|
|
|
11
11
|
[](https://github.com/navig-me/telert/stargazers)
|
|
12
12
|
[](https://pypi.org/project/telert/)
|
|
@@ -35,14 +35,14 @@ telert run npm build
|
|
|
35
35
|
# Or pipe any command output for notification
|
|
36
36
|
find . -name "*.log" | telert "Log files found!"
|
|
37
37
|
|
|
38
|
-
# Monitor a log file
|
|
38
|
+
# Monitor a log file and notify on error
|
|
39
39
|
telert monitor log --name "postgres" --file "/var/log/postgresql/postgresql-15-main.log" --pattern "ERROR|FATAL"
|
|
40
40
|
|
|
41
|
-
# Monitor a process memory usage
|
|
42
|
-
telert monitor process --
|
|
41
|
+
# Monitor a process and notify on high memory usage
|
|
42
|
+
telert monitor process --command-pattern "ps aux | grep postgres" --memory-threshold 2G
|
|
43
43
|
|
|
44
|
-
# Monitor a network endpoint
|
|
45
|
-
telert monitor network --name "
|
|
44
|
+
# Monitor a network endpoint and notify on failure
|
|
45
|
+
telert monitor network --name "myapp-health" --host "myapp.com" --port 80 --type http --interval 60 --timeout 5 --expected-status 200 --expected-content "healthy"
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Perfect for long-running tasks, remote servers, CI pipelines, monitoring critical code, processes, logs, and network services.
|
|
@@ -107,8 +107,9 @@ For more detailed information, please refer to the [docs](https://github.com/nav
|
|
|
107
107
|
|
|
108
108
|
## 🚀 Installation & Quick Start
|
|
109
109
|
|
|
110
|
+
Install and configure in seconds:
|
|
111
|
+
|
|
110
112
|
```bash
|
|
111
|
-
# Install from PyPI (works on any OS with Python 3.8+)
|
|
112
113
|
pip install telert
|
|
113
114
|
|
|
114
115
|
# Interactive setup wizard - easiest way to get started
|
|
@@ -116,22 +117,65 @@ telert init
|
|
|
116
117
|
|
|
117
118
|
# Or configure a notification provider manually
|
|
118
119
|
telert config desktop --app-name "My App" --set-default
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Use in your shell directly or wrap any command:
|
|
119
123
|
|
|
120
|
-
|
|
124
|
+
```bash
|
|
125
|
+
# Pipe command output for notification
|
|
121
126
|
long_running_command | telert "Command finished!"
|
|
122
127
|
|
|
123
|
-
#
|
|
128
|
+
# Wrap a command to capture status and timing
|
|
124
129
|
telert run --label "Database Backup" pg_dump -U postgres mydb > backup.sql
|
|
130
|
+
|
|
131
|
+
# Get notified for any command taking longer than 30 seconds
|
|
132
|
+
eval "$(telert hook -l 30)"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Or use in your Python code:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from telert import send, telert, notify
|
|
139
|
+
|
|
140
|
+
# Simple notification
|
|
141
|
+
send("Script completed successfully!")
|
|
142
|
+
|
|
143
|
+
# Using the context manager
|
|
144
|
+
def process():
|
|
145
|
+
with telert("Data processing", provider="telegram"):
|
|
146
|
+
# Your long-running code here
|
|
147
|
+
process_large_dataset()
|
|
148
|
+
|
|
149
|
+
# Using the function decorator
|
|
150
|
+
@notify("Database backup", provider="email")
|
|
151
|
+
def backup_database():
|
|
152
|
+
# Backup code here
|
|
153
|
+
return "Backup completed"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or monitor processes, log files, and network endpoints:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Monitor a process
|
|
160
|
+
telert monitor process --name "postgres" --command "ps aux | grep postgres" --memory-threshold 2G
|
|
161
|
+
|
|
162
|
+
# Monitor a log file
|
|
163
|
+
telert monitor log --file "/var/log/app.log" --pattern "ERROR|CRITICAL" --provider telegram
|
|
164
|
+
|
|
165
|
+
# Monitor a network endpoint
|
|
166
|
+
telert monitor network --host "myapp.com" --port 80 --type http --interval 60 --timeout 5 --expected-status 200 --expected-content "healthy"
|
|
125
167
|
```
|
|
126
168
|
|
|
127
169
|
### Key benefits
|
|
128
170
|
|
|
129
171
|
- 📱 Get notified when commands finish (even when away from your computer)
|
|
172
|
+
- 📊 Monitor processes, log files, and network endpoints
|
|
130
173
|
- ⏱️ See exactly how long commands or code took to run
|
|
131
174
|
- 🚦 Capture success/failure status codes and tracebacks
|
|
132
|
-
- 📃 View command output snippets directly in
|
|
175
|
+
- 📃 View command output snippets directly in notifications
|
|
133
176
|
- 🔄 Works with shell commands, pipelines, and Python code
|
|
134
177
|
|
|
178
|
+
|
|
135
179
|
## 📲 Notification Providers
|
|
136
180
|
|
|
137
181
|
Telert supports multiple notification services. Choose one or more based on your needs:
|
|
@@ -329,7 +373,7 @@ telert monitor process --name "nginx" --notify-on stop,high-cpu --provider slack
|
|
|
329
373
|
telert monitor process --name "postgres" --cpu-threshold 80 --memory-threshold 2G --provider telegram
|
|
330
374
|
|
|
331
375
|
# Monitor with custom action on state change
|
|
332
|
-
telert monitor process --command "python worker.py" --notify-on crash --action "systemctl restart worker"
|
|
376
|
+
telert monitor process --command-pattern "python worker.py" --notify-on crash --action "systemctl restart worker"
|
|
333
377
|
|
|
334
378
|
# List all monitored processes
|
|
335
379
|
telert monitor process --list
|
|
@@ -678,6 +722,21 @@ curl -X POST https://your-deployment-url.example.com/send \
|
|
|
678
722
|
|
|
679
723
|
For more details on deployment options and configuration, see the [telert-notifier repository](https://github.com/navig-me/telert-notifier).
|
|
680
724
|
|
|
725
|
+
---
|
|
726
|
+
## 🌿 Environment Variables
|
|
727
|
+
|
|
728
|
+
Telert can be configured using environment variables, which is especially useful in CI/CD pipelines or containerized environments. Key variables include:
|
|
729
|
+
|
|
730
|
+
- `TELERT_DEFAULT_PROVIDER` - Set default provider(s) to use
|
|
731
|
+
- Provider-specific variables for Telegram, Teams, Slack, Discord, Pushover, etc.
|
|
732
|
+
- Runtime variables like `TELERT_SILENT=1` for output control
|
|
733
|
+
|
|
734
|
+
Environment variables take precedence over the configuration file, making them perfect for temporary overrides.
|
|
735
|
+
|
|
736
|
+
[**See all environment variables**](https://github.com/navig-me/telert/blob/main/docs/ENVIRONMENT_VARIABLES.md)
|
|
737
|
+
|
|
738
|
+
---
|
|
739
|
+
|
|
681
740
|
## 🔧 Troubleshooting
|
|
682
741
|
|
|
683
742
|
### Desktop Notifications Issues
|
|
@@ -709,19 +768,55 @@ For more details on deployment options and configuration, see the [telert-notifi
|
|
|
709
768
|
- Install required audio players (macOS: built-in, Linux: mpg123/paplay/aplay, Windows: winsound/playsound)
|
|
710
769
|
- For MP3 support on Windows: `pip install telert[audio]`
|
|
711
770
|
|
|
771
|
+
### Notification Delivery Failures
|
|
772
|
+
- Verify your internet connection
|
|
773
|
+
- Check provider configuration with `telert status`
|
|
774
|
+
- For cloud services, verify API keys and webhook URLs
|
|
775
|
+
- Check rate limits for your notification provider
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
### Monitoring Installation Issues & Commands
|
|
779
|
+
|
|
780
|
+
Telert’s process monitoring depends on the `psutil` library. If you encounter errors related to psutil (such as ImportError, build failures, or missing wheels), follow these platform-specific tips:
|
|
781
|
+
|
|
782
|
+
**Apple Silicon (M1/M2):**
|
|
783
|
+
- Try installing psutil using the native ARM64 architecture:
|
|
784
|
+
```bash
|
|
785
|
+
arch -arm64 pip install --no-cache-dir psutil
|
|
786
|
+
```
|
|
787
|
+
- For Intel compatibility (Rosetta):
|
|
788
|
+
```bash
|
|
789
|
+
arch -x86_64 pip install --no-cache-dir psutil
|
|
790
|
+
```
|
|
791
|
+
- If you see compilation errors, ensure you have Xcode Command Line Tools installed:
|
|
792
|
+
```bash
|
|
793
|
+
xcode-select --install
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
**Linux:**
|
|
797
|
+
- Make sure you have Python development headers and a C compiler installed:
|
|
798
|
+
```bash
|
|
799
|
+
sudo apt-get install python3-dev gcc
|
|
800
|
+
pip install --upgrade --force-reinstall psutil
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
**Windows:**
|
|
804
|
+
- You may need to install Visual C++ Build Tools from:
|
|
805
|
+
https://visualstudio.microsoft.com/visual-cpp-build-tools/
|
|
806
|
+
- Then try:
|
|
807
|
+
```bash
|
|
808
|
+
pip install --upgrade --force-reinstall psutil
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
**General:**
|
|
812
|
+
- If you still have issues, try upgrading pip and setuptools:
|
|
813
|
+
```bash
|
|
814
|
+
pip install --upgrade pip setuptools wheel
|
|
815
|
+
```
|
|
816
|
+
- For more details, see the error message for platform-specific instructions.
|
|
817
|
+
|
|
818
|
+
> **Note:** psutil is required for all process monitoring features in Telert. If import fails, you’ll see a detailed error with platform-specific help.
|
|
712
819
|
|
|
713
|
-
---
|
|
714
|
-
## 🌿 Environment Variables
|
|
715
|
-
|
|
716
|
-
Telert can be configured using environment variables, which is especially useful in CI/CD pipelines or containerized environments. Key variables include:
|
|
717
|
-
|
|
718
|
-
- `TELERT_DEFAULT_PROVIDER` - Set default provider(s) to use
|
|
719
|
-
- Provider-specific variables for Telegram, Teams, Slack, Discord, Pushover, etc.
|
|
720
|
-
- Runtime variables like `TELERT_SILENT=1` for output control
|
|
721
|
-
|
|
722
|
-
Environment variables take precedence over the configuration file, making them perfect for temporary overrides.
|
|
723
|
-
|
|
724
|
-
[**See all environment variables**](https://github.com/navig-me/telert/blob/main/docs/ENVIRONMENT_VARIABLES.md)
|
|
725
820
|
|
|
726
821
|
---
|
|
727
822
|
## 📝 Message Formatting
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "telert"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks."
|
|
5
5
|
authors = [{name = "Mihir Khandekar", email = "mihirkhandekar@gmail.com"}]
|
|
6
6
|
license = "MIT"
|
|
@@ -10,7 +10,7 @@ dependencies = [
|
|
|
10
10
|
"requests>=2.25",
|
|
11
11
|
"beautifulsoup4>=4.9.0",
|
|
12
12
|
"psutil>=5.9.0",
|
|
13
|
-
"ping3>=4.0.0"
|
|
13
|
+
"ping3>=4.0.0"
|
|
14
14
|
]
|
|
15
15
|
keywords = [
|
|
16
16
|
"telegram",
|
|
@@ -66,10 +66,6 @@ dev = [
|
|
|
66
66
|
"twine",
|
|
67
67
|
"pytest"
|
|
68
68
|
]
|
|
69
|
-
monitoring = [
|
|
70
|
-
"psutil",
|
|
71
|
-
"ping3"
|
|
72
|
-
]
|
|
73
69
|
audio = [
|
|
74
70
|
"playsound"
|
|
75
71
|
]
|
|
@@ -10,7 +10,7 @@ from datetime import datetime
|
|
|
10
10
|
from typing import Any, Dict, List, Optional, Union, TypeVar, Generic
|
|
11
11
|
|
|
12
12
|
from telert.messaging import Provider, send_message
|
|
13
|
-
from telert.monitoring.
|
|
13
|
+
from telert.monitoring.activity_logs import MonitorLogger, LogLevel
|
|
14
14
|
|
|
15
15
|
# Type definitions
|
|
16
16
|
MonitorID = str
|
|
@@ -53,7 +53,7 @@ def setup_process_monitor_cli(subparsers):
|
|
|
53
53
|
"--name", help="process name to monitor (can be a regular expression)"
|
|
54
54
|
)
|
|
55
55
|
process_group.add_argument(
|
|
56
|
-
"--command", help="command pattern to match (can be a regular expression)"
|
|
56
|
+
"--command-pattern", dest="command_pattern", help="command pattern to match (can be a regular expression)"
|
|
57
57
|
)
|
|
58
58
|
process_group.add_argument(
|
|
59
59
|
"--pid", type=int, help="specific process ID to monitor"
|
|
@@ -303,7 +303,7 @@ def handle_process_monitor(args):
|
|
|
303
303
|
return
|
|
304
304
|
|
|
305
305
|
# Start a new monitor
|
|
306
|
-
if not (args.name or args.
|
|
306
|
+
if not (args.name or args.command_pattern or args.pid):
|
|
307
307
|
print("❌ You must specify at least one of --name, --command, or --pid.")
|
|
308
308
|
return
|
|
309
309
|
|
|
@@ -324,7 +324,7 @@ def handle_process_monitor(args):
|
|
|
324
324
|
monitor_id = monitor_process(
|
|
325
325
|
name=args.monitor_name,
|
|
326
326
|
process_name=args.name,
|
|
327
|
-
command=args.
|
|
327
|
+
command=args.command_pattern,
|
|
328
328
|
pid=args.pid,
|
|
329
329
|
notify_on=notify_on,
|
|
330
330
|
cpu_threshold=args.cpu_threshold,
|
|
@@ -24,7 +24,7 @@ from telert.monitoring.base import (
|
|
|
24
24
|
MonitorStatus,
|
|
25
25
|
MonitorRegistry
|
|
26
26
|
)
|
|
27
|
-
from telert.monitoring.
|
|
27
|
+
from telert.monitoring.activity_logs import LogLevel
|
|
28
28
|
from telert.monitoring.debug_logs import debug_log, debug_inspect
|
|
29
29
|
|
|
30
30
|
|