【腾讯云日志服务CLS】linux登录日志上传
收集linux登录日志到腾讯云日志服务CLS
第一步 下载LogListener客户端
wget https://loglistener-1254077820.cos.ap-shanghai.myqcloud.com/loglistener-linux-x64-2.5.6.tar.gz && tar -zxvf loglistener-linux-x64-2.5.6.tar.gz -C /usr/local && cd /usr/local/loglistener-2.5.6/tools && ./loglistener.sh install
[root@VM-2-4-centos ~]# wget https://loglistener-1254077820.cos.ap-shanghai.myqcloud.com/loglistener-linux-x64-2.5.6.tar.gz && tar -zxvf loglistener-linux-x64-2.5.6.tar.gz -C /usr/local && cd /usr/local/loglistener-2.5.6/tools && ./loglistener.sh install
--2021-05-05 15:55:12-- https://loglistener-1254077820.cos.ap-shanghai.myqcloud.com/loglistener-linux-x64-2.5.6.tar.gz
Resolving loglistener-1254077820.cos.ap-shanghai.myqcloud.com (loglistener-1254077820.cos.ap-shanghai.myqcloud.com)... 169.254.0.47
Connecting to loglistener-1254077820.cos.ap-shanghai.myqcloud.com (loglistener-1254077820.cos.ap-shanghai.myqcloud.com)|169.254.0.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3808347 (3.6M) [application/x-gzip]
Saving to: ‘loglistener-linux-x64-2.5.6.tar.gz’
100%[===================================================================================================================================================>] 3,808,347 --.-K/s in 0.06s
2021-05-05 15:55:12 (59.4 MB/s) - ‘loglistener-linux-x64-2.5.6.tar.gz’ saved [3808347/3808347]
loglistener-2.5.6/
loglistener-2.5.6/version.txt
loglistener-2.5.6/bin/
loglistener-2.5.6/bin/loglistener
loglistener-2.5.6/bin/gethostip
loglistener-2.5.6/bin/loglisteneru
loglistener-2.5.6/bin/getmd5
loglistener-2.5.6/bin/getmac
loglistener-2.5.6/bin/check
loglistener-2.5.6/bin/loglistenerm
loglistener-2.5.6/bin/check_net
loglistener-2.5.6/bin/check_key
loglistener-2.5.6/bin/loglistener.2.5.6
loglistener-2.5.6/bin/getip
loglistener-2.5.6/update/
loglistener-2.5.6/update/update.data.temple
loglistener-2.5.6/etc/
loglistener-2.5.6/etc/loglistener.conf.temple
loglistener-2.5.6/tools/
loglistener-2.5.6/tools/loglistenerd.service
loglistener-2.5.6/tools/loglistenerd.temple
loglistener-2.5.6/tools/loglistener.sh
loglistener-2.5.6/tools/update.py
There is a historical version installed, and continuing the installation will overwrite the old version. do you want to continue?(yes/no): yes
[OK] check dependencies ok
[RESULT] install loglistener success,use './loglistener.sh init' to init loglistener's config
第二步 新建机器组
第三步 配置参数
./loglistener.sh init -secretid AK****** -secretkey SK****** -region ap-xxxxxx
[root@VM-2-4-centos tools]# ./loglistener.sh init -secretid AK****** -secretkey SK****** -region ap-shanghai -network internet -label develope
[OK] check dependencies ok
Connect to ap-shanghai.cls.tencentcs.com (211.159.226.124) ...
[OK] check network connection ok
[OK] check authentication ok
[RESULT] instance id gen success, instance id is loglistener-469aab6d-7cf9-38e6-63c7-f6802c4ae37a
[RESULT] loglistener init success, group ip is 10.4.2.4
第四步 启动LogListener客户端
/etc/init.d/loglistenerd start
[root@VM-2-4-centos tools]# /etc/init.d/loglistenerd start
[OK] loglistener is running, ip is 10.4.2.4
[OK] start loglistener success
第五步 查看机器组内客户端是否上线
[root@VM-2-4-centos tools]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.4.2.4 netmask 255.255.255.0 broadcast 10.4.2.255
inet6 fe80::5054:ff:fe37:b2a5 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:37:b2:a5 txqueuelen 1000 (Ethernet)
RX packets 56952771 bytes 4941843393 (4.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 876225 bytes 139385345 (132.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1092 bytes 73495 (71.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1092 bytes 73495 (71.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0