參考鏈接:https://github.com/ytti/oxidized
測試環境:CentOS Linux release 7.3.1611 (Core)
主要組件:oxidized oxidized-script oxidized-web
注意:oxidized-web需要ruby2.3以上支持,如不安裝oxidized-web,配置文件里rest 修改為false
創新互聯為企業級客戶提高一站式互聯網+設計服務,主要包括成都網站設計、網站建設、成都app軟件開發、重慶小程序開發、宣傳片制作、LOGO設計等,幫助客戶快速提升營銷能力和企業形象,創新互聯各部門都有經驗豐富的經驗,可以確保每一個作品的質量和創作周期,同時每年都有很多新員工加入,為我們帶來大量新的創意。
centos7默認ruby為2.0版本,需要單獨安裝。
yum install centos-release-scl
yum-config-manager --enable rhel-server-rhscl-7-rpms
yum install -y rh-ruby25-ruby-devel
yum install rh-ruby25
scl enable rh-ruby25 bash
ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
cp /opt/rh/rh-ruby25/root/usr/lib64/libruby.so.2.5 /usr/lib/
設置登錄時自動啟動ruby2.5:
vim /etc/profile.d/rh-ruby25.sh
#!/bin/bash
source /opt/rh/rh-ruby25/enable
export X_SCLS="scl enable rh-ruby25 'echo $X_SCLS'
"
export PATH=$PATH:/opt/rh/rh-ruby25/root/usr/local/bin
gem install oxidized
gem install oxidized-script oxidized-web
useradd -m -d /home/oxidized oxidized
cp /opt/rh/rh-ruby25/root/usr/local/share/gems/gems/oxidized-0.24.0/extra/oxidized.service /lib/systemd/system
mkdir -p /home/oxidized/.config/oxidized
mkdir /home/oxidized/.config/oxidized/logs/
mkdir /home/oxidized/.config/oxidized/configs
chown oxidized:oxidized /home/oxidized/.config/oxidized
username: username
password: password
model: junos
interval: 3600
log: /home/oxidized/.config/oxidized/logs/oxidized.log
debug: false
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
next_adds_job: false
vars: {}
groups: {}
models: {}
pid: "/home/oxidized/.config/oxidized/pid"
input:
default: ssh, telnet
debug: false
ssh:
secure: false
output:
default: file
file:
directory: "/home/oxidized/.config/oxidized/configs"
source:
default: csv
csv:
file: "/home/oxidized/.config/oxidized/router.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
username: 2
password: 3
gpg: false
model_map:
cisco: ios
juniper: junos
vim home/oxidized/.config/oxidized/router.db
172.18.31.11:comware:user:passwd
systemctl restart oxidized.service
systemctl status oxidized.service
至此,自動備份基礎功能已完成,可在目錄里查看備份的配置文件,接下來配置可用web頁面查看比較直觀。
yum install nginx
vim /etc/nginx/conf.d/oxidized.conf
cat /etc/nginx/conf.d/oxidized.conf
server {
listen 80;
server_name 172.18.34.45;
location / {
proxy_pass http://127.0.0.1:8888/;
}
access_log /var/log/nginx/access_oxidized.log;
error_log /var/log/nginx/error_oxidized.log;
}
systemctl restart nginx.service
yum -y install git
yum install libgit2
git config user.name Oxidized
git config user.email “o@example.com”
systemctl restart oxidized.service
systemctl status oxidized.service
通過區域按鈕可查看每個版本配置差異。
文章標題:網絡設備自動備份
文章位置:http://m.newbst.com/article26/jeigcg.html
成都網站建設公司_創新互聯,為您提供網站排名、移動網站建設、網站策劃、用戶體驗、標簽優化、網頁設計公司
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯