loki日志采集

promtail采集messages日志,配置ssh登录失败次数超限告警。 # logql计算语句,统计同一ip5分钟内错误次数超过十次的IP。 sum by (ip,remote_ip) ( count_over_time( {job="ssh"} | regexp `Fai

trx trx Published on 2024-10-16

fluentd

<source> @type tail path /var/log/auth.log,/var/log/secure pos_file /var/lib/fluent/log_pos_tail_*.auth.log format json time_key time time

trx trx Published on 2024-10-14

Linux创建https证书,并配置客户端信任

创建自签名证书脚本 #!/bin/bash # 说明:用于创建证书 # 交互式读取证书信息 echo "请输入证书信息:" # 用于提示输入默认值的函数 prompt_with_default() { local prompt_message=$1 local default_

trx trx Published on 2024-09-15

windows下rclone挂载minio桶

1、下载rclone,https://downloads.rclone.org/v1.67.0/rclone-v1.67.0-windows-amd64.zip。 2、将下载的rclone解压至任意位置,我这里解压到了D:\rc\。 3、编写配置初始化powershell脚本。 # 提示输入参数 $

trx trx Published on 2024-09-04

离线安装ansible

# 下载ansible的whl包 https://github.com/ansible/ansible/releases?page=1 # 将依赖包上传至内网服务器 # 安装离线依赖包 pip install --no-index --find-links=./ ansible

trx trx Published on 2024-09-03

restic基础备份命令

基于minio 配置minio密钥: export AWS_ACCESS_KEY_ID="r8QTNLagfwLXuvUvIDfT" export AWS_SECRET_ACCESS_KEY="N079sUCscGm6GYQa3BOM3t3XkSIxCu2E7w6KcJG6" 初始化minio备份目

trx trx Published on 2024-08-31

Linux基础

Linux开机自动加载相关文件 /etc/rc.local 可以在里面添加命令,开机执行,需要有执行权限 /etc/fstab 开机时挂载磁盘,第一列挂载设备路径,第二列挂载点,第三列xfs|etx|nfs文件系统,第四列defaults挂载参数,第五列0|1是否做媒体设备检查,第六列0|1是否做数

trx trx Published on 2024-08-31

Linux命令行快捷键和vim用法

快捷键 Ctrl+a 光标快速到行首 Ctrl+e 光标快速到行尾 Ctrl+k 删除光标位置到行尾内容 Ctrl+u 删除光标位置到行首内容 Ctrl+w 按字符串删除内容 Ctrl+insert 复制所选内容 shift+insert 粘贴 Ctrl+r 搜索历史命令 vim用法 快捷键 i 进

trx trx Published on 2024-08-31

npm配置国内仓库

npm config set registry https://registry.npmmirror.com/

trx trx Published on 2024-08-30

windows配置ansible支持

开启winrm winrm quickconfig -q winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}' 放行防火墙 $

trx trx Published on 2024-08-30
Previous Next