• 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下

    1. [root@oxidized ruby-3.1.0]# pwd
    2. /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安装目录编译安装

    1. [root@oxidized ruby-3.1.0]# ./configure
    2. [root@oxidized ruby-3.1.0]# make
    3. [root@oxidized ruby-3.1.0]# make install
    4. [root@oxidized ruby-3.1.0]# which ruby
    5. /usr/local/bin/ruby
    6. 检查ruby版本:
    7. [root@oxidized ruby-3.1.0]# ruby -v
    8. ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
    9. [root@oxidized ruby-3.1.0]# yum install rubygems -y
    10. [root@oxidized ~]# gem -v
    11. 2.0.14.1

    5、安装oxidized

    1. [root@oxidized ruby-3.1.0]# gem install oxidized
    2. 报错没有源,添加源
    3. [root@oxidized ~]# gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/
    4. Error fetching https://mirrors.tuna.tsinghua.edu.cn/rubygems/:
    5. SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://mirrors.tuna.tsinghua.edu.cn/rubygems/specs.4.8.gz)
    6. [root@oxidized ~]# gem sources -l
    7. *** CURRENT SOURCES ***
    8. [root@oxidized ~]# gem sources -a https://rubygems.org/
    9. Error fetching https://rubygems.org/:
    10. SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://rubygems.org/specs.4.8.gz)
    11. [root@oxidized ~]# gem sources -a http://rubygems.org/
    12. https://rubygems.org is recommended for security over http://rubygems.org/
    13. Do you want to add this insecure source? [yn] y
    14. Error fetching http://rubygems.org/:
    15. server did not return a valid file (http://rubygems.org/specs.4.8.gz)

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

    解决方法:

    1. 找到.gemrc文件,添加源
    2. [root@oxidized ~]# find /* -name '*gemrc*'
    3. /root/.config/gem/gemrc
    4. /root/.gemrc
    5. [root@oxidized ~]# vim /root/.gemrc
    6. ---
    7. :backtrace: false
    8. :bulk_threshold: 1000
    9. :sources:
    10. - http://mirrors.tuna.tsinghua.edu.cn/rubygems/
    11. :update_sources: true
    12. :verbose: true
    13. 保存退出,再次查看就能看到添加上了
    14. [root@oxidized ~]# gem sources
    15. *** CURRENT SOURCES ***
    16. 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. 1、移除老版本,并下载依赖
    2. [root@oxidized cmake-3.7.2]# yum remove cmake -y ; yum install -y gcc gcc-c++ make automake openssl openssl-devel
    3. 2、下载安装包并解压
    4. [root@oxidized cmake-3.7.2]# wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz ; tar -zxf cmake*.tar.gz
    5. 3、编译、安装
    6. [root@oxidized cmake-3.7.2]# cd cmake* ; ./bootstrap ; gmake -j `grep 'processor' /proc/cpuinfo | wc -l` ; gmake install
    7. 4、查看编译后的cmake版本并创建连接,最后查看cmake版本
    8. [root@oxidized cmake-3.7.2]# /usr/local/bin/cmake --version
    9. [root@oxidized cmake-3.7.2]# ln -s /usr/local/bin/cmake /usr/bin/
    10. [root@oxidized cmake-3.7.2]# cmake --version
    11. cmake version 3.7.2
    12. CMake suite maintained and supported by Kitware (kitware.com/cmake).

    再次执行安装oxidized

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

    OK了~!

    1. [root@oxidized cmake-3.7.2]# oxidized
    2. edit ~/.config/oxidized/config
    3. 查看默认配置文件
    4. [root@oxidized cmake-3.7.2]# cat ~/.config/oxidized/config
    5. ---
    6. username: username
    7. password: password
    8. model: junos
    9. resolve_dns: true
    10. interval: 3600
    11. use_syslog: false
    12. debug: false
    13. threads: 30
    14. use_max_threads: false
    15. timeout: 20
    16. retries: 3
    17. prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
    18. rest: 127.0.0.1:8888
    19. next_adds_job: false
    20. vars: {}
    21. groups: {}
    22. group_map: {}
    23. models: {}
    24. pid: "/root/.config/oxidized/pid"
    25. crash:
    26. directory: "/root/.config/oxidized/crashes"
    27. hostnames: false
    28. stats:
    29. history_size: 10
    30. input:
    31. default: ssh, telnet
    32. debug: false
    33. ssh:
    34. secure: false
    35. ftp:
    36. passive: true
    37. utf8_encoded: true
    38. output:
    39. default: file
    40. source:
    41. default: csv
    42. model_map:
    43. juniper: junos
    44. cisco: ios

    oxidized详细使用见:https://blog.csdn.net/weixin_44147924/article/details/134185835?spm=1001.2014.3001.5501

  • 相关阅读:
    1.6 计算机网络的性能
    Java中System.getProperty()方法具有什么功能呢?
    基础springboot扫描讲解
    CRM系统如何帮助企业数字化转型?分为几个阶段?
    软考考后常见问题详解~
    Sfdp 超级表单开发平台 V6.0.5 正式发布
    微机原理与技术接口 实验五 基本IO操作温度控制实验
    python-基础(4)-list
    passorder函数下单买卖
    liunx 安装达梦数据库
  • 原文地址:https://blog.csdn.net/weixin_44147924/article/details/134161004