SUSE 11SP3安装osquery及zabbix-agent

3 篇文章 0 订阅
3 篇文章 0 订阅

1.升级系统依赖库的libc:

wget http://ftp.gnu.org/gnu/glibc/glibc-2.12.1.tar.gz
wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.12.1.tar.gz
 
tar -xvf  glibc-2.12.1.tar.gz
 
tar -xvf  glibc-ports-2.12.1.tar.gz
 
mv glibc-ports-2.15 glibc-2.12.1/ports

mkdir glibc-build-2.12.1 
 
cd glibc-build-2.12.1
 
 
../glibc-2.12.1/configure  --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
 
make
make install

2.下载osqurey安装包

https://osquery-packages.s3.amazonaws.com/linux/osquery-3.2.4_1.linux_x86_64.tar.gz

3.解压并测试:

 mkdir osquery
 tar -zxvf osquery-3.2.4_1.linux_x86_64.tar.gz -C osquery/
 cd osquery/
 # ./osqueryi -json "SELECT * FROM routes"
[
  {"destination":"0.0.0.0","flags":"0","gateway":"192.168.100.1","interface":"eth0","metric":"0","mtu":"0","netmask":"0","source":"","type":"gateway"},
  {"destination":"127.0.0.0","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"8","source":"","type":"gateway"},
  {"destination":"169.254.0.0","flags":"0","gateway":"","interface":"eth0","metric":"0","mtu":"0","netmask":"16","source":"","type":"gateway"},
  {"destination":"192.168.100.0","flags":"0","gateway":"","interface":"eth0","metric":"0","mtu":"0","netmask":"24","source":"192.168.100.5","type":"gateway"},
  {"destination":"127.0.0.0","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"127.0.0.1","type":"broadcast"},
  {"destination":"127.0.0.0","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"8","source":"127.0.0.1","type":"local"},
  {"destination":"127.0.0.1","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"127.0.0.1","type":"local"},
  {"destination":"127.0.0.2","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"127.0.0.1","type":"local"},
  {"destination":"127.255.255.255","flags":"0","gateway":"","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"127.0.0.1","type":"broadcast"},
  {"destination":"192.168.100.0","flags":"0","gateway":"","interface":"eth0","metric":"0","mtu":"0","netmask":"0","source":"192.168.100.5","type":"broadcast"},
  {"destination":"192.168.100.5","flags":"0","gateway":"","interface":"eth0","metric":"0","mtu":"0","netmask":"0","source":"192.168.100.5","type":"local"},
  {"destination":"192.168.100.255","flags":"0","gateway":"","interface":"eth0","metric":"0","mtu":"0","netmask":"0","source":"192.168.100.5","type":"broadcast"},
  {"destination":"fe80::","flags":"0","gateway":"","interface":"eth0","metric":"256","mtu":"0","netmask":"64","source":"","type":"gateway"},
  {"destination":"0.0.0.0","flags":"0","gateway":"","interface":"lo","metric":"-1","mtu":"0","netmask":"0","source":"","type":"other"},
  {"destination":"::1","flags":"0","gateway":"::","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"","type":"local"},
  {"destination":"fe80::20c:29ff:fe46:50ac","flags":"0","gateway":"::","interface":"lo","metric":"0","mtu":"0","netmask":"0","source":"","type":"local"},
  {"destination":"ff00::","flags":"0","gateway":"","interface":"eth0","metric":"256","mtu":"0","netmask":"8","source":"","type":"gateway"},
  {"destination":"0.0.0.0","flags":"0","gateway":"","interface":"lo","metric":"-1","mtu":"0","netmask":"0","source":"","type":"other"}
]
linux-6ue1:/home/osquery/usr/bin # 

3.安装zabbix-agent

zypper addrepo http://download.opensuse.org/repositories/server:/monitoring/SLE_11_SP3/ server_monitoring
zypper update
zypper install zabbix-agent

修改zabbix-agent配置文件

vim /etc/zabbix/zabbix-agentd.conf
Server=192.168.100.2
ServerActive=192.168.100.2

启动并测试:

 # service zabbix-agentd start
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chkconfig zabbix-agentd on
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Starting zabbix agentd job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
                                                                                                                                        done
开机启动:

chkconfig zabbix-agentd on

测试:

# zabbix_get -s 192.168.100.5 -k system.swap.size[,free]
2153766912
# zabbix_get -s 192.168.100.5 -k proc.num[]
186
# zabbix_get -s 192.168.100.5 -k vm.memory.size[available]
1726746624

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值