PingPlugin
This plugin tests if a remote host identified by host name or IP address is reachable via ping command.
Syntax Rules
PING{ host="..." } -- ping a host for reachability
- The
%PING{}% variable tests if a remote host identified by host name or IP address is reachable via ping command. The variable is handled by the PingPlugin.
- Syntax:
%PING{ host="www.google.com" }%
- Supported attributes:
| Attribute | Comment | Default |
host="..." | Host name or IP address | (required) |
wait="..." | Time, in seconds, to wait for a ping response | "5" |
format="..." | Format of output. Use the variables $host for the host and $result for the result (1 for success, 0 for failure) | For success: "%GREEN%host%ENDCOLOR%" For failure: "%RED%host%ENDCOLOR%" |
- Example:
%PING{ host="www.google.com" wait="2" }%
- Category: AdministrationVariables, DevelopmentVariables, SystemInformationVariables
- Related: PingPlugin
PING Examples
Basic Usage
%PING{ host="www.google.com" wait="1" }%
%PING{ host="www.google.com" wait="1" }%
%PING{ host="irs.gov" wait="1" }%
%PING{ host="irs.gov" wait="1" }%
%PING{ host="www.yahoo.com" wait="1" format="$host result is $result" }%
%PING{ host="www.yahoo.com" wait="1" format="$host result is $result" }%
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%PINGPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Test if a remote host is reachable via ping command
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.
- Or, follow these manual installation steps:
- Download the ZIP file from the Plugins home (see below).
- Unzip
PingPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/PingPlugin.txt | Plugin topic |
data/TWiki/VarPING | PING variable documentation |
lib/TWiki/Plugins/PingPlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/PingPlugin/Core.pm | Plugin Perl module |
- Set the ownership of the extracted directories and files to the webserver user.
- Make sure the dependencies listed in the table below are resolved.
| Name | Version | Description |
|---|
| Net::Ping | >=0 | Required. |
- Plugin configuration and testing:
- Run the configure script, enable the plugin in the Plugins section
- Test if the installation was successful: See examples above.
Plugin Info
Related Topics: VarPING,
TWikiPreferences,
TWikiPlugins