centos7安装oxidized备份软件

首先需要提前下载ruby,因为默认yum安装的版本太低

https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz

1、yum remove ruby ruby-devel(有就卸载,没有则忽略)

2、将下载好的ruby包解压到/opt下

复制代码
[root@oxidized ruby-3.1.0]# pwd
/opt/ruby-3.1.0

3、安装依赖

复制代码
[root@oxidized ruby-3.1.0] yum install make cmake which sqlite-devel openssl-devel libssh2-devel  gcc  libicu-devel gcc-c++  -y

4、进入ruby安装目录编译安装

复制代码
[root@oxidized ruby-3.1.0]# ./configure
[root@oxidized ruby-3.1.0]# make
[root@oxidized ruby-3.1.0]# make install
[root@oxidized ruby-3.1.0]# which ruby
/usr/local/bin/ruby
检查ruby版本:
[root@oxidized ruby-3.1.0]# ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
[root@oxidized ruby-3.1.0]# yum install rubygems -y
[root@oxidized ~]# gem -v
2.0.14.1

5、安装oxidized

复制代码
[root@oxidized ruby-3.1.0]# gem install oxidized
报错没有源,添加源
[root@oxidized ~]# gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/
Error fetching https://mirrors.tuna.tsinghua.edu.cn/rubygems/:
        SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://mirrors.tuna.tsinghua.edu.cn/rubygems/specs.4.8.gz)
[root@oxidized ~]# gem sources -l
*** CURRENT SOURCES ***

[root@oxidized ~]# gem sources -a https://rubygems.org/
Error fetching https://rubygems.org/:
        SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://rubygems.org/specs.4.8.gz)
[root@oxidized ~]# gem sources -a http://rubygems.org/
https://rubygems.org is recommended for security over http://rubygems.org/

Do you want to add this insecure source? [yn]  y
Error fetching http://rubygems.org/:
        server did not return a valid file (http://rubygems.org/specs.4.8.gz)

试了几种源都是不行的(部署时环境的网络有问题,后来切换了网段就好了)

解决方法:

复制代码
找到.gemrc文件,添加源
[root@oxidized ~]# find /* -name '*gemrc*'
/root/.config/gem/gemrc
/root/.gemrc

[root@oxidized ~]# vim /root/.gemrc
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://mirrors.tuna.tsinghua.edu.cn/rubygems/
:update_sources: true
:verbose: true
保存退出,再次查看就能看到添加上了
[root@oxidized ~]# gem sources
*** CURRENT SOURCES ***

http://mirrors.tuna.tsinghua.edu.cn/rubygems/

再次尝试安装,报错:

CMake 3.5.1 or higher is required. You are running version 2.8.12.2

6、升级cmake

复制代码
1、移除老版本,并下载依赖
[root@oxidized cmake-3.7.2]#  yum remove cmake -y ; yum install -y gcc gcc-c++ make automake openssl openssl-devel
2、下载安装包并解压
[root@oxidized cmake-3.7.2]# wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz ; tar -zxf cmake*.tar.gz
3、编译、安装
[root@oxidized cmake-3.7.2]# cd cmake* ; ./bootstrap ; gmake -j `grep 'processor' /proc/cpuinfo | wc -l` ; gmake install
4、查看编译后的cmake版本并创建连接,最后查看cmake版本
[root@oxidized cmake-3.7.2]# /usr/local/bin/cmake --version
[root@oxidized cmake-3.7.2]# ln -s /usr/local/bin/cmake /usr/bin/
[root@oxidized cmake-3.7.2]# cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

再次执行安装oxidized

成功了,再安装oxidized-script,oxidized-web

OK了~!

复制代码
[root@oxidized cmake-3.7.2]# oxidized
edit ~/.config/oxidized/config
查看默认配置文件
[root@oxidized cmake-3.7.2]# cat ~/.config/oxidized/config
---
username: username
password: password
model: junos
resolve_dns: true
interval: 3600
use_syslog: false
debug: false
threads: 30
use_max_threads: false
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
next_adds_job: false
vars: {}
groups: {}
group_map: {}
models: {}
pid: "/root/.config/oxidized/pid"
crash:
  directory: "/root/.config/oxidized/crashes"
  hostnames: false
stats:
  history_size: 10
input:
  default: ssh, telnet
  debug: false
  ssh:
    secure: false
  ftp:
    passive: true
  utf8_encoded: true
output:
  default: file
source:
  default: csv
model_map:
  juniper: junos
  cisco: ios
相关推荐
想唱rap5 分钟前
UDP套接字编程
服务器·网络·c++·网络协议·ubuntu·udp
AC赳赳老秦14 分钟前
OpenClaw多平台部署:Windows+Linux跨系统协同,实现全场景覆盖
linux·服务器·前端·网络·windows·deepseek·openclaw
念恒1230617 分钟前
进程--程序地址空间下篇(进程地址空间)
linux·c语言
___波子 Pro Max.25 分钟前
Linux 外挂 SSD 根目录下的 `.Trash-1000` 到底是什么
linux
爱学习的小囧1 小时前
VMware vCenter Server 9.0.2.0 资源详解+完整部署教程+下载指南+常见问题
运维·服务器·esxi·vmware·虚拟化·esxi9.0.2.0
IpdataCloud1 小时前
游戏服务器选择,为何绕不开IP地址查询?
服务器·tcp/ip·游戏
贾斯汀玛尔斯1 小时前
每天学一个算法--单调栈(Monotonic Stack)
运维·服务器·算法
hhb_6181 小时前
Linux底层运维自动化挂载与磁盘分区实战指南
linux·运维·自动化
SpikeKing1 小时前
Server - 配置 SQLBot 智能问数项目
运维·server·sqlbot
爱学习的小囧2 小时前
ESXi 开启 Secure Boot 后驱动签名验证失败完整处置教程:合规修复与临时测试方案全解
服务器·数据库·esxi·虚拟化