4. HAWK Data API Install

The following steps must be taken to install the HAWK Data package:

user@host:# yum install hawk-data

  1. Edit /var/www/hawk-data/htdocs/API/1.1/config.php.

user@host:# vi /var/www/hawk-data/htdocs/API/1.1/config.php

<?php
        $CONFIG = array();

        $CONFIG['ENABLE_PERSISTENT'] = false;
        $CONFIG['REMOTE_PORT'] = 443;
        $CONFIG['SITE_PROTOCOL'] = 'https';
        $CONFIG['ENABLE_MEMCACHED'] = true;
        $CONFIG['DEBUG'] = true;

        $CONFIG['ENABLE_MONGO'] = true;
        $CONFIG['DSN'] = "DRIVER={MySQL};Server=server1;Database=hawk4";
        //$CONFIG['DSN_SLAVES'] = array( "DRIVER={MySQL};Server=hawk5-server1;Database=hawk4";
        $CONFIG["USER"] = "hawk";
        $CONFIG["PASSWD"] = "password";
        $CONFIG["MONGO_HOST"] = "mongodb://username:password@server1:27017,server2:27017,server3:27017/hawk";
        $CONFIG['MONGO_TIMEOUT'] = 300000; // 5m
        $CONFIG['ENABLE_MEMCACHED'] = true;

        $CONFIG['MONGO_DB'] = 'hawk';

        $CONFIG['MONGO_EVENTS'] = array(
                //! for those upgrading from 4.2
                //'1970-01-01 00:00:00' => array('database' => 'hawk', 'collection' => 'events', 'version' => 1 )
                //'2015-02-12 00:00:00' => array('database' => 'hawk2', 'collection' => 'events', 'version' => 2 )

                //! 5.0 settings
                '1970-01-01 00:00:00' => array('database' => 'hawk', 'collection' => 'events', 'version' => 2 )
        );

        $CONFIG['MONGO_EVENTS_DAILY'] = 'events_daily';

        $CONFIG['MEMCACHED_HOSTS'] = array(
                '127.0.0.1:11211'
        );

        $CONFIG["ENCRYPTION_KEY_PLAIN"] = "ENCRYPTION_KEY";

        if (!defined("CWD"))
                define("CWD", getcwd());

        $CONFIG["SITE_URL"] = "https://hawk5-server3";

        $CONFIG["MAIL_FROM"] = "[email protected]";

?>
$CONFIG[‘DSN’]:

After ‘Server=’ enter IP adddress or Hostname of where Directory Services (MySQL) is installed.

$CONFIG[‘DSN_SLAVES’]:

If using a Secondary Directory Service (MySQL) is installed. After ‘Server=’ enter IP adddress or Hostname of where Directory Services (MySQL) is installed.

$CONFIG[“USER”]:

Username used for Directory Service (MySQL).

$CONFIG[“PASSWD”]:

Password used for Directory Service (MySQL).

$CONFIG[“MONGO_HOST”]:

Mongo connection string. Replace the Username and Password with the MongoDB credentials. Replace the server names with IP address or Hostnames of the MongoDB aggergation servers.

$CONFIG[‘MONGO_TIMEOUT’]:

Mongo connection timeout in milliseconds.

$CONFIG[‘ENABLE_MEMCACHED’]:

Enable or Disable memcached.

$CONFIG[‘MONGO_DB’]:

Mongo Database name to be used.

$CONFIG[‘MONGO_EVENTS’]:

Mongo collection events should be stored in.

$CONFIG[‘MONGO_EVENTS_DAILY’]:

Mongo collection for daily events.

$CONFIG[‘MEMCACHED_HOSTS’]:

Enter memcached IP address or Hostnames. If using a memcached pool seperate host using a comma ‘,’.

$CONFIG[“ENCRYPTION_KEY_PLAIN”]:

Encryption key used for encrypting resource templates. Same key is used in hawk-pulsed.

$CONFIG[“SITE_URL”]:

IP address or Hostname where hawk-iek (User Interface) is installed.

$CONFIG[“MAIL_FROM”]:

Enter the e-mail address you want notification to be sent from.

$CONFIG[“ENABLE_REMEDY”]:

Enable remote remedy integration support.

$CONFIG[“REMEDY_REMOTE_URL”]:

The remote remedy url to be used as the base of the requests. Ex: http://tomcat.host.com/arapi/arserver/

$CONFIG[“REMEDY_SCHEMA”]:

The remote remedy schema to be used. Ex: HelpDesk

$CONFIG[“REMEDY_USERNAME”]:

Enter the e-mail address you want notification to be sent from.

$CONFIG[“REMEDY_PASSWORD”]:

Enter the e-mail address you want notification to be sent from.

Note

Make sure you change your ENCRYPTION_KEY_PLAIN. A easy way to create a pseudo random password. user@host#: date +%s | sha256sum | base64 | head -c 32 ; echo

  1. Edit /var/www/hawk-data/bin/config.ini.

user@host:# vi /var/www/hawk-data/bin/config.ini

[DB]
host = Server1
database = hawk4
username = USERNAME
password = PASSWORD
host:

Enter IP adddress or Hostname of where Directory Services (MySQL) is installed.

database:

Enter Directory Service database to be used.

username:

Username used for Directory Service (MySQL).

password:

Password used for Directory Service (MySQL).

  1. Restart hawk-data.

user@host:# service hawk-data restart