Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change init script to text #13

Closed
scotty-tarvan opened this issue Jun 13, 2020 · 0 comments · Fixed by #16
Closed

Change init script to text #13

scotty-tarvan opened this issue Jun 13, 2020 · 0 comments · Fixed by #16

Comments

@scotty-tarvan
Copy link

scotty-tarvan commented Jun 13, 2020

I revisited this issue a few times as I went through many steps to try and get log analytics working.

To cut a long story short you can find the correct init script by going to log analytics -> advanced settings -> connected sources -> linux servers, see at bottom there will be a link to DOWNLOAD AND ONBOARD AGENT FOR LINUX, use that link to create an init script that looks like this:

script = """
sed -i "s/^exit 101$/exit 0/" /usr/sbin/policy-rc.d 
wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh && sh onboard_agent.sh -w <YOUR-ID> -s <YOUR-KEY> -d opinsights.azure.com
"""

#save script to databricks file system so it can be loaded by VMs
dbutils.fs.put("/databricks/log_init_scripts/configure-omsagent.sh", script, True)

The other parts of the init script shown in the document are not required i.e. you do not need to do a restart as in:

sudo su omsagent -c 'python /opt/microsoft/omsconfig/Scripts/PerformRequiredConfigurationChecks.py' 
/opt/microsoft/omsagent/bin/service_control restart <YOUR-ID>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant