LoggerNet for Linux Installation Guide Revision: 8/13 Copyright 2006-2013 Campbell Scientific, Inc.
Table of Contents PDF viewers: These page numbers refer to the printed version of this document. Use the PDF reader bookmarks tab for links to specific sections. 1. Introduction...1 1.1 LoggerNet Server...1 1.2 CoraScript Interpreter...1 1.3 Logger Data Monitor Protocol Server (LDMP)...1 1.4 Logger Data Export Protocol Server (LDEP)...1 2. Installing LoggerNet for Linux...2 2.1 RPM Installation...2 2.1.1 Locate the RPM for Your Distribution...2 2.1.2 Log In as a Root User...2 2.1.3 Use RPM to Install the Software...2 2.1.4 Alternatives to the RPM Command Line...2 2.2 DEB Installation...3 2.2.1 Locate the DEB File...3 2.2.2 Log In as a Root User...3 2.2.3 Use dpkg to Install the Software...3 2.2.4 Alternatives to the dpkg Command Line...3 3. What the RPM/DEB Installs...3 4. Usage Notes...4 4.1 Starting and Stopping the Daemons...4 4.2 Configuring the Server...4 4.3 Command Line Options...5 4.4 Configuring the Export Daemons (LDMP and LDEP)...5 4.5 Running CoraScript...6 i
Table of Contents ii
LoggerNet for Linux Installation Guide 1. Introduction 1.1 LoggerNet Server 1.2 CoraScript Interpreter LoggerNet for Linux is a port of the Campbell Scientific LoggerNet server product and some clients to the Linux Operating System along with one copy of LoggerNet Remote for Windows. This package does not provide Linux based GUI client applications to administer the LoggerNet server or to monitor data from the same. These client applications are available in the LoggerNet Remote software under Windows and are able to communicate with a Linux based LoggerNet server. Additional information on the LoggerNet Remote clients can be found in the LoggerNet manual. The following services are provided by this product: Provides communication with the dataloggers over various media including serial ports, TCP/IP connections, and Linux compatible phone modems. Besides services provided to LoggerNet clients, this server also provides automatic (scheduled) data collection. This program is installed as a daemon and will be automatically started when the host computer is started. This native Linux client connects to the server and, through command line interaction with the user, allows the user to administer the LoggerNet network map including settings and allows the user to perform maintenance operations on devices such as program file send, clock check/set, etc. 1.3 Logger Data Monitor Protocol Server (LDMP) This native Linux client provides a simple text-based protocol to export data from the LoggerNet server via TCP connections as that data is collected. This server can be configured to allow the connecting client to specify what data will be sent and supports any number of concurrent client connections. For more information on running this server, see Section 4.4, Configuring the Export Daemons (LDMP and LDEP). 1.4 Logger Data Export Protocol Server (LDEP) This native Linux client provides a simple text-based protocol to export data from the LoggerNet server via TCP connections as that data is collected. This server differs from the monitor server in that it supports only one client connection at a time and the data that is sent is dependent upon its command line options and the data that it has previously sent. For more information on running this server, see Section 4.4 Configuring the Export Daemons (LDMP and LDEP). 1
LoggerNet for Linux Installation Guide 2. Installing LoggerNet for Linux 2.1 RPM Installation 2.1.1 Locate the RPM for Your Distribution The following table shows the Linux RPM distributions that are supported and the RPM file that supports each: Distribution Red Hat Suse RPM File Name loggernet-redhat_*_i386.rpm loggernet-suse_*_i386.rpm The RPM files are located in the root directory of the LoggerNet Linux CD-ROM. 2.1.2 Log In as a Root User The RPM utility requires root privileges on the host computer in order to change the state of the RPM database. You can gain root privileges by using the su command or by logging in to a terminal as the root user. 2.1.3 Use RPM to Install the Software The following command line demonstrates use of the RPM utility to install LoggerNet for Linux: rpm --install loggernet-redhat_4.2-24_i386.rpm NOTE The RPM filename contains version and revision numbers, and, therefore, may differ from that shown above. The RPM utility can also be used to upgrade an already installed version by replacing the --install option with the --upgrade option on the command line. The utility can also be used to delete the package by using the following command line: rpm --erase loggernet 2.1.4 Alternatives to the RPM Command Line Instead of installing from the command line, most Linux distributions now provide a GUI program that performs the same types of operations. On CentOS, for instance, the Package Manager application can be accessed by clicking the Add/Remove Software item on the System Administration menu. Note that you will still be required to provide the password for the root account in order to use this application. 2
LoggerNet for Linux Installation Guide 2.2 DEB Installation 2.2.1 Locate the DEB File 2.2.2 Log In as a Root User Locate the DEB file, loggernet-debian_*_i386.deb. The DEB file is located in the root directory of the LoggerNet Linux CD-ROM. The dpkg utility requires root privileges on the host computer in order to change the state of the DEB database. You can gain root privileges by using the su or sudo command or by logging in to a terminal as the root user. 2.2.3 Use dpkg to Install the Software The following command line demonstrates use of the dpkg utility to install LoggerNet for Linux: dpkg --install loggernet-debian_4.2-24_i386.deb NOTE The DEB filename contains version and revision numbers, and, therefore, may differ from that shown above. The utility can also be used to delete the package by using the following command line: dpkg --remove loggernet 2.2.4 Alternatives to the dpkg Command Line Instead of installing from the command line, most Linux distributions now provide a GUI program that performs the same types of operations. Note that you will still be required to provide the password for the root account in order to use this application. 3. What the RPM/DEB Installs Installing the LoggerNet for Linux RPM or DEB results in the following actions: Copies binary executables and user documentation to the /opt/campbellsci/loggernet directory. Copies configuration files to the /etc/opt/campbellsci directory. Copies daemon init scripts to directories appropriate for your distribution and registers the csilgrnet, csildep, and csildmp daemons so that these will start automatically when the host operating system boots. Creates the loggernet user and makes that user a member of the uucp and dialout groups (this action provides access to serial ports without needing permissions on those device files to be re-assigned). 3
LoggerNet for Linux Installation Guide 4. Usage Notes Ensures that the LoggerNet working directory at /var/opt/campbellsci/loggernet is created and that the loggernet user is the owner of that directory. 4.1 Starting and Stopping the Daemons The details of starting and stopping daemon processes can be distribution specific. The daemons can be started or stopped by invoking their init scripts with appropriate command arguments. The following example demonstrates this using the csilgrnet daemon: /etc/init.d/csilgrnet start This example shows how the service can be started. Note that this must be run with root privileges. The daemon can be stopped by replacing the command, start, with the command, stop. Alternatively some distributions provide a service manager GUI application to start and stop daemons. In CentOS, this can be accessed by choosing System Administration Services from the desktop menu. 4.2 Configuring the Server The configuration options for the server are in the csi_registry.xml file found in /etc/opt/campbellsci. The WorkDir value under the HKEY_LOCAL_MACHINE/SOFTWARE/Campbell Scientific/LoggerNet/4.2 key path specifies the working directory that the LoggerNet server will use for its configuration and data files. The IpPort value under the same key will tell the server the TCP port on which it is to offer its service. If this value is not specified, the value will default to a value of 6789. If you change any of these values in the registry, it will be necessary to re-start the server daemon in order for these changes to be effective. This process is described in the previous section. NOTE The AppDir and WorkDir registry values are there by default. The IpPort registry value is not. NOTE The WorkDir registry value contains the software revision, and, therefore, may differ from that shown above. Depending on selections made during the operating system install, a firewall application may have been enabled by default on the Linux PC. The firewall was enabled to protect the PC from invasion by outside, unauthorized programs that may try to connect via a socket using TCP/IP. Remember, however, that LoggerNet is a client-server application that uses TCP/IP as the link between clients and the server. This means that the LoggerNet Remote clients for Windows such as Setup, Connect, Status, RTMC, etc., need to access the LoggerNet server on Linux via a TCP port. Therefore, you must allow remote TCP connections for the specific server port, 6789 by default, access through 4
LoggerNet for Linux Installation Guide any firewall on the LoggerNet server PC or on the network between the remote client PC and the LoggerNet server PC. You should read the installation guide for your distribution of Linux to understand the firewall application and how to grant or deny access for the LoggerNet server TCP port. Once remote TCP connections to the LoggerNet server are allowed through the firewall, the LoggerNet Remote Windows clients can access the LoggerNet server on Linux by specifying the IP address or qualified domain name of the LoggerNet server PC. If you don't know the IP address of your Linux PC, the "ifconfig" command issued in a terminal window will display the IP address and properties of the network interface. NOTE By default, security is disabled in the LoggerNet server, which means all LoggerNet Remote clients can access the LoggerNet server with full administrator rights. If security is a concern, use the Security Manager client in LoggerNet Remote to enable security in the LoggerNet server. For more information, read the section about the Security Manager in the LoggerNet manual. 4.3 Command Line Options Advanced Linux administrators may have reasons to modify the provided init scripts, create their own, or use other methods for launching the daemon. The csilgrnet executable supports the following command line options: --IpPort=xxxx: Specifies the TCP port to which the server will be bound. --WorkDir=path: Specifies the directory where the server will store its working directory (usually in sys/bin relative to the AppDir). --AppDir=path: Specifies the directory where the server will write, by default, such things as data files. --IpBindAddress=aaa.bbb.ccc.ddd: Specifies the address of the interface to which the server will be bound. If empty, the server will bind to all available interfaces. --logfiledir=path: Specifies the directory where the server will write its log files. --run-as-daemon=<true false>: Specifies whether the program should run as a daemon. When true, this will force the program to fork, set the umask, call setsid(), and to detach its I/O handles. 4.4 Configuring the Export Daemons (LDMP and LDEP) The LoggerNet data export daemons, LDMP and LDEP, are described in Section 1.3, Logger Data Monitor Protocol Server (LDMP), and Section 1.4, Logger Data Export Protocol Server (LDEP). 5
LoggerNet for Linux Installation Guide When starting the daemons, the init scripts csildep and csildmp use settings from the configuration files ldep.conf and ldmp.conf respectively (located in /etc/opt/campbellsci). You can use a text editor to examine the comments within these configuration files to understand what options are available. Online documentation (in PDF format) is also available for these daemons in the /opt/campbellsci/loggernet directory. You may need to disable these daemons from starting automatically if you do not require them for the operation of your system. Depending on selections made during operating system installation, SELinux may be enabled on the Linux PC. SELinux limits the actions of both users and programs by enforcing security policies throughout the operating system. One policy for SELinux does not allow ports at or under 1024 to be opened by a non-root process. Since the default port used by LDMP, 1024, falls within that range of disallowed ports, you must either change the ldmp.conf file to use a different port or you must disable or change the SELinux policies before the LDMP daemon will start. You should read the installation guide for your distribution of Linux and understand SELinux if you plan to make changes or disable this security feature. 4.5 Running CoraScript The CoraScript interpreter executable is /opt/campbellsci/loggernet/cora_cmd and can be run with no special permissions using that path on the command line. It is recommended that an alias be created as follows: alias cora_cmd=/opt/campbellsci/loggernet/cora_cmd By placing this line in your.bashrc file, you will be able to run cora_cmd without always specifying the path. 6
Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com info@campbellsci.com Campbell Scientific Africa Pty. Ltd. (CSAf) PO Box 2450 Somerset West 7129 SOUTH AFRICA www.csafrica.co.za cleroux@csafrica.co.za Campbell Scientific Australia Pty. Ltd. (CSA) PO Box 8108 Garbutt Post Shop QLD 4814 AUSTRALIA www.campbellsci.com.au info@campbellsci.com.au Campbell Scientific do Brasil Ltda. (CSB) Rua Apinagés, nbr. 2018 Perdizes CEP: 01258-00 São Paulo SP BRASIL www.campbellsci.com.br vendas@campbellsci.com.br Campbell Scientific Canada Corp. (CSC) 11564-149th Street NW Edmonton, Alberta T5M 1W7 CANADA www.campbellsci.ca dataloggers@campbellsci.ca Campbell Scientific Centro Caribe S.A. (CSCC) 300 N Cementerio, Edificio Breller Santo Domingo, Heredia 40305 COSTA RICA www.campbellsci.cc info@campbellsci.cc Campbell Scientific Ltd. (CSL) Campbell Park 80 Hathern Road Shepshed, Loughborough LE12 9GX UNITED KINGDOM www.campbellsci.co.uk sales@campbellsci.co.uk Campbell Scientific Ltd. (CSL France) 3 Avenue de la Division Leclerc 92160 ANTONY FRANCE www.campbellsci.fr info@campbellsci.fr Campbell Scientific Ltd. (CSL Germany) Fahrenheitstraße 13 28359 Bremen GERMANY www.campbellsci.de info@campbellsci.de Campbell Scientific Spain, S. L. (CSL Spain) Avda. Pompeu Fabra 7-9, local 1 08024 Barcelona SPAIN www.campbellsci.es info@campbellsci.es Please visit www.campbellsci.com to obtain contact information for your local US or international representative.