Setup Remote Access

From mylvs
Jump to: navigation, search

myLVS is using the NSClient solution to communicate from the myLVS server to the nsclient service
running on the RealServer. myLVS supports both, the NSClient version which comes with Debian Linux
and the Windows version which comes with

Setup myLVS with the NSClient (the client part)

Remember: myLVS acts as client in the view of nrpe

  • Note: The Debian / Nagios package is required for remote access: nagios-nrpe-plugin
  • Check to see if the plugin runs without any error, run:
[email protected]:/# /usr/lib/nagios/plugins/check_nrpe

Setup the Linux Realserver with the NSClient (the server part)

Remember: The Realserver on Linux acts as server in the view of nrpe

  • Install NSClient Server part to the myLVS client
[email protected]:~# apt-get install nagios-nrpe-server
  • Run sudo
[email protected]:/#  visudo -f /etc/sudoers
  • Add to sudo
nagios ALL=NOPASSWD: /sbin/ipvsadm
nagios ALL=NOPASSWD: /sbin/init

Edit /etc/nagios/nrpe.cfg

  • Set Allowed hosts
  • Set dont blame
  • Set two new commands, restart web and reboot
command[reset_apache]=/etc/init.d/apache2 restart
command[reboot]=init 6
  • Restart the nrpe server
[email protected]:~# /etc/init.d/nagios-nrpe-server restart

Setup the Windows Realserver with the NSClient (the server part)

Remember: Windows acts as server in the view of nrpe


Edit C:\Program Files\NSClient++\nsclient++.ini

  • Add to allowed hosts
allowed hosts =,::1,
  • SSL options needed for the classic npe client, worst case is to allow only:
ssl options = sslv2,sslv3
  • Verify off
verify mode = none
  • Insecure true
insecure = true
  • Add commands:
[/settings/external scripts/scripts]
reset_iis="C:\Program Files\NSClient++\scripts\resetiis.bat"
reboot="C:\Program Files\NSClient++\scripts\reboot.bat"

Add two new batch files

  • C:\Program Files\NSClient++\scripts\reset_iis.bat
  • C:\Program Files\NSClient++\scripts\reboot.bat
shutdown /r /f

Don't forget to restart the nrpe++ services when changes are made

Testing the myLVS access

  • Reset the IIS service on Windows
[email protected]:/home/demo# /usr/lib/nagios/plugins/check_nrpe -H -p 5666  -c reset_iis
  • Reset the Apache on Linux
[email protected]:/home/demo# /usr/lib/nagios/plugins/check_nrpe -H -p 5666  -c reset_apache
  • Reboot Windows
[email protected]:/home/demo# /usr/lib/nagios/plugins/check_nrpe -H -p 5666  -c reboot
  • Reboot Linux
[email protected]:/home/demo# /usr/lib/nagios/plugins/check_nrpe -H -p 5666  -c reboot