195 | | defApplication('ping_app', 'pingmonitor') do |a| |
196 | | a.path = "/root/pingWrap.rb" |
197 | | a.version(1, 2, 0) |
198 | | a.shortDescription = "Wrapper around ping" |
199 | | a.description = "ping application" |
200 | | a.defProperty('dest_addr', 'Address to ping', '-a', {:type => :string, :dynamic => false}) |
201 | | a.defProperty('count', 'Number of times to ping', '-c', {:type => :integer, :dynamic => false}) |
202 | | a.defProperty('interval', 'Interval between pings in s', '-i', {:type => :integer, :dynamic => false}) |
203 | | |
204 | | a.defMeasurement('myping') do |m| |
205 | | m.defMetric('dest_addr',:string) |
206 | | m.defMetric('ttl',:int) |
207 | | m.defMetric('rtt',:float) |
208 | | m.defMetric('rtt_unit',:string) |
209 | | end |
210 | | end |
211 | | |
212 | | defGroup('Source1', property.source1) do |node| |
213 | | node.addApplication("ping_app") do |app| |
214 | | app.setProperty('dest_addr', property.sinkaddr11) |
215 | | app.setProperty('count', 30) |
216 | | app.setProperty('interval', 1) |
217 | | app.measure('myping', :samples => 1) |
218 | | end |
219 | | |
220 | | node.addApplication("ping_app") do |app| |
221 | | app.setProperty('dest_addr', property.sinkaddr12) |
222 | | app.setProperty('count', 30) |
223 | | app.setProperty('interval', 1) |
224 | | app.measure('myping', :samples => 1) |
225 | | end |
226 | | end |
227 | | |
228 | | defGroup('Source2', property.source2) do |node| |
229 | | node.addApplication("ping_app") do |app| |
230 | | app.setProperty('dest_addr', property.sinkaddr21) |
231 | | app.setProperty('count', 30) |
232 | | app.setProperty('interval', 1) |
233 | | app.measure('myping', :samples => 1) |
234 | | end |
235 | | |
236 | | node.addApplication("ping_app") do |app| |
237 | | app.setProperty('dest_addr', property.sinkaddr22) |
238 | | app.setProperty('count', 30) |
239 | | app.setProperty('interval', 1) |
240 | | app.measure('myping', :samples => 1) |
241 | | end |
242 | | |
243 | | node.addApplication("ping_app") do |app| |
244 | | app.setProperty('dest_addr', property.sinkaddr23) |
245 | | app.setProperty('count', 30) |
246 | | app.setProperty('interval', 1) |
247 | | app.measure('myping', :samples => 1) |
248 | | end |
249 | | end |
250 | | |
251 | | defGroup('Source3', property.source3) do |node| |
252 | | node.addApplication("ping_app") do |app| |
253 | | app.setProperty('dest_addr', property.sinkaddr31) |
254 | | app.setProperty('count', 30) |
255 | | app.setProperty('interval', 1) |
256 | | app.measure('myping', :samples => 1) |
257 | | end |
258 | | |
259 | | node.addApplication("ping_app") do |app| |
260 | | app.setProperty('dest_addr', property.sinkaddr32) |
261 | | app.setProperty('count', 30) |
262 | | app.setProperty('interval', 1) |
263 | | app.measure('myping', :samples => 1) |
264 | | end |
265 | | |
266 | | node.addApplication("ping_app") do |app| |
267 | | app.setProperty('dest_addr', property.sinkaddr33) |
268 | | app.setProperty('count', 30) |
269 | | app.setProperty('interval', 1) |
270 | | app.measure('myping', :samples => 1) |
271 | | end |
272 | | |
273 | | node.addApplication("ping_app") do |app| |
274 | | app.setProperty('dest_addr', property.sinkaddr34) |
275 | | app.setProperty('count', 30) |
276 | | app.setProperty('interval', 1) |
277 | | app.measure('myping', :samples => 1) |
278 | | end |
279 | | end |
280 | | |
281 | | defGroup('Source4', property.source4) do |node| |
282 | | |
283 | | node.addApplication("ping_app") do |app| |
284 | | app.setProperty('dest_addr', property.sinkaddr41) |
285 | | app.setProperty('count', 30) |
286 | | app.setProperty('interval', 1) |
287 | | app.measure('myping', :samples => 1) |
288 | | end |
289 | | |
290 | | node.addApplication("ping_app") do |app| |
291 | | app.setProperty('dest_addr', property.sinkaddr42) |
292 | | app.setProperty('count', 30) |
293 | | app.setProperty('interval', 1) |
294 | | app.measure('myping', :samples => 1) |
295 | | end |
296 | | end |
297 | | |
298 | | defGroup('Source5', property.source5) do |node| |
299 | | node.addApplication("ping_app") do |app| |
300 | | app.setProperty('dest_addr', property.sinkaddr51) |
301 | | app.setProperty('count', 30) |
302 | | app.setProperty('interval', 1) |
303 | | app.measure('myping', :samples => 1) |
| 191 | defApplication('ping') do |app| |
| 192 | app.description = 'Simple Definition for the ping-oml2 application' |
| 193 | # Define the path to the binary executable for this application |
| 194 | app.binary_path = '/usr/local/bin/ping-oml2' |
| 195 | # Define the configurable parameters for this application |
| 196 | # For example if target is set to foo.com and count is set to 2, then the |
| 197 | # application will be started with the command line: |
| 198 | # /usr/bin/ping-oml2 -a foo.com -c 2 |
| 199 | app.defProperty('target', 'Address to ping', '-a', {:type => :string}) |
| 200 | app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer}) |
| 201 | # Define the OML2 measurement point that this application provides. |
| 202 | # Here we have only one measurement point (MP) named 'ping'. Each measurement |
| 203 | # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit) |
| 204 | app.defMeasurement('ping') do |m| |
| 205 | m.defMetric('dest_addr',:string) |
| 206 | m.defMetric('ttl',:uint32) |
| 207 | m.defMetric('rtt',:double) |
| 208 | m.defMetric('rtt_unit',:string) |
| 209 | end |
| 210 | end |
| 211 | |
| 212 | defGroup('Source1', property.resource1) do |node| |
| 213 | node.addApplication("ping") do |app| |
| 214 | app.setProperty('target', property.sinkaddr11) |
| 215 | app.setProperty('count', 30) |
| 216 | app.measure('ping', :samples => 1) |
| 217 | end |
| 218 | |
| 219 | node.addApplication("ping") do |app| |
| 220 | app.setProperty('target', property.sinkaddr12) |
| 221 | app.setProperty('count', 30) |
| 222 | app.measure('ping', :samples => 1) |
| 223 | end |
| 224 | end |
| 225 | |
| 226 | defGroup('Source2', property.resource2) do |node| |
| 227 | node.addApplication("ping") do |app| |
| 228 | app.setProperty('target', property.sinkaddr21) |
| 229 | app.setProperty('count', 30) |
| 230 | app.measure('ping', :samples => 1) |
| 231 | end |
| 232 | |
| 233 | node.addApplication("ping") do |app| |
| 234 | app.setProperty('target', property.sinkaddr22) |
| 235 | app.setProperty('count', 30) |
| 236 | app.measure('ping', :samples => 1) |
| 237 | end |
| 238 | |
| 239 | node.addApplication("ping") do |app| |
| 240 | app.setProperty('target', property.sinkaddr23) |
| 241 | app.setProperty('count', 30) |
| 242 | app.measure('ping', :samples => 1) |
| 243 | end |
| 244 | end |
| 245 | |
| 246 | defGroup('Source3', property.resource3) do |node| |
| 247 | node.addApplication("ping") do |app| |
| 248 | app.setProperty('target', property.sinkaddr31) |
| 249 | app.setProperty('count', 30) |
| 250 | app.measure('ping', :samples => 1) |
| 251 | end |
| 252 | |
| 253 | node.addApplication("ping") do |app| |
| 254 | app.setProperty('target', property.sinkaddr32) |
| 255 | app.setProperty('count', 30) |
| 256 | app.measure('ping', :samples => 1) |
| 257 | end |
| 258 | |
| 259 | node.addApplication("ping") do |app| |
| 260 | app.setProperty('target', property.sinkaddr33) |
| 261 | app.setProperty('count', 30) |
| 262 | app.measure('ping', :samples => 1) |
| 263 | end |
| 264 | |
| 265 | node.addApplication("ping") do |app| |
| 266 | app.setProperty('target', property.sinkaddr34) |
| 267 | app.setProperty('count', 30) |
| 268 | app.measure('ping', :samples => 1) |
| 269 | end |
| 270 | end |
| 271 | |
| 272 | defGroup('Source4', property.resource4) do |node| |
| 273 | |
| 274 | node.addApplication("ping") do |app| |
| 275 | app.setProperty('target', property.sinkaddr41) |
| 276 | app.setProperty('count', 30) |
| 277 | app.measure('ping', :samples => 1) |
| 278 | end |
| 279 | |
| 280 | node.addApplication("ping") do |app| |
| 281 | app.setProperty('target', property.sinkaddr42) |
| 282 | app.setProperty('count', 30) |
| 283 | app.measure('ping', :samples => 1) |
| 284 | end |
| 285 | end |
| 286 | |
| 287 | defGroup('Source5', property.resource5) do |node| |
| 288 | node.addApplication("ping") do |app| |
| 289 | app.setProperty('target', property.sinkaddr51) |
| 290 | app.setProperty('count', 30) |
| 291 | app.measure('ping', :samples => 1) |