Backend Administration
You can only perform some of the administrative operations by logging on to one of the nodes directly. Such operations include starting and stopping Resolve Insights services, making some types of configuration changes, and upgrading Insights.
Preventing Services from Starting
Immediately after installation, the meridian
init script is configured to provide an easy way to manually start and stop all Insights services on a node. You can reconfigure the script to disable one or more of the services in case you don’t need them running on this particular node when doing manually starting it.
The next time you start all services using the meridian
script it will not start the disabled services. The script will still stop all Insights services if they are running, even the disabled services.
Take the following steps on each separate node where you want to disable services:
- Log in to the node's backend.
- Run the following command for each service that you don’t need:Where
service <servicename> stop
<servicename>
is the service name. - Open
/etc/init.d/meridian
for editing. - Find the
disabled="<service>"
line where<service>
might be set up differently depending on your deployment. - Add the names of the services that you want to disable inside the quotation marks, separating them using a space.
For example:disabled="logstash nginx netra"
- Save the file.
If you also want to prevent these Insights services from starting automatically on system boot, you need to remove their symbolic links from /etc/service
.
Take these steps to remove a service symbolic link:
- Log in to the node's backend.
- Go to
/etc/service
.cd /etc/service
- List the directory content:
ls -la
- Delete the symbolic link for the service you want to disable:Where
rm -f <servicename>
<servicename>
is the service name.
If you ever need to re-enable a service for auto-starting on boot, re-create the symbolic link in /etc/service
:
- Log in to the node's backend.
- Go to
/etc/service
.cd /etc/service
- Create the symbolic link:Where
ln -s /opt/meridian/etc/sv/<servicename> <servicename>
<servicename>
is the service name.
Accessing the SQL Database
The DC Master node runs an SQL database that you might need to access for making settings that are otherwise not available in the UI.
Insights includes an alias command that allows you to interact with the SQL database. It provides DB administrator access to the SQL database.
Before running the command, contact your Resolve representative to provide you the SQL DB password if you don't already have it.
Take these steps to administrate and query the SQL database:
- Log in to the DC Master.
- Log in to the SQL database:
dcmysql
- When asked for a password, enter the SQL DB value provided by your Resolve representative.
- Run your SQL quesries.
Deleting Discovery Duplicates
Discovery duplicates might appear when a device can be discovered using more than one discovery method. An example is a compute device discovered once over SSH and one more time over SNMP - a protocol that is not recommended for use with this type of device.
Insights provide a pair of scripts that help you delete devices, or traces thereof, from the DC and the NCE using the device's hostname. The full device deletion includes two procedures - the first on the DC Master and the second on the NCE Master.
After running both procedures, the device duplicates should no longer appear on the Insights UI.
DC Procedure
Take these steps on the DC Master to delete devices manually based on their hostnames:
Type the following command to go to the Insights code directory:
dccode
Create a plain-text file listing the hostnames that you want to delete, one hostname per line.
Open the SQL management console and log in:
dcmysql
Read all records from the
dc_device
table that match the hostnames listed in the hostname file that you prepared and take note of the total count.
select count(*) from dc_device where hostname in ("hostname-1", "hostname-2");
Copy the device deletion script to the code directory:
cp /opt/FS/meridian-<build>/cookbooks/base/files/default/scripts/delete_devices_dc_sql.py .
Replace
/opt/FS/meridian-<build>/
with the actual path where you unpacked the current Insights version.Run the deletion script:
python delete_devices_dc_sql.py --hostname-list-file <hostname-list> >> deleted_hostnames.out
Where
<hostname-list>
is the hostname file that you created anddeleted_hostnames.out
is where the script output will be saved.Verify the deletion:
- Compare the count of affected hostnames from
deleted_hostnames.out
to the count that you got from the SQL step.
The counts should be the same. - Rerun the SQL step.
This time the total record count should be zero.
- Compare the count of affected hostnames from
Open
<script-output>
and make a copy of the list following this statement:
deleted device_uid list from dc:
You will need the data for the NCE procedure.
It is recommended to keep deleted_hostnames.out
for auditing purposes. New script runs append to the file as opposed to replacing it.
NCE Procedure
Take these steps on the NCE Master to delete devices manually based on the data that was output from the delete_devices_dc_sql.py
script on DC:
Create a plain-text file listing the Device UIDs that you acquired on the DC, one Device UID per line, and save it anywhere you want on the NCE Master.
Copy the hostname list file from the DC.
Go to the script location:
cd /opt/FS/meridian-<build>/cookbooks/base/files/default/scripts/
Replace
/opt/FS/meridian-<build>/
with the actual path where you unpacked the current Insights version.It is recommended to copy the
Deleting_from_NCE_by_Device_ID_New.sh
script from this directory to a location under/opt/meridian
for future use.Run the deletion script:
./Deleting_from_NCE_by_Device_ID_New.s -N <NCE IP> -D <device-uid-list> >> deleted_devices.out
Where:<NCE IP>
is the IP address of the NCE Master.<device-uid-list>
is the Device UID file that you created.deleted_devices.out
is where the script output will be saved.
It is recommended to keep deleted_devices.out
for auditing purposes. New script runs append to the file as opposed to replacing it.
Setting the Hostname Format
The Hostname inventory field shows the device's hostname by default—the FQDN minus the domain part. In large networks, this could make finding devices by hostname hard if the same hostname is in use in multiple subdomains.
To make finding and identifying devices easier in your Inventory, you can opt to use a different hostname format just for Insights visualization purposes; the actual hostname will not be altered.
Take the following FQDNs for example:
crm.marketing.example.com
crm.sales.example.com
With the default settings, you will get two devices in your Inventory, both showing crm
in the Hostname column. By choosing an alternative hostname format, you could have the Hostname column show a more qualified text. Two format options are available:
- Include—Specify what value to append to the hostname. Any dots are stripped from the specified value and the result is appended to the hostname, giving you the value you see in your inventory.
Example:- Hostname:
crm
- FQDN:
crm.marketing.example.com
- Specified include value:
marketing.example.com
- Resulting hostname:
crmmarketingexamplecom
- Hostname:
- Exclude—Removes a specified value from the FQDN, strips the remainder off the dots, and uses the result as a hostname.
Example:- Hostname:
crm
- FQDN:
crm.marketing.example.com
- Specified exclude value:
example.com
- Resulting hostname:
crmmarketing
- Hostname:
You can change the hostname format at any time; The change will be applied the next time discovery runs.
You need to apply the format settings domain by domain. You can't control the hostname format centrally for all domains.
Take these steps to change the hostname format for a domain:
- Log in to the SQL database, following these instructions.
- Insert a row in the
dc_hostname_domain_exclusion
table:Where you need to replace the following valued after theINSERT INTO dc_hostname_domain_exclusion (organization, domain_name, dc_action) VALUES ('<orgName>', '<inclueOrExcludeValue>', '<include|exclude>');
VALUES
keyword:orgName
is unused. Set it to any value except forNULL
.inclueOrExcludeValue
is the value to include or exclude, depending on the value ofdc_action
.include|exclude
is one of the following:include
if you want to specify a value to append to the hostname; set the value ininclueOrExcludeValue
.exclude
if you want to specify a value to exclude from the FQDN; set the value ininclueOrExcludeValue
.
If the dc_hostname_domain_exclusion
table contains both an include and an exclude rows for the same domain, the include rule is applied.