semvec/pypi-packages huggingface dataset:
InfluxAlert 0.1.2
influx alert

# InfluxAlert
## 概览
以非常少的代码实现 InfluxDB 的告警
## 快速开始
### 前置需求
需要有 InfluxDB、MongoDB
### 安装模块
```bash
pip3 install InfluxAlert
```
### 运行
```python
#!/usr/bin/env python3

import subprocess

from apscheduler.schedulers.blocking import BlockingScheduler
from nb_log import get_logger
from influx_alert.client import Client


influx = Client(influx_host='xx',
                influx_port='8086',
                influx_database='xx',
                influx_username='xx',
                influx_password='xxx',
                influx_ssl=True,
                mongo_host='xxx',
                mongo_port=27017,
                mongo_username='xxx',
                mongo_password='xxx',
                mongo_database='xxx',
                mongo_authsource='admin',
                feishu_app_id='xxx',
                feishu_app_secret='xxx',
                feishu_card_template_id='xxx',
                feishu_card_receive_id='xxx',
                wecom_webhook_url='xxx')

# 任务函数
def alert():
    '''
    任务函数
    '''
    influx.ping.unreachable()
    influx.no_data.node_exporter()
    influx.no_data.windows_exporter()
    log.debug('run 1 time')

# 创建调度器
scheduler = BlockingScheduler()

scheduler.add_job(alert, 'interval', seconds=60, max_instances=1)

# 启动调度器
scheduler.start()
```

## 功能支持
### 通知工具
- 飞书消息卡片（支持）
- 企业微信 Markdown（支持）
### 告警
支持以下告警
- Ping 不可达
- Node Exporter 无数据时告警
- Windows Exporter 无数据时告警
sequenceDiagram 0.0.3
library to generate seqeuence diagram for python code
Requires Python: >=3

# Sequence Diagram Generator for Python

## Overview

This Python library generates sequence diagrams for your Python code using the Mermaid.js format. It allows you to visualize the interactions between various parts of your code, aiding in better understanding and documentation. 

## Features

- **Mermaid.js Integration**: Utilizes Mermaid.js for generating sequence diagrams.
- **HTML Generation**: Generates an HTML file containing the sequence diagram.
- **Function Decoration**: Decorate functions/methods with `@sequenceDiagram` to include them in the sequence diagram.

## Installation

To install the library, you can use pip:

```bash
pip install sequenceDiagram
```

## Usage

### Importing the Library

```python
from sequenceDiagram import sequenceDiagram, writehtml
```

### Decorating Functions

Use the `@sequenceDiagram` decorator to mark the functions you want to include in the sequence diagram.

```python
@sequenceDiagram
def function_a():
    print("Function A")

@sequenceDiagram
def function_b():
    function_a()
    print("Function B")
```

### Generating the HTML

After decorating the desired functions, use the `writehtml` function to generate the HTML file with the sequence diagram.

```python
html_path = "path/to/sequence_diagram.html"
writehtml(html_path)
```

### Example

Here's a complete example:

```python
from sequenceDiagram import sequenceDiagram, writehtml

@sequenceDiagram
def function_a():
    print("Function A")

@sequenceDiagram
def function_b():
    function_a()
    print("Function B")

@sequenceDiagram
def main():
    function_b()
    print("Main Function")

if __name__ == "__main__":
    main()
    writehtml("sequence_diagram.html")
```

This will generate an HTML file named `sequence_diagram.html` in the specified path, containing the sequence diagram of the interactions between `main`, `function_b`, and `function_a`.


## Contact

For any questions or issues, please open an issue on the GitHub repository or connect with me at brijesh.kulkarni@gmail.com

---
rsyslog-client-assistant 0.1.4
Generate client-side configuration for rsyslog
Requires Python: >=3.6

# Rsyslog Configuration Generator

This Python application generates client-side configuration for rsyslog using RainerScript. The configuration includes defining a ruleset and applying it to monitor log files.

## Overview

This application provides two main functions:

1. **`client_ruleset_config`**: Generates an rsyslog RainerScript configuration string to define a ruleset with disk queue settings.
2. **`apply_ruleset_client`**: Generates an rsyslog RainerScript configuration string to apply a previously defined ruleset to monitor a log file using the imfile module.

## Prerequisites

- Python 3.x
- Basic understanding of rsyslog and RainerScript

## Functions

### `client_ruleset_config(rule_name, server_ip, port, protocol)`

### `apply_ruleset_client(log_file, tag, facility, severity, rule_name)`

Generates a RainerScript configuration string to define a ruleset and apply the rule.

**Arguments:**

- `rule_name` (str): Name of the ruleset.
- `server_ip` (str): IP address or hostname of the rsyslog server.
- `port` (int): Port number to send logs to.
- `protocol` (str): Protocol to use ('tcp' or 'udp').
- `log_file` (str): Log file name where the rule should be applicable.
- `tag` (str): tag of the log events.
- `facility` (str): Facilities of the log events('local0' to 'local6', 'authpriv','mail' etc.).
- `severity` (str): Log criticality('info','warn','crit' etc.).

**Returns:**

- `str`: RainerScript configuration string defining the ruleset.

**Examples:**

```python
config = client_ruleset_config("myRuleset", "192.168.1.100", 514, "tcp")
print(config)
```

```python
apply = apply_ruleset_client("/var/log/message", "message_log", "local3", "info", "myRuleset")
print(apply)
```