Flex-Integration error to run a linux command

This is my first attempt at getting my own NRI flex to work. I did copy the tutorial flex-uptime.yml and it is working, And to make sure I had things indented properly, I used a copy of the same working file and just replaced the values

Below is my yml file

Hi Paul,

Thanks for sending the links, they were helpful and quick to study. I think I followed the instruction from the flex integration link and created a yml file to run a command. I have enabled the infra agent log with debug mode but I couldn’t understand is happening. I’m adding my custom yml and also the log which was generated after the restart of infra agent.
cat oom-killer.yml
integrations:

  • name: oom-killer-script
    config:
    name: Check-OOM-Killer
    apis:
  • name: oom-killer
    commands:
  • run: ‘journalctl -k --no-pager --since “1 hour ago”’

The NR Infra agent shows this in the log file

time="2020-07-22T02:06:37Z" level=debug msg="folder does not exist. Ignoring" component=integrations.DefinitionsRepo folder=/var/db/newrelic-infra/bundled-plugins
time="2020-07-22T02:06:37Z" level=debug msg="folder does not exist. Ignoring" component=integrations.DefinitionsRepo folder=/var/db/newrelic-infra/plugins
time="2020-07-22T02:06:37Z" level=debug msg="loading config" component=integrations.Manager file=docker-config.yml folder=/etc/newrelic-infra/integrations.d/
time="2020-07-22T02:06:37Z" level=debug msg="loading config" component=integrations.Manager file=oom-killer.yml folder=/etc/newrelic-infra/integrations.d/
time="2020-07-22T02:06:37Z" level=debug msg="watching /etc/newrelic-infra/integrations.d/" component=integrations.Manager folder=/etc/newrelic-infra/integrations.d/
time="2020-07-22T02:06:37Z" level=debug msg="watching :/etc/newrelic-infra/integrations.d/docker-config.yml" component=integrations.Manager folder=/etc/newrelic-infra/integrations.d/
time="2020-07-22T02:06:37Z" level=debug msg="watching :/etc/newrelic-infra/integrations.d/oom-killer.yml" component=integrations.Manager folder=/etc/newrelic-infra/integrations.d/
time="2020-07-22T02:06:37Z" level=debug msg="loading integrations from folder" component=integrations.Manager folder=/etc/newrelic-infra/integrations.d/ found="docker-config.yml, oom-killer.yml"
time="2020-07-22T02:06:37Z" level=debug msg="setting default timeout" component=integrations.Definition default_timeout=2m0s
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/custom-integrations forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/custom-integrations/bin: no such file or directory" folder=/var/db/newrelic-infra/custom-integrations/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=bin folder=/var/db/newrelic-infra/newrelic-integrations forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=logging folder=/var/db/newrelic-infra/newrelic-integrations forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/newrelic-integrations forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=nri-docker folder=/var/db/newrelic-infra/newrelic-integrations/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=nri-flex folder=/var/db/newrelic-infra/newrelic-integrations/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/newrelic-integrations/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/bundled-plugins: no such file or directory" folder=/var/db/newrelic-infra/bundled-plugins forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/bundled-plugins/bin: no such file or directory" folder=/var/db/newrelic-infra/bundled-plugins/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/plugins: no such file or directory" folder=/var/db/newrelic-infra/plugins forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/plugins/bin: no such file or directory" folder=/var/db/newrelic-infra/plugins/bin forName=oom-killer-script
time="2020-07-22T02:06:37Z" level=warning msg="can't instantiate integrations from file" component=integrations.Manager error="can't instantiate integration: can't find an executable given the name: oom-killer-script" file=/etc/newrelic-infra/integrations.d/oom-killer.yml
time="2020-07-22T02:06:37Z" level=debug msg="setting default timeout" component=integrations.Definition default_timeout=2m0s
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/custom-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/custom-integrations/bin: no such file or directory" folder=/var/db/newrelic-infra/custom-integrations/bin forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=bin folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=logging folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="setting default timeout" component=integrations.Definition default_timeout=2m0s
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/custom-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="error looking for integration executables in folder. Trying another folder, if any" component=integrations.Executables error="open /var/db/newrelic-infra/custom-integrations/bin: no such file or directory" folder=/var/db/newrelic-infra/custom-integrations/bin forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=bin folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="file does not match" component=integrations.Executables file=logging folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker
time="2020-07-22T02:06:37Z" level=debug msg="integration name not found. Trying another folder, if any" component=integrations.Executables folder=/var/db/newrelic-infra/newrelic-integrations forName=nri-docker

Let me know if you need more information

Thanks,
Srikanth

Hi Srikanth,

It looks like your Flex configuration is attempting to parse logs via journalctl from the last hour. I don’t believe this use-case is well suited to Flex. You might consider instead forwarding your Logs with one of our Logging plugins: