mcollective_agent_nettest
Version information
This version is compatible with:
- Puppet Enterprise 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.4.x
- Puppet >= 4.9.0
Start using this module
Add this module to your Puppetfile:
mod 'choria-mcollective_agent_nettest', '4.0.1'
Learn more about managing modules with a PuppetfileDocumentation
Choria Nettest agent
This is an agent that will execute a ping or remote connection test on mcollective hosts
I 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.
Installation
Install the Net::Ping
RubyGem on all your agent nodes:
mcollective_agent_nettest::gem_dependencies:
"net-ping": "2.0.2"
Add the agent and client:
mcollective::plugin_classes:
- mcollective_agent_nettest
Usage
ICMP ping test:
$ mco nettest ping hostname
Do you really want to perform network tests unfiltered? (y/n): y
* [ ============================================================> ] 11 / 11
node1.example.net time = 0.429
node8.example.net time = 0.388
node5.example.net time = 0.686
node4.example.net time = 1.858
middleware.example.net time = 2.697
node7.example.net time = 0.637
node0.example.net time = 16.455
node9.example.net time = 1.974
node6.example.net time = 0.415
node3.example.net time = 0.389
node2.example.net time = 0.4
Summary of RTT:
Min: 0.388ms Max: 16.455ms Average: 2.393ms
Finished processing 11 / 11 hosts in 85.76 ms
TCP connection test to port 8140:
$ mco nettest connect hostname 8140
Validator
The nettest agent supplies an fqdn validator which will validate if a string is a valid uri.
validate :fqdn, :nettest_fqdn
The 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.
validate :serveraddress, :nettest_server_address
Data Plugin
The 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.
$ mco rpc rpcutil -S "Nettest('myhost', '8080').connect=true"
Mma Aggregate Plugin
The 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.
summarize do
aggregate nettest_mma(:rtt, :format => "Min: %.3fms Max: %.3fms Average: %.3fms")
end
Changelog
Change history for choria/mcollective_agent_nettest
4.0.1
Release 2018-03-19
- Documentation update
4.0.0
Release 2018-02-28
- Initial release as part of the Choria Project
3.0.4
Released 2014-07-18
- Add pl:packaging targets to enable package building for {apt,yum}.puppetlabs.com (MCOP-73)
3.0.3
Released 2013-07-03
- Fix mistake in aggregate plugin DDL file (21581)
3.0.2
Released 2013-02-27
- Require the ICMP specific net-ping module to reduce dependencies (19486)
3.0.1
Released 2013-02-27
- Resolv does not honor /etc/hosts (19428)
3.0.0
Released 2013-02-25
- Rewrite and publish nettest agent (18431)
Dependencies
- choria/mcollective (>= 0.4.0 < 2.0.0)
Copyright 2018 R.I.Pienaar <rip@devco.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.