-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(templ): update templates and methods
- Loading branch information
Showing
9 changed files
with
96 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
{# templates/index.jinja2 #} | ||
|
||
Hi *{{ first_name }}*, | ||
|
||
I'm a bot for server monitoring, here to help you keep an eye on your server. I'm still learning, but today I can provide you with some useful information. | ||
|
||
Here's what I can tell you: | ||
|
||
🐳 *A large section on Docker* | ||
|
||
- Information about containers (even those that have finished work) | ||
- The ability to view container logs | ||
- Information about images | ||
- Management of containers (start, stop, remove, and more) | ||
|
||
💡 *Features* | ||
|
||
- Load average information | ||
- Summary memory usage information (with swap) | ||
- Sensors information | ||
- Summary process information | ||
- Uptime information | ||
- File system base information | ||
- Basic information about the network connection | ||
- Support for plugins, allowing you to extend my capabilities | ||
|
||
My knowledge is still growing, so I recommend checking back periodically to see what I've learned. If there is anything else that I can help you with, please let me know. You can find me on [GitHub](https://github.com/orenlab/pytmbot/) | ||
Hello, *{{ first_name }}*! 👋 | ||
|
||
I’m *pyTMbot*, a versatile Telegram bot designed for Docker management, server monitoring, and extending functionality through plugins. I support both polling and webhook modes and can be deployed on your host machine or inside a Docker container. | ||
|
||
Here’s what I can do: | ||
|
||
🐳 *Docker Management* | ||
- Start, stop, restart, and manage containers | ||
- Monitor real-time status of running/stopped containers | ||
- Access and search detailed container logs | ||
- Inspect and manage Docker images (tags, metadata) | ||
- *NEW*: Check for Docker image updates (compare local tags with Docker Hub) | ||
|
||
🖥️ *Server Monitoring* | ||
- Load average and system uptime | ||
- Memory and swap usage | ||
- Real-time sensor data | ||
- Process summary and control | ||
- Network and file system information | ||
- *NEW*: Quick system and Docker summary | ||
|
||
🔌 *Plugin System* | ||
- Extend my functionality with custom plugins: | ||
- *Monitor Plugin*: Track CPU, memory, disk usage, and Docker changes. | ||
- *2FA Plugin*: Two-factor authentication via QR codes and TOTP. | ||
- *Outline VPN Plugin*: Monitor your Outline VPN server. | ||
|
||
🔖 *Additional Features* | ||
- Check for bot updates: `/check_bot_updates` | ||
- Emoji support for better interaction 😎 | ||
- Templated responses powered by Jinja2 | ||
- Extensive logging via Docker log aggregators | ||
|
||
I’m constantly improving, so check back often for updates! If you have questions or suggestions, let me know. You can find me on [GitHub](https://github.com/orenlab/pytmbot/). | ||
|
||
Happy monitoring! 🚀 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
{# templates/fs.jinja2 #} | ||
|
||
{{ thought_balloon }} Here is: | ||
{{ thought_balloon }} Network stats: | ||
|
||
<pre language="bash"> | ||
{% for value in context %} | ||
{{ up_left_arrow }} **Bytes sent:** {{ value['bytes_sent'] }} | ||
{{ up_right_arrow }} **Bytes received:** {{ value['bytes_recv'] }} | ||
{{ up_left_arrow }} **Packets sent:** {{ value['packets_sent'] }} | ||
{{ up_right_arrow }} **Packets received:** {{ value['packets_recv'] }} | ||
{{ up_right_arrow }} **Input errors:** {{ value['err_in'] }} | ||
{{ up_left_arrow }} **Output errors:** {{ value['err_out'] }} | ||
{{ up_right_arrow }} **Input dropped packets:** {{ value['drop_in'] }} | ||
{{ up_left_arrow }} **Output dropped packets:** {{ value['drop_out'] }} | ||
{% set sent_bytes = value['bytes_sent'] | string %} | ||
{% set recv_bytes = value['bytes_recv'] | string %} | ||
{% set sent_packets = value['packets_sent'] | string %} | ||
{% set recv_packets = value['packets_recv'] | string %} | ||
{% set sent_errors = value['err_out'] | string %} | ||
{% set recv_errors = value['err_in'] | string %} | ||
{% set sent_dropped = value['drop_out'] | string %} | ||
{% set recv_dropped = value['drop_in'] | string %} | ||
|
||
{% set max_sent_len = [sent_bytes | length, sent_packets | length, sent_errors | length, sent_dropped | length] | max %} | ||
{% set max_recv_len = [recv_bytes | length, recv_packets | length, recv_errors | length, recv_dropped | length] | max %} | ||
|
||
| Parameter | Sent{{ ' ' * (max_sent_len - 4) }} | Received{{ ' ' * (max_recv_len - 8) }} | | ||
|------------|{{ '-' * (max_sent_len + 2) }}|{{ '-' * (max_recv_len + 2) }}| | ||
| Bytes | {{ "{:>{width}}".format(value['bytes_sent'], width=max_sent_len) }} | {{ "{:>{width}}".format(value['bytes_recv'], width=max_recv_len) }} | | ||
| Packets | {{ "{:>{width}}".format(value['packets_sent'], width=max_sent_len) }} | {{ "{:>{width}}".format(value['packets_recv'], width=max_recv_len) }} | | ||
| Errors | {{ "{:>{width}}".format(value['err_out'], width=max_sent_len) }} | {{ "{:>{width}}".format(value['err_in'], width=max_recv_len) }} | | ||
| Dropped | {{ "{:>{width}}".format(value['drop_out'], width=max_sent_len) }} | {{ "{:>{width}}".format(value['drop_in'], width=max_recv_len) }} | | ||
{% endfor %} | ||
</pre> | ||
|
||
{{ globe_showing_europe_africa }} Bytes unite us! {{ hugging_face }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
{# templates/b_quick_view.jinja2 #} | ||
🖥️ *System Quick View* | ||
📊 *System Status Overview* | ||
|
||
```bash | ||
{% if context.system %} | ||
🖥️ | ||
├─ ⏱️ Uptime: {{ "{:>10}".format(context.system.uptime if context.system.uptime else 'N/A') }} | ||
├─ 📊 Load Average: | ||
│ ├─ 1 min: {{ "{:>10.2f}".format(context.system.load_average[0] if context.system.load_average and context.system.load_average[0] is defined else 'N/A') }} | ||
│ ├─ 5 min: {{ "{:>10.2f}".format(context.system.load_average[1] if context.system.load_average and context.system.load_average[1] is defined else 'N/A') }} | ||
│ └─ 15 min: {{ "{:>10.2f}".format(context.system.load_average[2] if context.system.load_average and context.system.load_average[2] is defined else 'N/A') }} | ||
├─ 🧠 Memory: | ||
│ ├─ Used: {{ "{:>10}".format(context.system.memory.used if context.system.memory and context.system.memory.used else 'N/A') }} | ||
│ ├─ Free: {{ "{:>10}".format(context.system.memory.free if context.system.memory and context.system.memory.free else 'N/A') }} | ||
│ └─ Usage: {{ "{:>10}".format((context.system.memory.percent | string + '%') if context.system.memory and context.system.memory.percent is not none else 'N/A') }} | ||
├─ ⚡ CPU Usage: | ||
│ └─ {{ "{:>10}".format((context.system.cpu.cpu_percent | string + '%') if context.system.cpu and context.system.cpu.cpu_percent is not none else 'N/A') }} | ||
└─ ⚙️ Processes: | ||
├─ Running: {{ "{:>10}".format(context.system.processes.running if context.system.processes and context.system.processes.running else 'N/A') }} | ||
└─ Total: {{ "{:>10}".format(context.system.processes.total if context.system.processes and context.system.processes.total else 'N/A') }} | ||
```bash | ||
🖥️ System Resources | ||
├─ ⏱️ Uptime | ||
│ └─ {{ "{:>12}".format(context.system.uptime if context.system.uptime is not none else 'N/A') }} | ||
│ | ||
├─ 📈 Load Average | ||
│ ├─ 1 min: {{ "{:>8.2f}".format(context.system.load_average[0]) if context.system.load_average and context.system.load_average[0] is not none else '{:>8}'.format('N/A') }} | ||
│ ├─ 5 min: {{ "{:>8.2f}".format(context.system.load_average[1]) if context.system.load_average and context.system.load_average[1] is not none else '{:>8}'.format('N/A') }} | ||
│ └─ 15 min: {{ "{:>8.2f}".format(context.system.load_average[2]) if context.system.load_average and context.system.load_average[2] is not none else '{:>8}'.format('N/A') }} | ||
│ | ||
├─ 🧠 Memory Usage | ||
│ ├─ Used: {{ "{:>8}".format(context.system.memory.used) if context.system.memory and context.system.memory.used is not none else '{:>8}'.format('N/A') }} GB | ||
│ ├─ Free: {{ "{:>8}".format(context.system.memory.free) if context.system.memory and context.system.memory.free is not none else '{:>8}'.format('N/A') }} GB | ||
│ └─ Usage: {{ "{:>7}%".format(context.system.memory.percent) if context.system.memory and context.system.memory.percent is not none else '{:>8}'.format('N/A') }} | ||
│ | ||
└─ ⚙️ Process Stats | ||
├─ Running: {{ "{:>8}".format(context.system.processes.running if context.system.processes and context.system.processes.running is not none else 'N/A') }} | ||
├─ Sleeping: {{ "{:>8}".format(context.system.processes.sleeping if context.system.processes and context.system.processes.sleeping is not none else 'N/A') }} | ||
├─ Idle: {{ "{:>8}".format(context.system.processes.idle if context.system.processes and context.system.processes.idle is not none else 'N/A') }} | ||
└─ Total: {{ "{:>8}".format(context.system.processes.total if context.system.processes and context.system.processes.total is not none else 'N/A') }} | ||
{% else %} | ||
⚠️ System data is not available. | ||
⚠️ System monitoring data is currently unavailable | ||
{% endif %} | ||
|
||
{% if context.docker %} | ||
🐳 | ||
└─ 🐳 Docker Status | ||
├─ Containers: {{ "{:>10}".format(context.docker.containers_count if context.docker.containers_count else 'N/A') }} | ||
└─ Images: {{ "{:>10}".format(context.docker.images_count if context.docker.images_count else 'N/A') }} | ||
🐳 Docker Environment | ||
├─ Active Containers: {{ "{:>8}".format(context.docker.containers_count if context.docker.containers_count is not none else 'N/A') }} | ||
└─ Available Images: {{ "{:>8}".format(context.docker.images_count if context.docker.images_count is not none else 'N/A') }} | ||
{% endif %} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters