Pandora: Documentation en: RemoteManagement

From Pandora FMS Wiki
Revision as of 13:41, 20 June 2012 by Darode (talk | contribs) (Install and setup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Go back to Pandora FMS documentation index

1 Remote systems management with Pandora FMS

1.1 Introduction

Pandora FMS is a monitoring tool, and it doesn't use the agents so we could connect with the systems.This way it isn't useful to control remotely the monitored systems. Some systems, such as routers and switches could be managed through Telnet or SSH and in order to have access to them you will only need to fire the right command.

Pandora FMS includes "by default" a Java plugin to be able to connect from the WEB console, via VNC to the remote servers, using the IP configured by them. This could be easy if we are in the same local network segment and if we have direct connection. In other cases, it is more complicated.

We can distinguish between complex and simple environments. These would be the characteristics of a simple environment:

  • The server IP doesn't change.
  • The access (paths, firewalls) from the operator PC to the servers has open ports and it knows how to get through normal TCP/IP.
  • We could install a remote control software in the server host system, or this has already one.

Unlike this, the characteristics of a complex environment would be the following ones:

  • The server IP changes (it's dynamic).
  • There is no direct access from the operator PC to the server that we want to monitor.
  • We couldn't install remote control software in the remote system.

There are also intermediate cases, for example, the machines have fixed IP, but we don't have direct remote access via TCP/IP to the server from the operator PC. In any case, there are three possible ways to have remote access to these systems:

  1. Directly, it's possible to install, for example a SSH server, activate the Remote Desktop or to install a VNC server in the host system. From the operator PC, it'll be enough if we write the remote system IP in the client program that is running in the operator PC and it'll be ready. This is right only for the "Simple" environments. Here we strongly recommend UltraVNC.

  2. To use an inverse system. We are referring to those remote control systems that, instead of waiting to connect, with an open TCP port, connect with a server in the internet which allows, when the operator PC communicates with this same server in Internet, to "connect" both computers so they can "talk". This way, between them, the internal network wouldn't communicate at all. This system, useful in complex environments, has many disadvantages, such as the speed, or the fact that if the server that we need to control doesn't have access to Internet, we won't be able to communicate with it. Here we recommend TeamViewer.

  3. Use a direct connection system with UltraVNC allows to configure one proxy, so it'll be the one that connects with the remote server. We will connect with the intermediate server (proxy) and this one with the end server. This is called "Ultra VNC Repeater". You can find more information about this in this page http://www.uvnc.com/docs/uvnc-repeater.html.This would be the working basic sketch:



Ultra vnc modeI.png

The UltraVNC tool itself allows to do the setup in a graphic way:



Ultra vnc repeater.gif

The connection to the VNC server would use the proxy to connect with the destination server, as we can see in this screenshot:



Vnc sample2.gif

1.2 Using VNC integrated in Pandora FMS

It's possible, through the Pandora FMS "VNC" extension, to have access, from the WEB console itself, without having to install additional software or doing anything extra. To do this, the only requisites are these:

  • Having installed a VNC server that includes the Java applet, listening in the port 5800 of each server we want to manage remotely.
  • Having the Java plugin installed in its browser.
  • Having direct connection from the PC where the operator is connected to the Pandora console, to the monitored server that we want to manage remotely. The connection has to allow the port 5800/TCP

If we fulfil these requisites, we only have to press on the flap with the extension "VNC" in the operation view of one agent and we'll see the following:



Vnc tab.png

Look of the VNC flap (first one by left)

When the communication is reestablished, it's necessary to introduce a password that is configured when the VNC server is installed in the machine.



Vnc ext 1.png

Once we have introduced the password, we have access to the server " as if we were there".



Vnc ext 2.png

We recommend the use of the UltraVNC [1], so, besides being very strong, support connection coding, and allow file transfer from one machine to other, it's OpenSource and free.

The limitations of this system are mainly the following:

  • Needs connection between your PC and the machine to monitor remotely. If it's behind one firewall or a Router, in Internet, it won't be able to connect.
  • Needs to know the IP. With Pandora FMS, it could tell to the agent that notifies the current IP to Pandora, and this will know which one is the IP, but sometimes it won't work well (if it has several network adapters, if it doesn't update the IP in an standard way or due to other possible causes)
  • Needs to install the UltraVNC software, may be that due to security policies it won't be able to install it.

In case that the problem is the first point, you could use the direct connection method through proxy, but the method shown there won't work, so you will need to download a client program and execute it manually from your PC in order to connect with the remote system.

1.3 Using TeamViewer with Pandora FMS

TeamViewer is a powerful system of remote management that uses intermediate servers in Internet to connect with their equipments, regardless of changes in the IP, firewalls or other problems we've previously mentioned. You will only need three things:

  • Internet connection in both ends (the server to monitor and the operator's PC).
  • Take note of the machine ID and remember the password.
  • Install the TeamViewer software in the remote server.

Once it has been installed, you'll assign an ID to this machine and you'll have the chance to configure one password of permanent access. The TeamViewer IDs has the format i.e: UltraVNC [2]. For this, we use the Enterprise feature "Customized fields" to create this field in all the agents and write there the ID of each machine.

I create the custom field (Configuration -> Agents -> Manage customized fields -> Create)



Custom field create.png

Once created, I can store there the ID of this machine, in this case 623 596 886



Custom field create1.png

Now, I only have to go to the TeamViewer page, [3] introduce my ID and go to the system:



Team viewer.png

1.3.1 Technical details about Teamviewer

TeamViewer is extremely powerful and it also allows to transfer files from one system to other one.

These tools are connected with remote servers, and the security could be a "problem" if we are specially " demanding" with these concepts (due to legal questions and/or privacy of data. With the commercial version there are, obviously, some advantages regarding this point.

This is a list of the connections fixed in the server managed remotely with a fixed TeamViewer connection:

TCP    desktop:1379           server530.teamviewer.com:http  ESTABLISHED
TCP    desktop:1380           master4.teamviewer.com:http  ESTABLISHED
TCP    desktop:1381           server311.teamviewer.com:http  ESTABLISHED
TCP    desktop:1382           server311.teamviewer.com:http  ESTABLISHED

1.4 Connecting remote systems using SSH/Telnet from Pandora FMS

Since 4.0.2 version, Pandora FMS has a new extension to let users connect directly with devices by telnet or SSH. This is done with the Remote Gateway extension. You need to do a special setup for this component, not usually installed "by default". This is an opensource feature, based on anytermd software, published under GPL2 licence.



Ssh snapshot1.png





Ssh snapshot2.png



Pandora FMS uses a tool called "anytermd" to create a "proxy" between user browser and remote destination. This tool launches as a daemon, listeting in a port, and executing a command, forwarding all output to the user browser. That means all the connections are done FROM the pandora server and it has to be installed the telnet and ssh client. This is a basic architecture schema:



Anytermd.png



1.4.1 Install and setup

Sources are placed in extras/anytermd.

Make sure you have installed gnu c++ compiler (gcc-c++), make, boost-devel and zlib-devel.

Run:

make

Later, install manually the binary to /usr/bin

cp anytermd /usr/bin

To run the server daemons, you need to do manually, Pandora FMS server / console doesn't start up automatically. Pandora FMS SSH/Telnet extension will search for a different instance of anyterd running in 8023 for Telnet connections and 8022 for SSH connections.

You have a start/stop daemon in contrib/anytermd. Copy to /etc/init.d/anytermd and execute it like this:

/etc/init.d/anytermd start

By default uses "pandora" user for execution, if you want to change it, alter the script file for any other httpd based user your system may have.


Info.png

This will use ports 8023 and 8022, be sure that ports are "open and clear" from the user browser to the console webserver system. No firewalls there

 


Now you're free to use the extension and connect remote servers by telnet or SSH.

Go back to Pandora FMS documentation index