Forge Home


Perform network tests from a mcollective host


125,033 latest version

1.9 quality score

Version information

  • 4.0.3 (latest)
  • 4.0.2
  • 4.0.1
  • 4.0.0
released Jul 7th 2020
This version is compatible with:
  • Puppet Enterprise 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
  • Puppet >= 6.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'choria-mcollective_agent_nettest', '4.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add choria-mcollective_agent_nettest
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install choria-mcollective_agent_nettest --version 4.0.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.



choria/mcollective_agent_nettest — version 4.0.3 Jul 7th 2020

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.


This module depends on the Net::Ping Ruby gem which requires a C++ compiler to build.


ICMP ping test:

$ mco nettest ping hostname
Do you really want to perform network tests unfiltered? (y/n): y

 * [ ============================================================> ] 11 / 11                        time = 0.429                        time = 0.388                        time = 0.686                        time = 1.858                   time = 2.697                        time = 0.637                        time = 16.455                        time = 1.974                        time = 0.415                        time = 0.389                        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


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")