Last active
August 29, 2015 14:22
-
-
Save neilhwatson/6f9d2f514d9ff64cb4e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body common control | |
{ | |
bundlesequence => { | |
"main", | |
}; | |
} | |
bundle agent main | |
{ | |
methods: | |
"any" usebundle => fwports; | |
"any" usebundle => test; | |
} | |
bundle agent fwports | |
{ | |
vars: | |
"tcp" data => parsejson( ' | |
{ | |
"inbound" : | |
{ | |
"ssh" : 22, | |
"smtp" : 25, | |
"ntp" : 123 | |
}, | |
"outbound" : | |
{ | |
"ssh" : 22, | |
"http" : 80, | |
"https" : 443 | |
} | |
} | |
'); | |
} | |
bundle agent test | |
{ | |
vars: | |
"i" slist => getindices( "fwports.tcp[inbound]" ); | |
reports: | |
"inbound_tcp port [${fwports.tcp[inbound][${i}]}] for [${i}]"; | |
} | |
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./fwports.cf | |
R: inbound_tcp port [22] for [ssh] | |
R: inbound_tcp port [25] for [smtp] | |
R: inbound_tcp port [123] for [ntp] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment