Thursday, December 17, 2020

Automate Telegraph Agent Installation using SaltStack for Application Monitoring in vROPs Cloud

In this blog, I would demonstrate how to automate the installation of Telegraph Agent using SaltStack. It is required for vROPs Cloud Application Monitoring. 

Once you have it successfully installed you can discover the supported services in vROPs Cloud. 

In my example, I have Apache HTTPd service installed on the CentOS machine running on VMware Cloud on AWS SDDC. 

You can also refer to my previous blog on how to automate log insight agent using salt stack. 










Pre-requisites

Following are the pre-requisites 
  • Working Setup of Saltstack with Master and Minion
    • I have 1 Master and 1 Minion on CentOS, and I will be installing a telegraph agent on the minion 
  • vROPs Cloud Proxy deployed and the vCenter where the VM has been deployed is added in vROPs Cloud 
  • vROPs Cloud Proxy is accessible from the Salt Stack minion. 
  • As we will be using the install script to deploy the agent all the required pre-requisites should be completed as per the documentation.

Procedure


The following section includes steps for installing Telegraph Agent using salt stack.

Step 1


Create the state file vrops-agent.sls. You can refer to the documentation on How to use/create the Salt States




copy-script:
   cmd.run:
      - name: sudo curl -k "https://CloudProxyIPorFQDN/downloads/salt/download.sh" --output /tmp/download.sh
make-script-executable:
   cmd.run:
      - name: sudo chmod +x /tmp/download.sh
install-vrops-agent:
   cmd.run:
      - name: sudo /tmp/download.sh -o install -t <refreshToken> -d /tmp

Update the Cloud Proxy IP/FQDN which will be the source of the download.sh script







Step 2 

Test execute of the state file and ensure it succeeds 

salt <minionhostname> state.sls vrops-agent test








Step 3

Apply the state file to the minion

salt <minionhostname> state.sls vrops-agent

If you want to push it to all the minions that you can just use the following

salt '*' state.sls vrops-agent

When  you use an automation script, concurrent agent installation with a batch size of 20 is supported 















Step 4

Verify agent on the vROPs 







Once you configure the Service Discovery you should be able to see discover services 




 

 

Monday, December 14, 2020

Automate Log Insight Agent Installation using SaltStack


In this blog, I would demonstrate how to automate install VMware Log Insight Agent using SaltStack. 

What is VMware Log Insight Agent? 

A Log Insight agent collects events from log files and forwards them to a vRealize Log Insight and Log Insight Cloud 





















What is Saltstack?

SaltStack is built on a powerful event-driven automation engine that provides IT, devops and SRE professionals with a simple, declarative management framework for their entire global infrastructure.


















Pre-requisites

Following are the pre-requisites 
  • Working Setup of Saltstack with Master and Minion
    • I have 1 Master and 1 Minion on CentOS, and I will be installing liagent on the minion
  • Log Insight Agent saved on Webserver. 
    • I will be installing LI Agent 8.2 
  • Log Insight Agent ini file (Optional, If you are going to use the default from the log insight server) 

Procedure


The following section includes steps for installing LI Agent using salt stack

Step 1


Create the state file liagent.sls . You can refer to the documentation on How to use/create Salt States


 
copy-liagent-rpm:
   cmd.run:
      - name: sudo curl -k http://webserver/LIAgent/VMware-Log-Insight-Agent-8.2.0-16776561.rpm --output /tmp/VMware-Log-Insight-Agent-8.2.0-16776561.rpm
install-liagent:
   cmd.run:
      - name: sudo rpm -i /tmp/VMware-Log-Insight-Agent-8.2.0-16776561.rpm
copy-liagentconfig:
   cmd.run:
      - name: sudo curl -k http://webserver/LIAgent/liagent.ini --output /var/lib/loginsight-agent/liagent.ini
restart-liagentd:
   cmd.run:
      - name: sudo systemctl restart liagentd     








Step 2 

Test execute of the state file and ensure it succeeds 

salt <minionhostname> state.sls liagent test




















Step 3

Apply the state file to the minion

salt <minionhostname> state.sls liagent
If you want to push it to all the minions that you can just use the following

salt '*' state.sls liagent





































Step 4

Verify liagent on the minion

systemctl status liagentd