>Use netstat to look for the slave port which should be listening on the master. >This is how the master communicates with the slave - down this tunnel. >If you can't see it on the master then restart autossh on the slave - >using the opsview-slave script for example.
I am working on a perl based script to run from the slave server that fetches the master address and port number from "opsview-slave.conf" then checks the master for the correct tunnel. Looking at my list of Opsview related tunnels on the master server I am not sure which ones I should be keying off of. If the reverse tunnel was down what would my output look like. For instance slave server at 25807 has these listed on the master, if the reverse tunnel was down would the status on one of these change? tcp 0 0 127.0.0.1:25807 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:51646 127.0.0.1:25807 TIME_WAIT tcp6 0 0 ::1:25807 :::* LISTEN I've never tried to ssh through perl scripting that I can recall but I had to add NET::SSH in the script I'm working to keep the process from forking. Any guidance would be appreciated as the periodic dropped tunnels are a pain to deal with. Thanks, James Whittington VC3, Inc. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andrew Hall Sent: Friday, May 15, 2009 6:19 AM To: opsview-users Subject: Re: [opsview-users] periodic autossh issues with reverse tunneldropping On 2009-05-15 02:44, James Whittington wrote: > My other approach is to set up a check on the slave server to somehow > check for the existence of the reverse tunnel and restart the slave > service if it is detected as being down. > > I can do a process listing (from the slave to the master) and see ssh > sessions but I'm not sure how I would detect the existence of the > correct reverse ssh process? Use netstat to look for the slave port which should be listening on the master. This is how the master communicates with the slave - down this tunnel. If you can't see it on the master then restart autossh on the slave - using the opsview-slave script for example. Let me know how you get on as I'm looking to implement something similar myself :-) _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/listinfo/opsview-users _______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/listinfo/opsview-users
