Configure Linux/Unix systems for the Orion agent for Linux

As described in Configure SNMP for Orion agents on Linux/Unix systems, the Orion Platform automatically configures SNMP on Linux/Unix systems when Discovery detects new or updated nodes, depending on your Network Discovery settings.

To effectively monitor Linux/Unix systems with templates and component monitors that use the Orion agent for Linux/Unix, the agent must be installed on the target Linux machine, the node must be managed using the agent within the Orion Platform, and the target system must be configured properly.

This section provides configuration details for the following Linux/Unix environments. You may need to reference vendor documentation, as well as work with your NOC and server management groups to complete modifications.

Apache configurations

To prepare a system for the Orion agent for Linux:

  1. Log into your Apache server using SSH or telnet client. Grant yourself root permissions (so root).
  2. Confirm that the following packages are installed. (Install, if necessary.):
    • Apache httpd
    • LWP::UserAgent (Perl)
  3. Use the command: yum install perl-libwww-perl
  4. Locate httpd.conf: find /etc -iname httpd.conf. The file is typically located in /etc/httpd/conf/httpd.conf.
  5. Locate the following section:
    #<Location /server-status>
    #    SetHandler server-status
    #    Order deny,allow
    #    Deny from all
    #    Allow from .example.com
    #</Location>
    
  6. Uncomment the code. Edit the Allow from rule, substituting the IP address or hostname of your Apache server for localhost. Use localhost only if the Apache server services the loopback interface. Also make sure the ExtendedStatus is On.
    <Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost
    </Location>
    ExtendedStatus On
    
  7. To finish, you can either:
    • Restart with httpd: service httpd restart, or
    • Reload the configuration: service httpd reload.

Tomcat configurations

Follow these steps to install and configure Tomcat servers to work with SAM component monitors. If Apache Tomcat is already installed, you can skip to step 4 to create an account used for polling.

  1. Determine the version of Tomcat you want to install. You may have multiple versions available to install. To locate all versions, use this command:
    yum search tomcat
  2. After determining the version, you can install the tomcat package and the admin webapps package. Locate the versions to install from the search results. For example:
    tomcat5.i386 : Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
    tomcat5-admin-webapps.i386 : The administrative web applications for Jakarta Tomcat
  3. Install the versions using the located versions. To install the example above:
    yum install tomcat5 tomcat5-admin-webapps
  4. Next, you need to modify the tomcat-users.xml file to create a user account to access the web manager ('manager','manager-gui'). To locate, use this command:
    find /etc -iname tomcat-users.xml
  5. Edit the file and locate the <tomcat-users> section. If commented out, uncomment the configuration. Edit to add a user of tomcat with the password of tomcat. The template uses this account to access data.
    <tomcat-users>
    <user name="tomcat" password="tomcat" roles="tomcat,manager,manager-gui" />
    <user name="role1"  password="tomcat" roles="role1"  />
    <user name="both"   password="tomcat" roles="tomcat,role1" />
    </tomcat-users>
  6. Restart the service. The command depends on the version you installed. For example, this command restarts the installed service above:
    service tomcat5 restart

JMX

For JMX configurations, install and configure WebSphere per your Linux/Unix distribution. See the IBM Knowledge Center (© 2019, IBM Corp., https://www.ibm.com/support, obtained on October 29, 2019) for details. The overall steps include:

  1. Install WebSphere and note the following details:
    • You may need to create an administrator account and a new package group.
    • During installation, turn off the secure storage option, as this is not needed.
    • Make sure to select the Application Server during installation.
  2. Start and stop the WebSphere AppServer.
  3. Use a browser to access the WebSphere AppServer console at http://websphere-host:9060/ibm/console
    • You may need to open a port to 9060 on the Websphere host.
    • Use the credentials for the account created during installation.
  4. In the IBM console, expose the JMX platform mbeans in the WebSphere AppServer.:
    1. Click Servers > Server Types > WebSphere application servers.
    2. Select the listed application server.
  5. Locate the Java and Process Management > Process definition. In the Generic JVM arguments dialog box, enter the following code:

    Djavax.management.builder.initial=

    Note: There is nothing after the = sign.

    Dcom.sun.management.jmxremote=true

    Dcom.sun.management.jmxremote.port=8686

    Dcom.sun.management.jmxremote.ssl=false

    Dcom.sun.management.jmxremote.authenticate=false

    Djava.rmi.server.hostname=localhost

  6. Restart the AppServer.

Squid

Squid is a caching and forwarding web proxy. It has a wide variety of uses, from speeding up a web server by caching repeated requests; to caching web, DNS and other computer network lookups for a group of people sharing network resources, to aiding security by filtering traffic.

To configure Squid for agent polling:

  • SNMP is required - Enable the SNMP feature for Squid. If using Squid-3, this feature is available to enable by adding a configuration option to squid.conf. If using Squid-2, you will need to enable the feature using a series of scripts then configure.
  • perl-switch is required - Add per your Linux distribution vendor's documentation.

Review your vendor documentation for details at http://www.squid-cache.org/.

Nagios

Nagios monitors systems, networks, and infrastructure. It offers monitoring and alerting servers, switches, applications, and services. Refer to your vendor's documentation to properly install and configure Nagios according to your Linux distribution.

You can use the Nagios Script monitor and Linux/Unix Script Monitor for monitoring Nagios.

If you are using this component monitor with Nagios and polled by Orion agent for Linux, you need to enter a script as follows. The argument would be python $(SCRIPT) with a body of:

from random import randint
STAT_PAIRS_COUNT = 10
 
for stat_id in range(STAT_PAIRS_COUNT):
	print 'Statistic.random%d: %d\nMessage.random%d: %s' % (stat_id, randint(1,100), stat_id, 'random number: ' + str(randint(1,100)))

ODBC configurations

To monitor a database with an ODBC connector, install an ODBC driver for your installed database type, create a user, and test access. Use the new account credentials in your SAM template and component monitors. For a full list of available templates, see the SAM Template Reference.

For the following instructions, you should have a database installed such as MySQL or PostgreSQL.

  1. (Required) To begin, you should have unixODBC installed to support Microsoft Windows ODBC. If not, download and install the unixODBC driver to the Linux/Unix-based computer.
  2. Install the DBMS driver.
  3. Download and install an ODBC driver for your installed database type.
  4. Create a user account for the database.
  5. Configure the user access privileges with administrative privileges.
  6. Test access to the database using the newly created account credentials.

To configure and assign a SAM template with the credentials:

  1. In the Orion Web Console, click Settings > All Settings > SAM Settings > Manage Templates.
  2. Search for a template based on the database type such as ODBC or Oracle. SolarWinds recommends creating a copy of the template. Select a template and click Copy.
  3. Modify the settings of the template and component monitors based on the metrics you want to monitor.
  4. To enter credentials, select the component monitor checkboxes and click Assign Credentials.
  5. Enter the credentials you created for the database and click OK.
  6. Test the access for the template by assigning it to a node. Click Test Node to assign and test the access. If you encounter issues, verify the credentials and privileges for the account.

PostgreSQL configurations

SAM provides a PostgreSQL template and component monitors for PostgreSQL 9. To monitor a PostgreSQL database server with component monitors, you need to install an ODBC driver, create a user, and test access. Use the new account credentials in your SAM template and component monitors.

The following instructions assume that PostgreSQL is installed on a Linux-based computer.

  1. Log into the system with administrator privileges.

    You will need to create a user account on the server and in the PostgreSQL database.

  2. (Required) To begin, you should have unixODBC installed to support Microsoft Windows ODBC. If not, download and install the unixODBC driver to the Linux-based computer.

    Command: yum install unixODBC

  3. Download and install the PostgreSQL ODBC driver on the target Linux-based computer.

    Command: yum install postgresql-odbc

  4. Create a user account for the database.

    The example of commands adds a user account dbuser with the password Password1 to the Linux-based computer. The next commands login as the database superuser to the ProgreSQL server and modify the created user.

    # adduser dbuser
    # passwd Password1
    # su - postgres
    $ psql -d template1 -U postgres

    At the prompt, create the dbuser account with the Password1 password:

    template1=# CREATE USER dbuser WITH PASSWORD 'Password1';

    Next, grant privileges for your PostgreSQL database (TestDatabase) to the user account:

    template1=# GRANT ALL PRIVILEGES ON DATABASE TestDatabase to dbuser;

    Close the template:

    template1=# \q
  5. Test access to the database using the newly created account credentials.

    $ su - dbuser
    $ psql -d TestDatabase -U dbuser

Configure and assign a SAM template with the credentials.

  1. In the Orion Web Console, click Settings > All Settings > SAM Settings > Manage Templates.
  2. Search for the PostgreSQL template. SolarWinds recommends creating a copy of the template. Select the template and click Copy.
  3. Modify the settings of the template and component monitors based on the metrics you want to monitor.
  4. To enter credentials, select the component monitor checkboxes and click Assign Credentials.
  5. Enter the credentials you created for the database and click OK.
  6. Test the access for the template by assigning it to a node. Click Test Node to assign and test the access. If you encounter issues, verify the credentials and privileges for the account.

If you receive the error "FATAL: Peer authentication method failed for user 'postgresuser'", change the authentication method to md5.

MySQL configurations

To configure MySQL, you need to install and configure the appropriate MySQL repository, create a user account, and test access. Use the new account credentials in your SAM template and component monitors.

SAM templates include two options for MySQL 5.7.9 and earlier and 5.7.9 and later.

For the following instructions, you should have MySQL installed on a Linux-based computer.

Depending on your Linux distribution, verify the example commands used. These examples use CentOS commands.

  1. Login to the Linux-based computer with administrator privileges.

    You will need to create a user account on the server and in the MySQL database.

  2. (Required) To begin, you should have unixODBC installed to support Microsoft Windows ODBC. If not, download and install the unixODBC driver to the Linux-based computer.
  3. Install the MySQL ODBC driver.

    Command: yum install mysql-connector-odbc

  4. Create a user account for the database.

    The following commands create a MySQL account of dbuser with the password Password1 for the database dbtest. The commands also grant all access to the user account.

    create database testdb;
    create user 'dbuser'@'localhost' identified by 'Password1';
    grant all on dbtest.* to 'dbuser' identified by 'Password1';
  5. (Required) Grant the following access for local access to monitor through SAM and the Orion Platform.

    Enter the IP address of this MySQL Linux-based computer, replacing the example value of 10.100.100.100.

    mysql -uroot -p
    CREATE USER 'dbuser'@'%' IDENTIFIED BY 'Password1';
    GRANT ALL ON testdb.* TO dbuser@'%' IDENTIFIED BY 'Password1';
    GRANT SELECT ON performance_schema.* TO dbuser@'10.100.100.100' IDENTIFIED BY 'Password1';
  6. Test access to the database using the newly created account credentials.

    Command: mysql -u testuser -p

Configure and assign a SAM template with the credentials.

  1. In the Orion Web Console, click Settings > All Settings > SAM Settings > Manage Templates.
  2. Search for the MySQL templates. SolarWinds recommends creating a copy of the template. Select a template based on version and click Copy.
  3. Modify the settings of the template and component monitors based on the metrics you want to monitor.
  4. To enter credentials, select the component monitor checkboxes and click Assign Credentials.
  5. Enter the credentials you created for the database and click OK.
  6. Test the access for the template by assigning it to a node. Click Test Node to assign and test the access. If you encounter issues, verify the credentials and privileges for the account.

If you receive a "Data source name not found and no default driver specified. This error occurs on a CentOS system." message, verify the CentOS system has the mysql-connector-odbc installed.

Use the following command to receive a package and version name on the target Linux-based computer: rpm -q mysql-connector-odbc

Verify you have the appropriate credentials assigned for each component monitor.

  1. Click Settings > All Settings > SAM Settings > Manage Templates.
  2. Search for the SAM template. Select and click Edit.
  3. Select the component monitor to check assigned credentials.
  4. To modify, click Assign Credentials, enter credentials, and click OK.
  5. Test the template.

If you continue to encounter issues, verify the appropriate driver is defined on the CentOS system to match the connection string, as shown in the next example.

cat /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
UsageCount=1
[MySQL ODBC 5.3 Unicode Driver]
Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
UsageCount=1

IBM DB2 with ODBC configurations

For IBM DB2, you need to download, install, and configure DB2 from IBM (© 2019 IBM Corp., available at https://ibm.com, obtained on October 22, 2019). SAM provides two IBM DB2 templates:

Linux-based computers

Here are prerequisites for the following steps:

  • IBM DB2 is installed on a Linux-based computer.
  • A user account exists on the server and in the IBM DB2 database.

To run commands, you will need the instance users for the database. The instance user connects to the DB and should have the sqllib directory set up.

  1. Log into the Linux-based computer with administrator privileges.

  2. Use the following command to install the unixODBC package:

    yum -y install unixODBC

  3. Update the ODBC config files by adding the following settings to /etc/odbcinst.ini:
    [DB2]
    Description = DB2 Driver
    Driver = /opt/ibm/db2/V10.5/lib64/libdb2.so
    FileUsage = 1
    DontDLClose = 1

    Verify that libdb2.so has the correct file path.

  4. Add the following settings to /etc/odbc.ini:
    [dbname]
    Driver = DB2

    The drivers should match in both files.

  5. Connect locally to the database with the instance user credentials. For example:
    isql -v dbname db2inst1 Password1
  6. Log into the DB2 database with the instance user credentials and open the DB2 command line tool.
  7. Enable the required following setting used by the SAM IBM DB2 template:
    UPDATE DBM CFG USING DFT_MON_BUFPOOL ON
    UPDATE DBM CFG USING DFT_MON_LOCK ON
    UPDATE DBM CFG USING DFT_MON_STMT ON
    UPDATE DBM CFG USING DFT_MON_UOW on
  8. Use the GRANT EXECUTE ON FUNCTION statement to grant privileges for the SYSPROC.MON_GET_TABLE function to user, where user is the username that SAM as shown in this example:
    GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLE TO user

Configure DB2 on AIX devices

Prerequisites

Important: Do not install the 64-bit ODBC drivers; use the 32-bit drivers instead to support Python distributed on the Orion agent.

  • Install IBM DB2 ODBC Driver (© 2018 IBM Corp.; https://www-01.ibm.com; link acquired on August 2, 2018) on AIX devices.
    The commands use the following driver bundle: v11.1.1fp1_aix64_odbc_cli_32.tar.gz.
  • Install the ODBC driver manager package and its dependencies from www.perzl.org/aix (Obtained from www.perzl.org/aix, on February 1, 2018). Dependencies include:
    • info-6.4-1.aix5.1.ppc.rpm

    • libiconv-1.15-1.aix5.1.ppc.rpm

    • libtool-ltdl-1.5.26-2.aix5.1.ppc.rpm

    • readline-7.0-3.aix5.1.ppc.rpm

    • libffi-3.1.1.aix5.1.ppc.rpm (not a direct dependency, but needed by the SAM monitor plugin)

  • The gunzip utility, which is part of the AIX 5L™ default installation setup. You can also download gzip for AIX 5L from http://www.ibm.com/servers/aix/products/aixos/linux/rpmgroups.html (© 2018 IBM Corp.; https://www-01.ibm.com; link acquired on August 2, 2018)
  • Verify that the IBM rpm.rte package exists in the /usr/bin/rpm directory

Configure ODBC for AIX

  1. Log into the AIX-based computer with administrator privileges.

  2. Install the RPM packages.

    Run the following command as root: rpm -ivh unixODBC-2.3.4-1.aix5.1.ppc.rpm

    To install all dependencies, run the following command that expects the dependencies are in the same directory:.
    rpm -ivh *.rpm

  3. Install the DB2 ODBC driver. The example code creates a directory odbc_cli_32 in the /opt directory.

    gunzip v11.1.1fp1_aix64_odbc_cli_32.tar.gz

    tar -x -f v11.1.1fp1_aix64_odbc_cli_32.tar -C /opt

  4. Add the following lines to /opt/freeware/etc/odbcinst.ini:
    [DB2]
    Description = DB2 Driver
    Driver = /opt/odbc_cli_32/clidriver/lib/libdb2.so
    FileUsage = 1
    DontDLClose = 1

    Verify libdb2 has the correct file path.

  5. Add the following settings to /opt/freeware/etc/odbc.ini:

    [dbname]

    Description = IBM DB2 ODBC data source

    Driver = DB2

    DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={/opt/odbc_cli_32/clidriver}

    • In [dbname], enter the name of the database to be monitored.
    • DMEnvAttr value depends on the installation directory for the DB2 ODBC CLI driver.
  6. Run the following command as root. It allows the unixODBC manager driver to find the DB2 ODBC file.

    ar -X32 x libdb2.a shr.o

    mv shr.o libdb2.so

  7. Verify that the SAM python plugin can connect to the DB2 database to monitor it. Save the following script as verifyodbc.py.
    The script is written for Orion agents in the default location /opt/SolarWinds/Agent.

    Important: If you are not using the default port, add server hostname and port number to the connection string.

    import sys

    sys.path.insert(0, "/opt/SolarWinds/Agent/bin/Plugins/SharedPythonLibs")

    import pypyodbc

    # Set Database, Uid, and Pwd to the database name, username, and user's password to access said database respectively.

    # In this example, database name, username, and the user's password are TEST, db2inst1, and Password1 respectively.

    conn_str = 'Driver={DB2};Database=TEST;Uid=db2inst1;Pwd=Password1;'

    You can also use the following script to verify that the SAM python plugin can connect to the DB2 database:

    conn = pypyodbc.connect(conn_str, ansi=True)

    conn.close()

    except Exception, ex:

    print ex

    print "Failure"

  8. Run the script using the following command:
    /opt/SolarWinds/Agent/bin/python2 verifyodbc.py
  9. SolarWinds recommends that you configure the utilities bundled in the DB2 ODBC CLI bundle. Create the db2cli.ini configuration file in /opt/odbc_cli_32/clidriver/cfg/db2cli.ini:

    Replace TEST with your database name.


    TEST
    Database=TEST
    dbalias=TEST
    Protocol=TCPIP
    Hostname=127.0.0.1
    ServiceName=50000

Configure and assign the SAM IBM DB2 template to your Linux/Unix-based computer with the instance user credentials.

  1. In the Orion Web Console, click Settings > All Settings > SAM Settings > Manage Templates.
  2. Search for an IBM DB2 template. SolarWinds recommends creating a copy of the template. Select a template based on version and click Copy.
  3. Modify the settings of the template and component monitors based on the metrics you want to monitor.
  4. To enter credentials, select the component monitor check boxes and click Assign Credentials.
  5. Enter the credentials for the instance user account and click OK.
  6. Modify the connection strings for monitors to match your DB. Use one of the following methods:

    • Specify the actual DB and driver:
      Driver={DB2};Database=TESTDB;Hostname=${IP};Port=50000;Protocol=TCPIP;Uid=${USER};Pwd=${PASSWORD};
    • Specify the existing data source in odbc.ini:
      DSN=testdb;Uid=${USER};Pwd=${PASSWORD};