Cov txheej txheem:

Yuav Ua Li Cas Thiaj Li Siv Cov Khoom Siv Hluav Taws Xob Foundry: 8 Kauj Ruam
Yuav Ua Li Cas Thiaj Li Siv Cov Khoom Siv Hluav Taws Xob Foundry: 8 Kauj Ruam

Video: Yuav Ua Li Cas Thiaj Li Siv Cov Khoom Siv Hluav Taws Xob Foundry: 8 Kauj Ruam

Video: Yuav Ua Li Cas Thiaj Li Siv Cov Khoom Siv Hluav Taws Xob Foundry: 8 Kauj Ruam
Video: Qhias siv lub ntsuas ໄຟຟ້າ Los yog hluav taws xob 2024, Hlis ntuj nqeg
Anonim
Yuav ua li cas thaub qab Cov Khoom Siv Hluav Taws Xob Foundry
Yuav ua li cas thaub qab Cov Khoom Siv Hluav Taws Xob Foundry

Cov lus qhia no yuav qhia ib tsab ntawv uas tuaj yeem siv los kho qhov thaub qab ntawm cov khoom siv sib txuas hloov pauv/router/firewall.

Kauj ruam 1: Yuav tsum tau ua

Yuav tsum muaj
Yuav tsum muaj

Tsab ntawv no siv kev cia siab rau kev siv cov thaub qab thiab ua haujlwm ntawm cov kab ke linux. Yog tias koj tsis tau txheeb xyuas qhov xav tau, Oreilly muaj phau ntawv zoo "Tshawb Nrhiav Kev Cia Siab"

Kauj ruam 2: Variables

Ntau yam
Ntau yam

Teeb tsa qee qhov hloov pauv. Koj yuav tsum hloov tus username, password, foundry thiab hloov pauv sai. #!. mnt/netapp/thaub qab/foundry.foo.bar.com "teeb tsa log" [timestamp -format%Y-%m-%d] -config.txt "teeb mailto" [email protected] "teeb mailsubject" Yuam kev: foundry backup ua tsis tiav [timestamp -format%Y-%m-%d] "teeb tsa mailfail" "teeb tsa tam sim ntawd" telnet@FLS648"

Kauj ruam 3: Txuas

Txuas
Txuas

Ib feem ntawm tsab ntawv no sim txuas rau lub foundry.send_user "Foundry Backup Script / n" send_user "Txuas rau $ foundry / n" spawn telnet $ foundry cia siab tias {"Lo lus zais:" {xa "$ password / r" cia siab tias {" $ sai "{xa_user" Txuas "}" ua tsis tau "{xa_user" password tsis raug, tawm "teeb mailfail" password tsis raug, tawm "kaw" timeout {send_user "Tsis teb tam sim" teeb mailfail "Tsis teb sai" kaw}}} " Tsis muaj txoj hauv kev los tuav "{xa_user" Tsis tuaj yeem txuas rau $ foundry / n "teeb tsa mailfail" Tsis tuaj yeem txuas rau $ foundry / n "}" Lub npe lossis kev pabcuam tsis paub "{send_user" Tsis tuaj yeem txuas rau $ foundry / n "teeb tsa mailfail "Tsis tuaj yeem txuas rau $ foundry / n"} timeout {send_user "Timeout txuas rau $ foundry" teeb tsa mailfail "Timeout txuas rau $ foundry" kaw}} yog {$ mailfail! = ""} {exec /bin /mail - s $ mailsubject $ mailto << "$ mailfail" tawm}

Kauj Ruam 4: Xiam Paging

Lov tes taw Paging
Lov tes taw Paging

Lov tes taw "ntau dua" kom peb tuaj yeem rub tawm qhov teeb tsa. xa "pab / r" cia siab tias {"$ prompt Hloov#" {xa_user "Enabled"} default {send_user "Pab kom ua tsis tau" teeb tsa mailfail "ScreenOS tsis suav nrog kev xaiv paging." kaw}} yog {$ mailfail! = ""} {exec /bin /mail -s $ mailsubject $ mailto << "$ mailfail" exit} xa "hla-nplooj ntawv-tso saib / r" cia siab tias {"Lov tes taw nplooj ntawv hom* $ prompt "{send_user" / nPaging Disabled / n "} default {xa" ScreenOS tsis suav nrog kev xaiv paging. / n "teeb tsa mailfail" ScreenOS tsis suav nrog kev xaiv paging. " kaw} timeout {send_user "ScreenOS tsis suav nrog kev xaiv paging / n" teeb tsa mailfail "ScreenOS tsis suav nrog kev xaiv paging." kaw}} yog {$ mailfail! = ""} {exec /bin /mail -s $ mailsubject $ mailto << "$ mailfail" exit}

Kauj ruam 5: Tau Config

Tau Config
Tau Config

Ib feem ntawm tsab ntawv tau txais kev teeb tsa. send_user "Downloading Configuration / n" log_file $ basedir/$ logsend "qhia khiav / r" cia siab tias {"$ prompt" {log_file send_user "\ nConfiguration Downloaded / n"} timeout {send_user "\ nError thaum lub sijhawm teeb tsa rub tawm." teeb mailfail "Yuam kev thaum teeb tsa rub tawm." }} closeif {$ mailfail! = ""} {exec /bin /mail -s $ mailsubject $ mailto << "$ mailfail" tawm}

Kauj Ruam 6: Txheeb Cov Ntaub Ntawv Loj

Txheeb Cov Ntaub Ntawv Loj
Txheeb Cov Ntaub Ntawv Loj

Txheeb xyuas cov ntaub ntawv. teeb fileize [cov ntawv loj $ basedir /$ log] yog {$ filesize <= 512} {send_user "Netscreen teeb tsa me me dhau, thov tshawb xyuas / n" teeb tsa mailfail "Netscreen teeb tsa me me, thov tshawb xyuas / n" exec /bin /mail -s $ mailsubject $ mailto << "$ mailfail" tawm}

Kauj ruam 7: Ntxuav

Ntxuav
Ntxuav

Ntxuav qhov teeb tsa laus dua ob lub lis piam.#Tshem tawm teeb tsa laus dua 2 lub lis piamsexec nrhiav $ basedir -name '*config.txt*' -mtime +14

Kauj Ruam 8: Muab tag nrho ua ke

Muab tso ua ke. Tsab ntawv txuas nrog, nws yuav email rau kev ua tsis tiav.

Pom zoo: