README.md
1Nettest agent
2=============
3
4This is a simple agent that will execute a ping or remote connection test on mcollective hosts
5
6I often find myself logging onto boxes to ping different sites to diagnose local or remote network issues, this means I can now just issue a single command and get results from anywhere I’m running mcollective.
7
8Installation
9------------
10
11* Install RubyGem [Net::Ping](http://raa.ruby-lang.org/project/net-ping/)
12* Follow the [basic plugin install guide](http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/InstalingPlugins)
13
14Usage
15-----
16
17ICMP ping test:
18
19 $ mco nettest ping hostname
20 Do you really want to perform network tests unfiltered? (y/n): y
21
22 * [ ============================================================> ] 11 / 11
23
24 node1.example.net time = 0.429
25 node8.example.net time = 0.388
26 node5.example.net time = 0.686
27 node4.example.net time = 1.858
28 middleware.example.net time = 2.697
29 node7.example.net time = 0.637
30 node0.example.net time = 16.455
31 node9.example.net time = 1.974
32 node6.example.net time = 0.415
33 node3.example.net time = 0.389
34 node2.example.net time = 0.4
35
36 Summary of RTT:
37
38 Min: 0.388ms Max: 16.455ms Average: 2.393ms
39
40
41 Finished processing 11 / 11 hosts in 85.76 ms
42
43TCP connection test to port 8140:
44
45 $ mco nettest connect hostname 8140
46
47Validator
48---------
49
50The nettest agent supplies an fqdn validator which will validate if a string is a valid uri.
51
52 validate :fqdn, :nettest_fqdn
53
54The nettest agent supplies a server address validator which will validate that a given string includes both a valid hostname and port number separated by a colon.
55
56 validate :serveraddress, :nettest_server_address
57
58Data Plugin
59-----------
60
61The nettest agent also supplies a data plugin which uses the nettest agent to check if a connection to a fqdn at a specific port can be made. The data plugin will return 'true' or 'false' and can be used during discovery or any other place where the MCollective discovery language is used.
62
63 $ mco rpc rpcutil -S "Nettest('myhost', '8080').connect=true"
64
65Mma Aggregate Plugin
66--------------------
67
68The nettest agent supplies a mma aggregate plugin which will determine the minimum value, maximum value and average value of a set of inputs determinted in a DDL.
69
70 summarize do
71 aggregate nettest_mma(:rtt, :format => "Min: %.3fms Max: %.3fms Average: %.3fms")
72 end
73