Author | Padraig Lennon |
---|---|
Compatibility | All Versions |
Requirements | Linux/Solaris |
Download | None |
Last Update | 2011-04-07 |
If you have servers in a DMZ which do not allow inbound connections to port 1984 hobbit, then a common way around it is to allow out ssh (port 22) and create a reverse ssh tunnel to the hobbit server (port 1984) using ssh keys for password-less connections.
Full details on setting this up can be found on the hobbit wiki: http://en.wikibooks.org/wiki/System_Monitoring_with_Xymon/Other_Docs/HOWTO#Monitor_Xymon_clients_in_a_DMZ_using_reverse_SSH_tunnels
(Thanks to Johan Booysen for writing this up)
ssh_tunnels.sh is a server side bash script which reads the bb-hosts file for clients with the appended tag ssh-tunnels.
The script will loop through the list gathered from bb-hosts and check that the reverse ssh tunnel process is up and running. If it is not it will turn red, but it will attempt to restart the tunnel. It will continue to do this until the tunnel is ok.
This will result in a new column called ssh-tunnel being added to the client display.
Update 0.0.3 - You can now specify non-standard ssh ports to connect to the ssh client. You can do this by using the following syntax: ssh-tunnel:NNNN where NNNN is the port in question. Example ssh-tunnel:2222 This is only needed if a non-standard port is used. The script defaults to port 22
Please note that if you upgrade your existing version to 0.0.3 you will need to kill all existing tunnels first. This is because the process listing will change. To kill all existing tunnels you can run the command
for PROCESS in `ps -ef | grep "[:]xymon_server:" | awk {'print $2'}`;do kill $PROCESS ; done
where xymon_server is the name of the host running the ssh-tunnels.sh script.. If in doubt just do a directory listing. The script will recreate the tunnels once running
1. Place the script on the Xymon Server in the /path/to/hobbit/server/ext folder
2. chmod 755 /path/to/hobbit/server/ext/ssh_tunnels.sh
3. Edit the file /path/to/hobbit/server/etc/hobbitlaunch.cfg
Add the following:
[ssh-tunnel] ENVFILE /path/to/hobbit/server/etc/hobbitserver.cfg CMD $BBHOME/ext/ssh-tunnels.sh LOGFILE $BBSERVERLOGS/ssh-tunnels.log INTERVAL 1m
4. Restart the Xymon Server application