我有nagios/icinga对象文件,下面有类似的内容,但是很多。如何提取类似的对象,例如,仅使用bash或python提取“主机对象”或“服务对象”。
define host{ ## extract including the "define host {....}"
use generic-switch
host_name bras ;
alias bras-gw.example.com;
address 20.94.66.88
hostgro
我试图实现一个循环与条件,但还没有运气。如果主机名为A,则在命令中添加1.1.1.1.1IP地址,如果设备主机名为B,则添加2.2.2.2IP地址。
你能帮帮我吗。
- name: logs
ios_command:
commands:
- show ip bgp vpnv4 vrf SIG neighbors {{item.ip}} routes
- show ip bgp vpnv4 vrf SIG neighbors {{item.ip}} advertised-routes
我有一个k3s集群运行,我有过去12个小时试图找出为什么我不能从一个简单的nginx荚.
我在BGP中使用FRR设置了metalLB,这是BGP的输出:
BGP table version is 1, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 64501
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-fai