This script provides a way to monitor servers that are not directly accessible by the Xymon display server, or when software cannot be installed or user accounts cannot be created. As long as you have a way to run a shell on the remote server, you should be able to use xymon-rclient to monitor that server.
Disclaimer: xymon-rclient comes with no warranty. You use this software at your own risk. The software might not work as expected, or at all, and that would be your problem. The software might cause other things to break. If you decide to use it, then you are entirely responsible for anything that happens as a result.
To install and use, follow the instructions in the comments at the start of the script. In brief:
Example hosts.cfg entries are shown here:
10.99.1.1 remserver1.example.com # testip noping dialup "RCLIENT:cmd(ssh -T otheruser@%{H}),ostype(sunos)" 10.99.1.2 remserver2.example.com # testip noping dialup "RCLIENT:cmd(ssh -T user1@gateway ssh -T -l user1 %{I}),ostype(sunos)" 10.99.1.3 remserver3.example.com # testip noping dialup "RCLIENT:cmd(rsh),ostype(linux),timeout(120)" 10.99.1.4 remserver4.example.com # testip noping dialup "RCLIENT:cmd(ssh -T remserver4.local),ostype(linux),env(TOP=/usr/local/bin/top)"
The format of the RCLIENT specification in hosts.cfg is something like this:
RCLIENT:cmd(command-line),ostype(ostype)[,timeout(seconds)][,scriptos(ostype)][,env(var1=val1[ var2=val2 ...])]
If spaces are used, the entire RCLIENT:... string must be enclosed in quotes.
The cmd() specifies a command-line to execute in order to get a shell on the remote system. The string %{H} is automatically replaced by the target hostname. If a cmd() definition has no spaces, then the hostname will be appended regardless (such as in the "rsh" example above). The string %{I} is automatically replaced by the IP address in hosts.cfg. There is no default cmd() - it must be specified.
The ostype() specifies the OS type, and must match one of the scripts in the client bin directory. For example, specifying ostype(irix) will match (and use) the script xymonclient-irix.sh. There is no default ostype() - it must be specified.
The scriptos() specifies the OS type for the script to be sent. This defaults to the ostype() specification. This is useful if you need to send a customised script, but the OS of the host matches an existing script. Specify only the OS part, so for example, specifying ostype(sunos) and scriptos(sunos7) will report a "sunos" server in the client data but will run the script xymonclient-sunos7.sh.
The default timeout() setting is 60 seconds.
The env() setting is useful to specify environment variables to be given to the client script. This is useful for defining TOP if it's not in the PATH.
It's useful, and sometimes important to specify the following parameters to ssh connections, either in the cmd() command-line specification, or in the .ssh/config file:
Note that (FreeBSD based) FreeNAS appears to run a limited shell by default, which doesn't handle
the client script it's given. To work around this, add "/bin/bash" to the command like so:
Comments, submissions welcome: jeremy+xymonrclient@laidman.org