WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Automating Log Insight 2.0 configurations

Automating Log Insight 2.0 configurations

04.21.2014 by William Lam // Leave a Comment

Last week I had a chance to deploy the latest release of vCenter Log Insight 2.0 (currently in public beta) in my lab to give it a spin. I must say, I am very impressed with the slick new UI and some of the new capabilities like the scale-out and high availability feature.

automate-log-insight-2-0-configuration-0
The actual deployment of the Virtual Appliance is pretty straight forward and the only thing I would mention when selecting the OVF Deployment Size is that the default "Small" option is not the smallest configuration possible. There is actually an "Extra Small" option that can be selected in the drop-down menu which is targeted for POCs and lab evaluations. This will help with minimizing the resource constraints for lab environments.

Something that I am always interested in when evaluating a new solution is to see how easy an automated and unattended configuration is. With the help of some of the Log Insight folks, I was able to create the following shell script which will perform a basic configuration of Log Insight which includes the backend database, admin password and NTP servers:

#!/bin/bash
# William Lam
# www.virtuallyghetto.com

LOG_INSIGHT_ADMIN_PASSWORD=vmware123
LOG_INSIGHT_DB_PASSWORD=vmware123
NTP_SERVERS="0.pool.ntp.org, 1.pool.ntp.org"

### DO NOT EDIT BEYOND HERE ###

LOG_INSIGHT_CONFIG_DIR=/storage/core/loginsight/config
NODE_TOKEN_FILE=node-token
LOG_INSIGHT_CONFIG_FILE=loginsight-config.xml#1
NODE_UUID=$(uuidgen)

echo "Creating ${LOG_INSIGHT_CONFIG_DIR} .."
[ ! -e ${LOG_INSIGHT_CONFIG_DIR} ] && mkdir -p ${LOG_INSIGHT_CONFIG_DIR}

echo "Generating Log Insight Node UUID ..."
echo ${NODE_UUID} > ${LOG_INSIGHT_CONFIG_DIR}/${NODE_TOKEN_FILE}

echo "Generating Log Insight Configuration file ..."
cat > ${LOG_INSIGHT_CONFIG_DIR}/${LOG_INSIGHT_CONFIG_FILE} << __LOG_INSIGHT__
<config>
<version>
<strata-version value="2.0.1-1734312.UNSTABLE" release-name="Nightly"/>
</version>
<distributed overwrite-children="true">
<daemon port="16520" token="${NODE_UUID}">
<service-group name="standalone"/>
</daemon>
</distributed>
<database>
<password value="${LOG_INSIGHT_DB_PASSWORD}"/>
<port value="12543"/>
</database>
<ntp>
<ntp-servers value="${NTP_SERVERS}"/>
</ntp>
</config>
__LOG_INSIGHT__

echo "Restarting Log Insight ..."
service loginsight restart

echo "Setting Admin password ..."
ADMINPASSWORD=${LOG_INSIGHT_ADMIN_PASSWORD} /opt/vmware/bin/li-reset-admin-passwd.sh

You will need to edit the following variables within the script:

  • LOG_INSIGHT_ADMIN_PASSWORD
  • LOG_INSIGHT_DB_PASSWORD
  • NTP_SERVERS

Here is an example of running the script against a newly deployed Log Insight system:

automate-log-insight-2-0-configuration-1
The above is just an example of what could be automated for Log Insight. If you take a look at the Configuration section of Log Insight, there are many more options.

automate-log-insight-2-0-configuration-2
If you decide you want to automate additional configurations. The way you would accomplish this is to first configure everything from the Log Insight configuration UI. Once you are happy with the configuration, SSH into your Log Insight system. In /storage/core/loginsight/config you will find a couple of configuration files loginsight-config.xml#X with a numeric number at the end. If you take a look at the file with the highest number, it will contain the latest changes to Log Insight and the configurations you made using the UI. You can then take that file and update the script to automate the other configuration options.

More from my site

  • A preview of native syslog support in VCSA 6.0
  • How to customize the login UI for vRealize {Operations Manager, Log Insight, Automation}?
  • A Hidden vSphere 5.1 Gem - Forwarding Virtual Machine Logs (vmware.log) to Syslog Part 2
  • A Hidden vSphere 5.1 Gem - Forwarding Virtual Machine Logs (vmware.log) to Syslog Part 1
  • How to Quickly Get Started with VMware vSphere & OpenStack?

Categories // Automation Tags // vCenter Log Insight

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...