From e61214dcc1d40dfe33994830f54b4d0d83b3a70a Mon Sep 17 00:00:00 2001 From: LeonChapman <46498444+lchapman4@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:31:46 -0800 Subject: [PATCH] initial macos examples (#529) * initial macos examples creating this folder for macos flex examples * corrected file directory * MacOS Flex Install Doc --- .../macos/MacOS-Flex-Install-Directions.rtf | 27 +++++++++++++++++++ examples/macos/macos-python-packages.yml | 24 +++++++++++++++++ examples/macos/macos-sdks.yml | 13 +++++++++ 3 files changed, 64 insertions(+) create mode 100644 examples/macos/MacOS-Flex-Install-Directions.rtf create mode 100644 examples/macos/macos-python-packages.yml create mode 100644 examples/macos/macos-sdks.yml diff --git a/examples/macos/MacOS-Flex-Install-Directions.rtf b/examples/macos/MacOS-Flex-Install-Directions.rtf new file mode 100644 index 00000000..6c1045b6 --- /dev/null +++ b/examples/macos/MacOS-Flex-Install-Directions.rtf @@ -0,0 +1,27 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2761 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;} +{\colortbl;\red255\green255\blue255;\red194\green126\blue101;\red24\green24\blue24;\red193\green193\blue193; +\red183\green111\blue179;\red238\green46\blue56;} +{\*\expandedcolortbl;;\cssrgb\c80784\c56863\c47059;\cssrgb\c12157\c12157\c12157;\cssrgb\c80000\c80000\c80000; +\cssrgb\c77255\c52549\c75294;\cssrgb\c95686\c27843\c27843;} +\margl1440\margr1440\vieww30020\viewh8400\viewkind0 +\deftab720 +\pard\pardeftab720\partightenfactor0 + +\f0\fs24 \cf2 \cb3 \expnd0\expndtw0\kerning0 +\outl0\strokewidth0 \strokec2 curl -L https://github.com/newrelic/nri-flex/releases/download/v1.9.2/nri-flex_darwin_1.9.2_arm64.tar.gz > /tmp/nri-flex_darwin_1.9.2_arm64.tar.gz &&\cf4 \cb1 \strokec4 \ +\cf2 \cb3 \strokec2 tar -xvzf /tmp/nri-flex_darwin_1.9.2_arm64.tar.gz &&\cf4 \cb1 \strokec4 \ +\cf2 \cb3 \strokec2 sudo mkdir /var/db/newrelic-infra &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo mkdir /var/db/newrelic-infra/newrelic-integrations &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo mkdir /var/db/newrelic-infra/newrelic-integrations/bin &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo mv /tmp/nri-flex /var/db/newrelic-infra/newrelic-integrations/bin &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo mkdir /etc/newrelic-infra/ &&\cf4 \cb1 \strokec4 \ +\cf2 \cb3 \strokec2 sudo mkdir /etc/newrelic-infra/integrations.d/ &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo chmod 777 /etc/newrelic-infra/integrations.d/ &&\cf4 \cb1 \strokec4 \ +\cf2 \cb3 \strokec2 sudo mkdir /var/log/newrelic-infra/ &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo touch /var/log/newrelic-infra/nrflex.log &&\cf4 \strokec4 \cb1 \ +\cf2 \cb3 \strokec2 sudo chmod 666 /var/log/newrelic-infra/nrflex.log &&\cf4 \cb1 \strokec4 \ +\pard\pardeftab720\partightenfactor0 +\cf4 \cb3 \{ \cf2 \strokec2 crontab -l 2>/dev/null; echo "0 * * * * /var/db/newrelic-infra/newrelic-integrations/bin/nri-flex -insights_api_key INSERT_NR_API_KEY_HERE -insights_url https://insights-collector.newrelic.com/v1/accounts/NR-Account-ID-Here/events -config_path /etc/newrelic-infra/integrations.d/macos-python-packages.yml >> /var/log/newrelic-infra/macos-python-packages.log 2>&1"\cf4 \strokec4 \} \cf5 \strokec5 |\cf6 \strokec6 crontab -\cf4 \cb1 \strokec4 \ +\ +} \ No newline at end of file diff --git a/examples/macos/macos-python-packages.yml b/examples/macos/macos-python-packages.yml new file mode 100644 index 00000000..cb1a7591 --- /dev/null +++ b/examples/macos/macos-python-packages.yml @@ -0,0 +1,24 @@ +integrations: + - name: nri-flex + config: + name: PythonPackages + apis: + - event_type: pythonpackages + commands: + - run: pip3 list --format=json --exclude-editable + + - event_type: pythonversion + commands: + - run: python3 --version + split: horizontal + set_header: [version] + regex_match: true + split_by: (.+) + + - event_type: pythonhomebrew + commands: + - run: ls -d /opt/homebrew/opt/python* + split: horizontal + set_header: [pythondirectory] + regex_match: true + split_by: (\S+) diff --git a/examples/macos/macos-sdks.yml b/examples/macos/macos-sdks.yml new file mode 100644 index 00000000..d969b109 --- /dev/null +++ b/examples/macos/macos-sdks.yml @@ -0,0 +1,13 @@ +--- +integrations: + - name: nri-flex + config: + name: MacOSSDKs + apis: + - event_type: macossdk + commands: + - run: xcodebuild -showsdks 2>/dev/null | grep -o '\-sdk \S*' | awk '{print $2}' + split: horizontal + set_header: [sdk] + regex_match: true + split_by: (\S+) \ No newline at end of file